package com.qmth.themis.exam.api;

import com.qmth.themis.business.constant.SystemConstant;
import com.qmth.themis.business.entity.TSBlackList;
import com.qmth.themis.business.service.ThemisCacheService;
import com.qmth.themis.common.util.Result;
import com.qmth.themis.common.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 黑名单表 前端控制器
 * </p>
 *
 * @author wangliang
 * @since 2023-01-31
 */
@Api(tags = "黑名单信息Controller")
@RestController
@RequestMapping(SystemConstant.PREFIX_URL_OE + "/black/list")
@Validated
public class TSBlackListController {

    @Resource
    ThemisCacheService themisCacheService;

    @ApiOperation(value = "黑名单查询接口")
    @RequestMapping(value = "/select", method = RequestMethod.POST)
    @ApiResponses({@ApiResponse(code = 200, message = "黑名单信息", response = TSBlackList.class)})
    public Result select() {
        return ResultUtil.ok(themisCacheService.blackListCache());
    }
}
