package com.ningdatech.carapi.analysis.controller;


import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.analysis.entity.req.SecurityManageGradeListReq;
import com.ningdatech.carapi.analysis.entity.req.SecurityRiskEvalListReq;
import com.ningdatech.carapi.analysis.entity.req.SecurityRiskEvalSaveReq;
import com.ningdatech.carapi.analysis.entity.req.SecuritySystemBuildingEvalSaveReq;
import com.ningdatech.carapi.analysis.entity.vo.SecurityManageGradeVo;
import com.ningdatech.carapi.analysis.entity.vo.SecurityManageResultEvalListVo;
import com.ningdatech.carapi.analysis.entity.vo.SecurityRiskEvalListVo;
import com.ningdatech.carapi.analysis.entity.vo.SecuritySystemBuildingEvalListVo;
import com.ningdatech.carapi.analysis.manage.SecurityAnalysisEvalManage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 安全管理综合评级 前端控制器
 * </p>
 *
 * @author WendyYang
 * @since 2022-10-13
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "分析评估-安全分析评估")
@RequestMapping("/api/v1/security/analysis-eval")
public class SecurityAnalysisEvalController {

    private final SecurityAnalysisEvalManage securityAnalysisEvalManage;

    @GetMapping("/smg/list")
    @ApiOperation("安全管理综合评级列表")
    public PageVo<SecurityManageGradeVo> listSecurityManageGrade(SecurityManageGradeListReq req) {
        return securityAnalysisEvalManage.list(req);
    }

    @GetMapping("/sre/list")
    @ApiOperation("安全责任体系分析评估列表")
    public PageVo<SecurityRiskEvalListVo> listSecurityRiskEval(SecurityRiskEvalListReq req) {
        return securityAnalysisEvalManage.list(req);
    }

    @PostMapping("/sre/save")
    @ApiOperation("新增安全责任体系分析评估")
    public IdVo<Integer> save(@Valid @RequestBody SecurityRiskEvalSaveReq req) {
        return securityAnalysisEvalManage.save(req);
    }

    @GetMapping("/ibe/list")
    @ApiOperation("安全制度建设分析评估列表")
    public PageVo<SecuritySystemBuildingEvalListVo> listInstitutionBuildingEval(SecurityRiskEvalListReq req) {
        return securityAnalysisEvalManage.listSystemBuildingEval(req);
    }

    @PostMapping("/ibe/save")
    @ApiOperation("保存安全制度建设分析评估")
    public IdVo<Integer> save(@Valid @RequestBody SecuritySystemBuildingEvalSaveReq req) {
        return securityAnalysisEvalManage.save(req);
    }

    @GetMapping("/smre/list")
    @ApiOperation("安全管理结果分析评估列表")
    public PageVo<SecurityManageResultEvalListVo> listSecurityManageResultEval(SecurityRiskEvalListReq req) {
        return securityAnalysisEvalManage.listSecurityManageResultEval(req);
    }
}
