From fd8325df6c30bdafeca467c80d602ca6403bec86 Mon Sep 17 00:00:00 2001 From: phpcjl <phpcjl@gmail.com> Date: 星期二, 17 十二月 2024 09:35:31 +0800 Subject: [PATCH] 1 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java index 5b5b1f6..ac21ecd 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java @@ -4,6 +4,7 @@ import com.ruoyi.account.api.model.AppUser; import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.RedPackegeSet; +import com.ruoyi.other.dto.RedPackegeSetDto; import com.ruoyi.other.service.RedPackegeSetService; import io.swagger.annotations.ApiOperation; import org.springframework.transaction.annotation.Transactional; @@ -47,8 +48,11 @@ */ @ApiOperation(value = "获取红包配置", tags = {"管理后台-活动管理-签到红包"}) @GetMapping("/getRedPackegeSet") - public R<RedPackegeSet> getRedPackegeSet(){ - return R.ok(redPackegeSetService.getOne(null)); + public R<RedPackegeSetDto> getRedPackegeSet(){ + List<RedPackegeSet> redPackegeSetList = redPackegeSetService.list(); + RedPackegeSetDto redPackegeSetDto = new RedPackegeSetDto(); + redPackegeSetDto.setRedPackegeSets(redPackegeSetList); + return R.ok(redPackegeSetDto); } @@ -58,8 +62,9 @@ @ApiOperation(value = "添加红包配置", tags = {"管理后台-活动管理-签到红包"}) @PostMapping("/addRedPackegeSet") @Transactional(rollbackFor = Exception.class) - public R<Void> addRedPackegeSet(@RequestBody List<RedPackegeSet> redPackegeSets){ - for (RedPackegeSet redPackegeSet : redPackegeSets) { + public R<Void> addRedPackegeSet(@RequestBody RedPackegeSetDto redPackegeSets){ + List<RedPackegeSet> redPackegeSetList = redPackegeSets.getRedPackegeSets(); + for (RedPackegeSet redPackegeSet : redPackegeSetList) { RedPackegeSet one = redPackegeSetService.getOne(null); if (one==null){ redPackegeSet.setId(1); -- Gitblit v1.7.1