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.service.EventService;
|
import lombok.extern.slf4j.Slf4j;
|
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 CommonEventDeleteDTO
|
* @return 平台用户信息
|
*/
|
@PostMapping("/delete")
|
R delete(@RequestBody CommonEventDeleteDTO CommonEventDeleteDTO){
|
return eventService.delete(CommonEventDeleteDTO);
|
};
|
|
/**
|
* 查询事件详细信息
|
* @param id 事件 id
|
* @return 查找结果
|
*/
|
@PostMapping("/{id}")
|
R<EventDetailsVO> eventDetails(@PathVariable("id") Long id){
|
return eventService.eventDetails(id);
|
};
|
|
/**
|
* 添加突发事件
|
* @param commonEventAddDTO
|
* @return 新增结果
|
*/
|
@PostMapping("/addCommon")
|
R addCommon(@RequestBody CommonEventAddDTO commonEventAddDTO){
|
return eventService.addCommon(commonEventAddDTO);
|
};
|
/**
|
* 保存草稿
|
* @param {classNameFirstLower}AddDTO 添加事件传递对象
|
* @return 新增结果
|
*/
|
@PostMapping("/saveDraft")
|
R saveDraft(@RequestBody CommonEventEditDTO commonEventEditDTO){
|
return eventService.saveDraft(commonEventEditDTO);
|
}
|
|
|
/**
|
* 突发事件上报社区
|
* @param commonEventReportDTO
|
* @return
|
*/
|
@PostMapping("/report")
|
R report(@RequestBody CommonEventReportDTO commonEventReportDTO){
|
return eventService.report(commonEventReportDTO);
|
}
|
|
|
/**
|
* 突发事件撤销
|
* @param eventRevokeDTO
|
* @return
|
*/
|
@PostMapping("/emergenciesRevoke")
|
R emergenciesRevoke(@RequestBody EventRevokeDTO eventRevokeDTO){
|
return eventService.emergenciesRevoke(eventRevokeDTO);
|
}
|
/**
|
* 处理事件
|
* @param commonEventDealDTO
|
* @return
|
*/
|
@PostMapping("/dealEvent")
|
R dealEvent(@RequestBody CommonEventDealDTO commonEventDealDTO){
|
return eventService.dealEvent(commonEventDealDTO);
|
}
|
|
/**
|
* 处理事件
|
* @param commonEventVerifyDTO
|
* @return
|
*/
|
@PostMapping("/verify")
|
R verifyEvent(@RequestBody CommonEventVerifyDTO commonEventVerifyDTO){
|
return eventService.verifyEvent(commonEventVerifyDTO);
|
}
|
|
/**
|
* 重新发布事件
|
* @param commonEventRepublicDTO
|
* @return
|
*/
|
@PostMapping("/republish")
|
R republishEvent(@RequestBody CommonEventRepublicDTO commonEventRepublicDTO){
|
return eventService.republishEvent(commonEventRepublicDTO);
|
}
|
|
/**
|
* 草稿发布
|
* @param commonEventPublicDTO
|
* @return
|
*/
|
@PostMapping("/event/draftRelease")
|
R draftRelease(@RequestBody CommonEventPublicDTO commonEventPublicDTO){
|
return eventService.draftRelease(commonEventPublicDTO);
|
}
|
}
|