package com.cirle.scientific.controller.miniapp;/*
 *24901
 *2023/1/4
 *9:47
 */

import com.cirle.scientific.pojo.BizCodeEnum;
import com.cirle.scientific.pojo.Result;
import com.cirle.scientific.service.SuperviseAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author 24901
 */
@Controller
@RequestMapping("/app/Supervise")
@Api("督导与指控接口")
public class SuperviseController {

    private SuperviseAppService superviseAppService;

    @Autowired
    public void setSuperviseAppService(SuperviseAppService superviseAppService) {
        this.superviseAppService = superviseAppService;
    }

    @GetMapping("/findSupervise")
    @ApiOperation("获取督导结果接口")
    @ResponseBody
    public Result findSupervise(@ApiParam(name = "memCard", value = "用户唯一标识")  @RequestAttribute(name = "memCard", required = false)  String memCard
            , @RequestParam(name = "type") Integer type){
        if(null == memCard){
            return Result.success(BizCodeEnum.NO_LOGIN);
        }
        return Result.success(superviseAppService.findSuperviseResult(memCard,type));
    }


}
