package cn.cecep.talroad.controller;

import cn.cecep.talroad.common.core.web.controller.BasesController;
import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.domain.BEnterpriseRiskAssessment;
import cn.cecep.talroad.domain.BEnterpriseRiskAssessmentLast;
import cn.cecep.talroad.service.BEnterpriseRiskAssessmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author: weizhuang
 * @Date:2023/3/16 14:23
 * @Version 1.0
 */
@Api(tags = "A企业风险评估")
@RestController
@RequestMapping("/riskAssessment")
public class BEnterpriseRiskAssessmentController extends BasesController {

    @Autowired
    private BEnterpriseRiskAssessmentService bEnterpriseRiskAssessmentService;


    /**
     * 获取企业基本信息详细信息
     */
    @ApiOperation(value = "查询企业风险评估-新版")
    @GetMapping(value = "/last/{factoryId}")
    public AjaxResults<Map<String,Object>> getLastInfo(@PathVariable("factoryId") String factoryId) {
        return AjaxResults.success(bEnterpriseRiskAssessmentService.getLastInfo(factoryId));
    }

    /**
     * 获取企业基本信息详细信息
     */
    @ApiOperation(value = "查询企业风险评估-老版")
    @GetMapping(value = "/{factoryId}")
    public AjaxResults<BEnterpriseRiskAssessment> getInfo(@PathVariable("factoryId") String factoryId) {
        return AjaxResults.success(bEnterpriseRiskAssessmentService.getInfo(factoryId));
    }

}
