package com.panzhihua.service_grid.api;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.panzhihua.common.model.dtos.grid.EventAddDTO;
|
import com.panzhihua.common.model.dtos.grid.EventDeleteDTO;
|
import com.panzhihua.common.model.dtos.grid.EventEditDTO;
|
import com.panzhihua.common.model.dtos.grid.PageEventDTO;
|
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 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);
|
};
|
|
}
|