CeDo
2021-05-27 bb1b8101a3b31a03cae378bfcb16f4576f154647
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package com.panzhihua.service_grid.api;
 
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.EventDetailsVO;
import com.panzhihua.common.model.vos.grid.EventVO;
import com.panzhihua.service_grid.model.dos.EventResourceDO;
import com.panzhihua.service_grid.service.EventResourceService;
import com.panzhihua.service_grid.service.EventService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 *
 * @author cedoo email:cedoo(a)qq.com
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
@Slf4j
@RestController
@RequestMapping("/event")
public class EventApi{
 
    @Resource
    private EventService eventService;
 
    /**
     * 新增事件
     * @param eventAddDTO
     * @return 新增结果
     */
    @PostMapping("/add")
    R add(@RequestBody EventAddDTO eventAddDTO){
        return eventService.add(eventAddDTO);
    };
 
    /**
     * 修改事件
     * @param eventEditDTO
     * @return 维护结果
     */
    @PostMapping("/edit")
    R edit(@RequestBody EventEditDTO eventEditDTO){
        return eventService.edit(eventEditDTO);
    };
 
    /**
     * 分页查找事件
     * @param pageEventDTO
     * @return 维护结果
     */
    @PostMapping("/page")
    R<IPage<EventVO>> query(@RequestBody PageEventDTO pageEventDTO){
        return eventService.query(pageEventDTO);
    };
 
    /**
     * 删除事件
     * @param EventDeleteDTO
     * @return 平台用户信息
     */
    @PostMapping("/delete")
    R delete(@RequestBody EventDeleteDTO EventDeleteDTO){
        return eventService.delete(EventDeleteDTO);
    };
 
    /**
     * 查询事件详细信息
     * @param id 事件 id
     * @return 查找结果
     */
    @PostMapping("/{id}")
    R<EventDetailsVO> eventDetails(@PathVariable("id") Long id){
        return eventService.eventDetails(id);
    };
 
    /**
     * 添加突发事件
     * @param emergenciesEventAddDTO
     * @return 新增结果
     */
    @PostMapping("/addEmergencies")
    R addEmergencies(@RequestBody EmergenciesEventAddDTO emergenciesEventAddDTO){
        return eventService.addEmergencies(emergenciesEventAddDTO);
    };
    /**
     * 保存草稿
     * @param {classNameFirstLower}AddDTO 添加事件传递对象
     * @return 新增结果
     */
    @PostMapping("/saveEmergenciesDraft")
    R saveEmergenciesDraft(@RequestBody EmergenciesEventEditDTO emergenciesEventEditDTO){
        return eventService.saveEmergenciesDraft(emergenciesEventEditDTO);
    }
 
 
    /**
     * 突发事件上报社区
     * @param emergenciesEventReportDTO
     * @return
     */
    @PostMapping("/emergenciesReport")
    R emergenciesReport(@RequestBody EmergenciesEventReportDTO emergenciesEventReportDTO){
        return eventService.emergenciesReport(emergenciesEventReportDTO);
    }
 
 
    /**
     * 突发事件撤销
     * @param eventRevokeDTO
     * @return
     */
    @PostMapping("/emergenciesRevoke")
    R emergenciesRevoke(@RequestBody EventRevokeDTO eventRevokeDTO){
        return eventService.emergenciesRevoke(eventRevokeDTO);
    }
    /**
     * 处理事件
     * @param eventDealDTO
     * @return
     */
    @PostMapping("/dealEvent")
    R dealEvent(@RequestBody EventDealDTO eventDealDTO){
        return eventService.dealEvent(eventDealDTO);
    }
 
    /**
     * 处理事件
     * @param eventVerifyDTO
     * @return
     */
    @PostMapping("/verify")
    R verifyEvent(@RequestBody EventVerifyDTO eventVerifyDTO){
        return eventService.verifyEvent(eventVerifyDTO);
    }
 
    /**
     * 重新发布事件
     * @param eventRepublicDTO
     * @return
     */
    @PostMapping("/republish")
    R republishEvent(@RequestBody EventRepublicDTO eventRepublicDTO){
        return eventService.republishEvent(eventRepublicDTO);
    }
 
}