From cb49d77f0b0a1a066790c65088864200f10e9462 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期五, 28 七月 2023 19:55:39 +0800
Subject: [PATCH] bug

---
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/miniapp/AppMemberController.java |   42 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/miniapp/AppMemberController.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/miniapp/AppMemberController.java
index 2dc3419..63a63ab 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/miniapp/AppMemberController.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/miniapp/AppMemberController.java
@@ -5,16 +5,17 @@
 import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.member.domain.dto.AppMemberBrowseDto;
 import com.ruoyi.member.domain.vo.AppBirthdayCardVo;
+import com.ruoyi.member.domain.vo.AppMemberPrizePageVo;
 import com.ruoyi.member.domain.vo.AppSuggestPageVo;
 import com.ruoyi.member.domain.vo.AppUserInfoVo;
 import com.ruoyi.member.service.birthday.BirthdayCardService;
+import com.ruoyi.member.service.member.BrowseRecordService;
 import com.ruoyi.member.service.member.MemberService;
 import com.ruoyi.member.service.member.MemberSuggestService;
 import com.ruoyi.system.api.constant.AppErrorConstant;
-import com.ruoyi.system.api.domain.dto.AppEditUserDto;
-import com.ruoyi.system.api.domain.dto.AppSuggestPageDto;
-import com.ruoyi.system.api.domain.dto.AppUserSuggestDto;
+import com.ruoyi.system.api.domain.dto.*;
 import com.ruoyi.system.api.domain.poji.member.Member;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -34,7 +35,7 @@
  * @date 2023年04月19日
  * @version: 1.0
  */
-@Api(value = "小程序配置相关接口", tags = "小程序配置相关接口", description = "小程序配置相关接口")
+@Api(value = "小程序会员相关接口", tags = "小程序会员相关接口", description = "小程序会员相关接口")
 @RestController
 @RequestMapping("/app/member")
 public class AppMemberController {
@@ -47,6 +48,9 @@
 
     @Resource
     private BirthdayCardService birthdayCardService;
+
+    @Resource
+    private BrowseRecordService browseRecordService;
 
 
     @RequestMapping(value = "/getAppUserInfo", method = RequestMethod.POST)
@@ -84,6 +88,14 @@
         Long userId = SecurityUtils.getUserId();
         appUserSuggestDto.setUserId(userId);
         memberSuggestService.userSuggest(appUserSuggestDto);
+        IntegralChangeDto integralChangeDto = new IntegralChangeDto();
+        if(appUserSuggestDto.getSuggestType()==1){
+            integralChangeDto.setIntegralType(2);
+        }else{
+            integralChangeDto.setIntegralType(3);
+        }
+        integralChangeDto.setUserId(userId);
+        memberService.changeIntegral(integralChangeDto);
         return R.ok();
     }
 
@@ -137,4 +149,26 @@
         }
         return R.ok(appBirthdayCardVo);
     }
+
+    @RequestMapping(value = "/pageAppMemberPrize", method = RequestMethod.POST)
+    @ApiOperation(value = "分页获取用户奖品列表")
+    public R<Page<AppMemberPrizePageVo>> pageAppMemberPrize(@RequestBody AppPageDto appPageDto) {
+        Long userId = SecurityUtils.getUserId();
+        appPageDto.setUserId(userId);
+        Page<AppMemberPrizePageVo> page = new Page<>();
+        page.setSize(appPageDto.getPageSize());
+        page.setCurrent(appPageDto.getPageNum());
+        List<AppMemberPrizePageVo> memberPrizePageVoList = birthdayCardService.pageAppMemberPrize(page,userId);
+        return R.ok(page.setRecords(memberPrizePageVoList));
+    }
+
+
+    @RequestMapping(value = "/browseRecord", method = RequestMethod.POST)
+    @ApiOperation(value = "浏览记录")
+    public R browseRecord(@RequestBody AppMemberBrowseDto appMemberBrowseDto) {
+        Long userId = SecurityUtils.getUserId();
+        appMemberBrowseDto.setUserId(userId);
+        browseRecordService.browseRecord(appMemberBrowseDto);
+        return R.ok();
+    }
 }

--
Gitblit v1.7.1