package com.winsun.controller;

import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.base.controller.BaseController;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.bean.AuthCode;
import com.winsun.mapper.AuthCodeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.Pattern;
import java.util.List;
import java.util.Map;

/**
 * @Author: chenhaojian
 * @Date: 2021/1/14
 */
@RestController
@RequestMapping("/authCode")
public class AuthCodeController extends BaseController {

    private static AuthCodeMapper authCodeMapper;

    // 查询验证码
    @Permission(menuname = "查询验证码",value = "queryAuthCode",method = RequestMethod.POST)
    public ResponseData<List<AuthCode>> queryAuthCodeList(@RequestParam(name = "id",required = false) String id){

        List<AuthCode> queryAuthCodeList = authCodeMapper.queryAuthCode(id);
        return ResponseData.success(queryAuthCodeList,"查询完毕！");
    }
    @Autowired
    public AuthCodeController(AuthCodeMapper authCodeMapper){
        AuthCodeController.authCodeMapper = authCodeMapper;
    }
}
