|
@@ -0,0 +1,93 @@
|
|
|
|
+package com.sooka.sponest.mobile.comprehensive.eventController;
|
|
|
|
+
|
|
|
|
+import com.ruoyi.common.core.constant.HttpStatus;
|
|
|
|
+import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
+import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensiveEvent.domain.ZhsqEvent;
|
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensiveEvent.service.RemoteEventService;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/AppComprehensiveEvent")
|
|
|
|
+public class EventController {
|
|
|
|
+ @Resource
|
|
|
|
+ private RemoteEventService eventService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询事件列表接口(分页)
|
|
|
|
+ * @param pageNum
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/event/getList")
|
|
|
|
+ public AjaxResult getEventList(@RequestParam("pageNum") String pageNum, @RequestParam("pageSize") String pageSize) {
|
|
|
|
+ TableDataInfo eventList = eventService.getEventList(pageNum, pageSize);
|
|
|
|
+ if (HttpStatus.SUCCESS == eventList.getCode()) {
|
|
|
|
+ return AjaxResult.success(eventList.getRows());
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.error(eventList.getCode(), eventList.getMsg());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询事件详情接口
|
|
|
|
+ * @param eventId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/event/edit")
|
|
|
|
+ public AjaxResult getEdit(@RequestParam("eventId") String eventId){
|
|
|
|
+ return eventService.getEdit(eventId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增事件接口
|
|
|
|
+ * @param event
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/event/addComprehensiveEvent")
|
|
|
|
+ public AjaxResult add(@RequestBody ZhsqEvent event) {
|
|
|
|
+ return eventService.add(event);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改事件接口
|
|
|
|
+ * @param zhsqEvent
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/event/put")
|
|
|
|
+ public AjaxResult put(@RequestBody ZhsqEvent zhsqEvent){
|
|
|
|
+ return eventService.put(zhsqEvent);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 事件删除接口
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/event/del")
|
|
|
|
+ public AjaxResult del(@RequestParam("id") List<String> id){
|
|
|
|
+ return eventService.del(id.toArray(new String[0]));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上报事件
|
|
|
|
+ * @param eventId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/event/report/eventId")
|
|
|
|
+ public AjaxResult reportEventId(@RequestParam("eventId") String eventId){
|
|
|
|
+ return eventService.reportEventId(eventId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取事件日志
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/event/eventLog")
|
|
|
|
+ public AjaxResult getEventLog(@RequestParam("eventId") String eventId){
|
|
|
|
+ return eventService.getEventLog(eventId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|