From fece6af66e0cfaf95896227a791810c79bafd2e8 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期二, 08 八月 2023 10:09:18 +0800
Subject: [PATCH] 后台代码--远程用户

---
 cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 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 16f1915..d6606e0 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 {
@@ -200,7 +208,7 @@
             @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"),
             @ApiImplicitParam(value = "页码", name = "pageNum", required = true, dataType = "int"),
             @ApiImplicitParam(value = "每页数量", name = "pageSize", required = true, dataType = "int"),
-            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = false, dataType = "int"),
     })
     public ResultUtil<List<RechargesDetail>> wpGoldRechargeRecord(String yearMonth, Integer recordId,Integer pageNum,Integer pageSize){
         try {

--
Gitblit v1.7.1