双重预防项目-国泰新华二开定制版
huangzhen
2022-10-13 81a6a662b5db806e0824f311a89993d853db9371
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.ruoyi.doublePrevention.controller;
 
 
import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO;
import com.ruoyi.doublePrevention.enums.ResultCodes;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.doublePrevention.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
@RestController
@RequestMapping("/riskUnit")
public class PreventRiskUnitController {
 
    @Autowired
    private RiskService riskService;
 
    /**
     * 获取所有的风险分析单元的编码和姓名
     */
    @PostMapping("/select/listRiskUnitCodeAndName")
    public ResultVO<List<PreventRiskUnitCodeAndNameListQueryRespDTO>> listRiskUnitCodeAndName() {
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(ResultCodes.OK.getCode());
        List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName();
        resultVO.setData(respDTOS);
        return resultVO;
    }
}