package com.wteam.controller.card;

import com.wteam.framework.common.enums.CardTypeEnum;
import com.wteam.framework.common.vo.ResultMessage;
import com.wteam.framework.modules.book.entity.Card;
import com.wteam.framework.modules.card.entity.CbCardAdmin;
import com.wteam.framework.modules.card.service.CardAdminService;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author doncic
 * @date 2023/10/7 22:40
 */
@Slf4j
@Tag(name = "管理卡相关接口管理")
@RestController
@RequestMapping("/v1/cardAdmin")
public class CardAdminController {



    @Autowired
    private CardAdminService cardAdminService;


    /**
     * 展示这个门店的所有卡
     *
     * @return
     */
    @Operation(summary = "展示该门店所有卡")
    @GetMapping("/showAllCard/{cardTypeEnum}")
    public ResultMessage<List<CbCardAdmin>> showAllCard(
            @NotNull @PathVariable CardTypeEnum cardTypeEnum) {
        return cardAdminService.showAllCard(cardTypeEnum);
    }

}
