From 54e537dedfd9795d1a05b07ec67ad11335f8b5e8 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 05 十二月 2024 16:35:11 +0800
Subject: [PATCH] merge

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java           |   29 ++++++++++++++
 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java                     |   10 +++++
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java |    1 
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java             |   19 +++++++--
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java                           |    5 +-
 5 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java
index c2da01a..eaae6be 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java
@@ -23,7 +23,6 @@
 	public AppUserClient create(Throwable cause) {
 		
 		return new AppUserClient() {
-			@PostMapping("/appUser/getAppUserById")
             @Override
 			public AppUser getAppUserById(Long id) {
                 log.error("根据id获取用户失败:{}", cause.getMessage());
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
index 745cad0..2de0d6f 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
@@ -70,4 +70,14 @@
     private LocalDateTime createTime;
 
 
+    @ApiModelProperty(value = "头像")
+    @TableField(exist = false)
+    private String avatar;
+
+
+    @ApiModelProperty(value = "名字")
+    @TableField(exist = false)
+    private String userName;
+
+
 }
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
index e3c1045..6ee0ca6 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -12,12 +12,11 @@
 import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.other.api.domain.Shop;
 import com.ruoyi.other.api.feignClient.StoreClient;
+import io.swagger.annotations.*;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -25,8 +24,6 @@
 import com.ruoyi.account.vo.*;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.page.TableDataInfo;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -178,7 +175,7 @@
 
 
 	@ResponseBody
-	@PostMapping("/recommend")
+	@GetMapping("/recommend")
 	@ApiOperation(value = "推广中心", tags = {"小程序-推广中心"})
 	public R<AppUser> recommend(){
 		Long userId = tokenService.getLoginUserApplet().getUserid();
@@ -221,6 +218,18 @@
 		return R.ok(user);
 	}
 
+	@ResponseBody
+	@GetMapping("/change")
+	@ApiOperation(value = "推广中心", tags = {"小程序-推广中心"})
+	public R<AppUser> change(@ApiParam("换绑用户id") Long userId){
+		Long userId1 = tokenService.getLoginUserApplet().getUserid();
+		//获取绑定门店
+		AppUser user = appUserService.getById(userId1);
+		user.setInviteUserId(userId);
+		appUserService.updateById(user);
+		return R.ok();
+	}
+
 
 
     @GetMapping("/index")
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java
index 6fa0cb8..eae8c99 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java
@@ -3,12 +3,13 @@
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.order.vo.OrderVO;
 import com.ruoyi.order.model.Order;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 /**
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  *
  * @author luodangjia
@@ -18,5 +19,5 @@
     /**
      * 查询用户id
      */
-    List<OrderVO> selectOrderListByUserId(Integer status, Long userId);
+    List<OrderVO> selectOrderListByUserId(@Param("status") Integer status, @Param("userId") Long userId);
 }
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
index 2b55eaf..0f3f1b2 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
@@ -1,8 +1,21 @@
 package com.ruoyi.other.controller;
 
 
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.AppUser;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.other.api.domain.Goods;
+import com.ruoyi.other.api.domain.GoodsEvaluate;
+import com.ruoyi.other.service.GoodsEvaluateService;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * <p>
@@ -15,6 +28,22 @@
 @RestController
 @RequestMapping("/goods-evaluate")
 public class GoodsEvaluateController {
+    @Resource
+    private GoodsEvaluateService goodsEvaluateService;
+    @Resource
+    private AppUserClient appUserClient;
+
+    @GetMapping("/goodsList")
+    @ApiOperation(value = "商品评价", tags = {"小程序-商品评价"})
+    public R<List<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId){
+        List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list();
+        for (GoodsEvaluate goodsEvaluate : list) {
+            AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId());
+            goodsEvaluate.setUserName(appUserById.getName());
+            goodsEvaluate.setAvatar(appUserById.getAvatar());
+        }
+        return R.ok(list);
+    }
 
 }
 

--
Gitblit v1.7.1