package com.gkhy.safePlatform.doublePrevention.controller; import com.gkhy.safePlatform.commons.co.ContextCacheUser; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.doublePrevention.entity.PreventRiskMap; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapDeleteReqDTO; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapQueryReqDTO; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapSaveReqDTO; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapUpdateReqDTO; import com.gkhy.safePlatform.doublePrevention.service.RiskService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.security.Principal; @RestController @RequestMapping("prevent/map") public class PreventProduceMapController { @Autowired private RiskService riskService; /** * 风险分布图-分页查询详细信息 */ @PostMapping("/select/getRiskMapPage") public ResultVO getMapPage(@RequestBody PreventRiskMapQueryReqDTO riskMapQueryReqDTO) { return riskService.getMapPage(riskMapQueryReqDTO); } /** * 风险分布图-新增 */ @PostMapping("/insert/saveRiskMap") public ResultVO saveRiskMap(Authentication authentication, PreventRiskMapSaveReqDTO riskMapSaveReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.saveRiskMap(currentUser.getUid(), riskMapSaveReqDTO); } /** * 风险分布图-删除 */ @PostMapping("/delete/deleteRiskMap") public ResultVO deleteRiskMap(Authentication authentication, @RequestBody PreventRiskMapDeleteReqDTO riskMapDeleteReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.deleteRiskMap(currentUser.getUid(), riskMapDeleteReqDTO); } /** * 风险分布图-修改 */ @PostMapping("/update/updateRiskMap") public ResultVO updateRiskMap(Authentication authentication, @RequestBody PreventRiskMapUpdateReqDTO riskMapUpdateReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.updateRiskMap(currentUser.getUid(), riskMapUpdateReqDTO); } /** * 风险分布图-图 */ @PostMapping("/select/getMapImage") public ResultVO getMapImage(@RequestBody Long id) { return riskService.getMapImage(id); } }