From ceb1ff4dd962198868e63e659f1d96ea4052be25 Mon Sep 17 00:00:00 2001
From: lisy <linlangsur163@163.com>
Date: 星期一, 07 八月 2023 14:11:54 +0800
Subject: [PATCH] app端:用户头像上传接口字段变更;管理后台优惠券添加的内容

---
 cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
index b97525a..dc16002 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
@@ -9,6 +9,7 @@
 import com.dsh.account.service.UserIntegralChangesService;
 import com.dsh.account.util.ResultUtil;
 import com.dsh.account.util.TokenUtil;
+import com.dsh.account.util.ToolUtil;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -105,15 +106,22 @@
     @ApiOperation(value = "上传用户头像", tags = {"APP-使用福利"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
-            @ApiImplicitParam(name = "file",value = "图片字节",dataType = "MultipartFile")
+            @ApiImplicitParam(name = "userImage",value = "用户头像连接",dataType = "string")
     })
-    public ResultUtil uploadAppUserProfile(MultipartFile file, HttpServletRequest request){
+    public ResultUtil uploadAppUserProfile(String userImage){
         try {
             Integer appUserId = tokenUtil.getUserIdFormRedis();
             if(null == appUserId){
                 return ResultUtil.tokenErr();
             }
-            return ResultUtil.success(tauService.uploadAppUserHeadImg(appUserId,file,request));
+            TAppUser byId = tauService.getById(appUserId);
+            if (ToolUtil.isNotEmpty(userImage)){
+                byId.setHeadImg(userImage);
+                tauService.updateById(byId);
+            }else {
+                ResultUtil.error("头像不能为空!");
+            }
+            return ResultUtil.success();
         }catch (Exception e){
             return ResultUtil.runErr();
         }
@@ -177,7 +185,7 @@
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
             @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"),
-            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = false, dataType = "int"),
     })
     public ResultUtil<List<ConsumeDetail>> getUserBillingDetails(String yearMonth,Integer recordId){
         try {
@@ -217,7 +225,7 @@
 
 
     @ResponseBody
-    @PostMapping("/base/useBenefit/voucherCenter")
+    @PostMapping("/api/useBenefit/voucherCenter")
     @ApiOperation(value = "充值中心", tags = {"APP-使用福利"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
@@ -267,13 +275,9 @@
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
     })
-    public ResultUtil<PointMallDetailsResponse> pointsMallList(MallRequest request){
+    public ResultUtil<List<Goods>> pointsMallList(MallRequest request){
         try {
-            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
-            if(null == userIdFormRedis){
-                return ResultUtil.tokenErr();
-            }
-            return ResultUtil.success(tauService.queryAppUserIntegral(request,userIdFormRedis));
+            return ResultUtil.success(tauService.queryAppUserIntegral(request));
         }catch (Exception e){
             return ResultUtil.runErr();
         }
@@ -387,7 +391,7 @@
             @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"),
             @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"),
     })
-    public ResultUtil<IntegralDetailsResponse> pointDetails(String yearMonth, Integer recordId){
+    public ResultUtil<List<IntegralsData>> pointDetails(String yearMonth, Integer recordId){
         try {
             Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
             if(null == userIdFormRedis){

--
Gitblit v1.7.1