From c00d0d3bc399b6648145dfd955cedbea90f5f99d Mon Sep 17 00:00:00 2001 From: jiangqs <343695869@qq.com> Date: 星期日, 18 六月 2023 17:38:22 +0800 Subject: [PATCH] 看板 --- ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtActivityController.java | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtActivityController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtActivityController.java index 62f1070..a4aded3 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtActivityController.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtActivityController.java @@ -1,9 +1,14 @@ package com.ruoyi.goods.controller.management; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.goods.domain.dto.MgtActivityEditDto; +import com.ruoyi.goods.domain.dto.MgtActivityPageDto; +import com.ruoyi.goods.domain.vo.MgtActivityGetVo; +import com.ruoyi.goods.domain.vo.MgtActivityPageVo; import com.ruoyi.goods.service.activity.ActivityService; +import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.RequestBody; @@ -12,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; /** * @ClassName MgtActivityController @@ -36,4 +42,33 @@ activityService.editMgtActivity(mgtActivityEditDto); return R.ok(); } + + @RequestMapping(value = "/pageMgtActivity", method = RequestMethod.POST) + @ApiOperation(value = "分页获取活动列表") + public R<Page<MgtActivityPageVo>> pageMgtActivity(@RequestBody MgtActivityPageDto mgtActivityPageDto) { + Page<MgtActivityPageVo> page = new Page<>(); + page.setSize(mgtActivityPageDto.getPageSize()); + page.setCurrent(mgtActivityPageDto.getPageNum()); + page.setOptimizeCountSql(false); + List<MgtActivityPageVo> mgtActivityPageVoList = activityService.pageMgtActivity(page,mgtActivityPageDto); + return R.ok(page.setRecords(mgtActivityPageVoList)); + } + + @RequestMapping(value = "/getMgtActivity", method = RequestMethod.POST) + @ApiOperation(value = "平台获取活动编辑信息") + public R<MgtActivityGetVo> getMgtActivity(@RequestBody MgtBaseGetDto mgtBaseGetDto) { + Long userId = SecurityUtils.getUserId(); + mgtBaseGetDto.setUserId(userId); + MgtActivityGetVo mgtActivityEditDto = activityService.getMgtActivity(mgtBaseGetDto.getId()); + return R.ok(mgtActivityEditDto); + } + + @RequestMapping(value = "/deleteMgtActivity", method = RequestMethod.POST) + @ApiOperation(value = "平台删除活动") + public R deleteMgtActivity(@RequestBody MgtBaseGetDto mgtBaseGetDto) { + Long userId = SecurityUtils.getUserId(); + mgtBaseGetDto.setUserId(userId); + activityService.deleteMgtActivity(mgtBaseGetDto.getId()); + return R.ok(); + } } -- Gitblit v1.7.1