puzhibing
2024-12-05 54e537dedfd9795d1a05b07ec67ad11335f8b5e8
merge
5个文件已修改
62 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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());
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;
}
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")
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/mapper/OrderMapper.java
@@ -3,6 +3,7 @@
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;
@@ -18,5 +19,5 @@
    /**
     * 查询用户id
     */
    List<OrderVO> selectOrderListByUserId(Integer status, Long userId);
    List<OrderVO> selectOrderListByUserId(@Param("status") Integer status, @Param("userId") Long userId);
}
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);
    }
}