| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.dao.business.model.PlatformEvent; |
| | | import com.doumee.service.business.PlatformEventService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/08/28 17:24 |
| | | */ |
| | | @Api(tags = "æå°è½¦è¾è¿åºäºä»¶æ¨éè®°å½è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/platformEvent") |
| | | public class PlatformEventController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PlatformEventService platformEventService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:platformevent:create") |
| | | public ApiResponse create(@RequestBody PlatformEvent platformEvent) { |
| | | return ApiResponse.success(platformEventService.create(platformEvent)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:platformevent:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | platformEventService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:platformevent:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | platformEventService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:platformevent:update") |
| | | public ApiResponse updateById(@RequestBody PlatformEvent platformEvent) { |
| | | platformEventService.updateById(platformEvent); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:platformevent:query") |
| | | public ApiResponse<PageData<PlatformEvent>> findPage (@RequestBody PageWrap<PlatformEvent> pageWrap) { |
| | | return ApiResponse.success(platformEventService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:platformevent:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<PlatformEvent> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(PlatformEvent.class).export(platformEventService.findPage(pageWrap).getRecords(), "æå°è½¦è¾è¿åºäºä»¶æ¨éè®°å½è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:platformevent:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(platformEventService.findById(id)); |
| | | } |
| | | } |