package cn.iocoder.yudao.module.member.controller.app.admincard;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.member.controller.app.admincard.vo.AppAdminCardRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.admincard.AdminCardDO;
import cn.iocoder.yudao.module.member.service.admincard.AdminCardService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "用户 APP - 管理员卡")
@RestController
@RequestMapping("/member/admin-card")
@Validated
public class AppAdminCardController {

    @Resource
    private AdminCardService adminCardService;

    @GetMapping("/list")
    @Operation(summary = "获得管理员卡不分页")
    //@PreAuthorize("@ss.hasPermission('member:admin-card:query')")
    public CommonResult<List<AppAdminCardRespVO>> getAdminCardList() {
        List<AdminCardDO> pageResult = adminCardService.getAdminCardList();
        return success(BeanUtils.toBean(pageResult, AppAdminCardRespVO.class));
    }

}