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);
|
}
|
|
}
|