From 833893d56463f64332d5f5a3abcf774e8ad3f9c5 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期二, 19 七月 2022 17:31:33 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into genchuang
---
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyPlanController.java | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyPlanController.java b/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyPlanController.java
index 9643425..287a79e 100644
--- a/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyPlanController.java
+++ b/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyPlanController.java
@@ -1,14 +1,19 @@
package com.gkhy.safePlatform.emergency.controller;
+import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
+import com.gkhy.safePlatform.emergency.model.dto.req.EmergencyPlanReqDTO;
+import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyPlanDetailRespDTO;
import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyPlanPageRespDTO;
import com.gkhy.safePlatform.emergency.query.EmergencyPlanQuery;
import com.gkhy.safePlatform.emergency.service.EmergencyPlanService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
+import java.security.Principal;
import java.util.List;
@RestController
@@ -27,4 +32,37 @@
return emergencyPlanService.selectEmergencyPlanList(pageQuery);
}
+ /**
+ * 应急预案新增
+ */
+ @RequestMapping(value = "/add",method = RequestMethod.POST)
+ public ResultVO addEmergencyPlan(Authentication authentication, @RequestBody EmergencyPlanReqDTO emergencyPlanReqDTO) {
+ ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
+ return emergencyPlanService.addEmergencyPlan(currentUser.getUid(), emergencyPlanReqDTO);
+ }
+
+ /**
+ * 应急预案详情
+ */
+ @RequestMapping(value = "/info/{id}",method = RequestMethod.GET)
+ public ResultVO<EmergencyPlanDetailRespDTO> getEmergencyPlanById(@PathVariable("id")Long id){
+ return emergencyPlanService.getEmergencyPlanById(id);
+ }
+
+ /**
+ * 应急预案修改
+ */
+ @RequestMapping(value = "/update",method = RequestMethod.POST)
+ public ResultVO updateEmergencyPlan(Authentication authentication, @RequestBody EmergencyPlanReqDTO emergencyPlanReqDTO) {
+ ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
+ return emergencyPlanService.updateEmergencyPlan(currentUser.getUid(), emergencyPlanReqDTO);
+ }
+
+ /**
+ * 应急预案删除/批量删除
+ */
+ @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET)
+ public ResultVO batchDeleteEmergencyPlan(@PathVariable("ids")String ids){
+ return emergencyPlanService.batchDeleteEmergencyPlan(ids);
+ }
}
--
Gitblit v1.9.2