微信小程序分类查询(优惠券错误)完成
This commit is contained in:
		@@ -0,0 +1,37 @@
 | 
			
		||||
package com.atguigu.ssyx.activity.api;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.activity.service.ActivityInfoService;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
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 javax.annotation.Resource;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: ActivityInfoController
 | 
			
		||||
 * Package: com.atguigu.ssyx.activity.api
 | 
			
		||||
 *
 | 
			
		||||
 * @author yovinchen
 | 
			
		||||
 * @Create 2023/9/26 14:12
 | 
			
		||||
 */
 | 
			
		||||
@Api(tags = "促销与优惠券接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/api/activity")
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class ActivityApiController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ActivityInfoService activityInfoService;
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "根据skuId列表获取促销信息")
 | 
			
		||||
    @PostMapping("inner/findActivity")
 | 
			
		||||
    public Map<Long, List<String>> findActivity(@RequestBody List<Long> skuIdList) {
 | 
			
		||||
        return activityInfoService.findActivity(skuIdList);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -19,7 +19,19 @@ import java.util.List;
 | 
			
		||||
@Repository
 | 
			
		||||
public interface ActivityInfoMapper extends BaseMapper<ActivityInfo> {
 | 
			
		||||
 | 
			
		||||
    List<ActivityRule> selectActivityRuleList(Long skuId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询两张表判断 activity_info 和 activity_sku,编写SQL语句实现
 | 
			
		||||
     *
 | 
			
		||||
     * @param skuIdList
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<Long> selectSkuIdListExist(@Param("skuIdList") List<Long> skuIdList);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据skuId进行查询,查询sku对应活动里面规则列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param skuId
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<ActivityRule> findActivityRule(Long skuId);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,6 @@ package com.atguigu.ssyx.activity.service;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.model.activity.ActivityInfo;
 | 
			
		||||
import com.atguigu.ssyx.model.activity.ActivityRule;
 | 
			
		||||
import com.atguigu.ssyx.model.product.SkuInfo;
 | 
			
		||||
import com.atguigu.ssyx.vo.activity.ActivityRuleVo;
 | 
			
		||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
			
		||||
@@ -55,10 +54,10 @@ public interface ActivityInfoService extends IService<ActivityInfo> {
 | 
			
		||||
    List<SkuInfo> findSkuInfoByKeyword(String keyword);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据skuId获取促销规则信息
 | 
			
		||||
     * 根据skuId列表获取促销信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param skuId
 | 
			
		||||
     * @param skuIdList
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<ActivityRule> findActivityRule(Long skuId);
 | 
			
		||||
    Map<Long, List<String>> findActivity(List<Long> skuIdList);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -172,23 +172,6 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
 | 
			
		||||
        return findSkuList;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询商品获取规则数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param skuId
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<ActivityRule> findActivityRule(Long skuId) {
 | 
			
		||||
        List<ActivityRule> activityRuleList = activityInfoMapper.selectActivityRuleList(skuId);
 | 
			
		||||
        if (!CollectionUtils.isEmpty(activityRuleList)) {
 | 
			
		||||
            for (ActivityRule activityRule : activityRuleList) {
 | 
			
		||||
                activityRule.setRuleDesc(this.getRuleDesc(activityRule));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return activityRuleList;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private String getRuleDesc(ActivityRule activityRule) {
 | 
			
		||||
        ActivityType activityType = activityRule.getActivityType();
 | 
			
		||||
        StringBuffer ruleDesc = new StringBuffer();
 | 
			
		||||
@@ -207,4 +190,32 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
 | 
			
		||||
        }
 | 
			
		||||
        return ruleDesc.toString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据skuId列表获取促销信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param skuIdList
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Map<Long, List<String>> findActivity(List<Long> skuIdList) {
 | 
			
		||||
        Map<Long, List<String>> result = new HashMap<>();
 | 
			
		||||
        //skuIdList遍历,得到每个skuId
 | 
			
		||||
        skuIdList.forEach(skuId -> {
 | 
			
		||||
            //根据skuId进行查询,查询sku对应活动里面规则列表
 | 
			
		||||
            List<ActivityRule> activityRuleList = baseMapper.findActivityRule(skuId);
 | 
			
		||||
            //数据封装,规则名称
 | 
			
		||||
            if (!CollectionUtils.isEmpty(activityRuleList)) {
 | 
			
		||||
                List<String> ruleList = new ArrayList<>();
 | 
			
		||||
                //把规则名称处理
 | 
			
		||||
                for (ActivityRule activityRule : activityRuleList) {
 | 
			
		||||
                    ruleList.add(this.getRuleDesc(activityRule));
 | 
			
		||||
                }
 | 
			
		||||
                result.put(skuId, ruleList);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -58,13 +58,13 @@
 | 
			
		||||
 | 
			
		||||
    <!--//根据skuId进行查询,查询sku对应活动里面规则列表-->
 | 
			
		||||
    <select id="findActivityRule" resultMap="ActivityRuleMap">
 | 
			
		||||
        select info.activity_type as activityType,
 | 
			
		||||
               rule.id,
 | 
			
		||||
               rule.activity_id,
 | 
			
		||||
               rule.condition_amount,
 | 
			
		||||
               rule.condition_num,
 | 
			
		||||
               rule.benefit_amount,
 | 
			
		||||
               rule.benefit_discount
 | 
			
		||||
        select DISTINCT rule.id,
 | 
			
		||||
                        info.activity_type as activityType,
 | 
			
		||||
                        rule.activity_id,
 | 
			
		||||
                        rule.condition_amount,
 | 
			
		||||
                        rule.condition_num,
 | 
			
		||||
                        rule.benefit_amount,
 | 
			
		||||
                        rule.benefit_discount
 | 
			
		||||
        from activity_info info
 | 
			
		||||
                 inner join activity_sku sku on info.id = sku.activity_id
 | 
			
		||||
                 inner join activity_rule rule on info.id = rule.activity_id
 | 
			
		||||
@@ -89,6 +89,4 @@
 | 
			
		||||
        </where>
 | 
			
		||||
        and now() between info.start_time and info.end_time
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="selectActivityRuleList" resultType="com.atguigu.ssyx.model.activity.ActivityRule"></select>
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,6 @@
 | 
			
		||||
package com.atguigu.ssyx.home.controller;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.client.product.ProductFeignClient;
 | 
			
		||||
import com.atguigu.ssyx.common.auth.AuthContextHolder;
 | 
			
		||||
import com.atguigu.ssyx.common.result.Result;
 | 
			
		||||
import com.atguigu.ssyx.home.service.HomeService;
 | 
			
		||||
@@ -10,6 +11,7 @@ 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 javax.servlet.http.HttpServletRequest;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
@@ -26,7 +28,8 @@ import java.util.Map;
 | 
			
		||||
@RequestMapping("api/home")
 | 
			
		||||
public class HomeApiController {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ProductFeignClient productFeignClient;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private HomeService homeService;
 | 
			
		||||
 | 
			
		||||
@@ -39,4 +42,13 @@ public class HomeApiController {
 | 
			
		||||
        return Result.ok(map);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "获取分类信息")
 | 
			
		||||
    @GetMapping("category")
 | 
			
		||||
    public Result category() {
 | 
			
		||||
        return Result.ok(productFeignClient.findAllCategoryList());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,12 @@
 | 
			
		||||
            <version>1.0-SNAPSHOT</version>
 | 
			
		||||
            <scope>compile</scope>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.atguigu</groupId>
 | 
			
		||||
            <artifactId>service-activity-client</artifactId>
 | 
			
		||||
            <version>1.0-SNAPSHOT</version>
 | 
			
		||||
            <scope>compile</scope>
 | 
			
		||||
        </dependency>
 | 
			
		||||
    </dependencies>
 | 
			
		||||
    <properties>
 | 
			
		||||
        <maven.compiler.source>8</maven.compiler.source>
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,11 @@
 | 
			
		||||
package com.atguigu.ssyx.search.api;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: SearchApiController
 | 
			
		||||
 * Package: com.atguigu.ssyx.search.api
 | 
			
		||||
 *
 | 
			
		||||
 * @author yovinchen
 | 
			
		||||
 * @Create 2023/9/26 14:21
 | 
			
		||||
 */
 | 
			
		||||
public class SearchApiController {
 | 
			
		||||
}
 | 
			
		||||
@@ -3,8 +3,13 @@ package com.atguigu.ssyx.search.controller;
 | 
			
		||||
import com.atguigu.ssyx.common.result.Result;
 | 
			
		||||
import com.atguigu.ssyx.model.search.SkuEs;
 | 
			
		||||
import com.atguigu.ssyx.search.service.SkuService;
 | 
			
		||||
import com.atguigu.ssyx.vo.search.SkuEsQueryVo;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import io.swagger.annotations.ApiParam;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
import org.springframework.data.domain.PageRequest;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.PathVariable;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
@@ -45,4 +50,16 @@ public class SkuApiController {
 | 
			
		||||
    public List<SkuEs> findHotSkuList() {
 | 
			
		||||
        return skuService.findHotSkuList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "搜索分类商品")
 | 
			
		||||
    @GetMapping("{page}/{limit}")
 | 
			
		||||
    public Result list(
 | 
			
		||||
            @ApiParam(name = "page", value = "当前页码", required = true) @PathVariable Integer page,
 | 
			
		||||
            @ApiParam(name = "limit", value = "每页记录数", required = true) @PathVariable Integer limit,
 | 
			
		||||
            @ApiParam(name = "searchParamVo", value = "查询对象", required = false) SkuEsQueryVo searchParamVo) {
 | 
			
		||||
 | 
			
		||||
        Pageable pageable = PageRequest.of(page - 1, limit);
 | 
			
		||||
        Page<SkuEs> pageModel = skuService.search(pageable, searchParamVo);
 | 
			
		||||
        return Result.ok(pageModel);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,9 +6,6 @@ import org.springframework.data.domain.Page;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
 | 
			
		||||
 | 
			
		||||
import java.net.ContentHandler;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: SkuRepository
 | 
			
		||||
 * Package: com.atguigu.ssyx.search.repository
 | 
			
		||||
@@ -20,4 +17,23 @@ public interface SkuRepository extends ElasticsearchRepository<SkuEs, Long> {
 | 
			
		||||
    //获取爆款商品
 | 
			
		||||
    Page<SkuEs> findByOrderByHotScoreDesc(Pageable pageable);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据仓库id + 分类id查询
 | 
			
		||||
     *
 | 
			
		||||
     * @param categoryId
 | 
			
		||||
     * @param wareId
 | 
			
		||||
     * @param pageable
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Page<SkuEs> findByCategoryIdAndWareId(Long categoryId, Long wareId, Pageable pageable);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 仓库id + keyword进行查询
 | 
			
		||||
     *
 | 
			
		||||
     * @param keyword
 | 
			
		||||
     * @param wareId
 | 
			
		||||
     * @param pageable
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Page<SkuEs> findByKeywordAndWareId(String keyword, Long wareId, Pageable pageable);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,9 @@
 | 
			
		||||
package com.atguigu.ssyx.search.service;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.model.search.SkuEs;
 | 
			
		||||
import com.atguigu.ssyx.vo.search.SkuEsQueryVo;
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -36,4 +39,13 @@ public interface SkuService {
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    List<SkuEs> findHotSkuList();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 搜索分类商品
 | 
			
		||||
     *
 | 
			
		||||
     * @param pageable
 | 
			
		||||
     * @param searchParamVo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Page<SkuEs> search(Pageable pageable, SkuEsQueryVo searchParamVo);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,29 @@
 | 
			
		||||
package com.atguigu.ssyx.search.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.fastjson.JSON;
 | 
			
		||||
import com.atguigu.ssyx.client.activity.ActivityFeignClient;
 | 
			
		||||
import com.atguigu.ssyx.client.product.ProductFeignClient;
 | 
			
		||||
import com.atguigu.ssyx.common.auth.AuthContextHolder;
 | 
			
		||||
import com.atguigu.ssyx.enums.SkuType;
 | 
			
		||||
import com.atguigu.ssyx.model.product.Category;
 | 
			
		||||
import com.atguigu.ssyx.model.product.SkuInfo;
 | 
			
		||||
import com.atguigu.ssyx.model.search.SkuEs;
 | 
			
		||||
import com.atguigu.ssyx.search.repository.SkuRepository;
 | 
			
		||||
import com.atguigu.ssyx.search.service.SkuService;
 | 
			
		||||
import com.atguigu.ssyx.vo.search.SkuEsQueryVo;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
import org.springframework.data.domain.PageRequest;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.util.CollectionUtils;
 | 
			
		||||
import org.springframework.util.StringUtils;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: SkuServiceImpl
 | 
			
		||||
@@ -31,6 +38,8 @@ public class SkuServiceImpl implements SkuService {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ProductFeignClient productFeignClient;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ActivityFeignClient activityFeignClient;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SkuRepository skuRepository;
 | 
			
		||||
@@ -95,4 +104,55 @@ public class SkuServiceImpl implements SkuService {
 | 
			
		||||
        List<SkuEs> skuEsList = page.getContent();
 | 
			
		||||
        return skuEsList;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 搜索分类商品
 | 
			
		||||
     *
 | 
			
		||||
     * @param pageable
 | 
			
		||||
     * @param skuEsQueryVo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Page<SkuEs> search(Pageable pageable, SkuEsQueryVo skuEsQueryVo) {
 | 
			
		||||
        //1 向SkuEsQueryVo设置wareId,当前登录用户的仓库id
 | 
			
		||||
        skuEsQueryVo.setWareId(AuthContextHolder.getWareId());
 | 
			
		||||
 | 
			
		||||
        Page<SkuEs> pageModel = null;
 | 
			
		||||
        //2 调用SkuRepository方法,根据springData命名规则定义方法,进行条件查询
 | 
			
		||||
        //// 判断keyword是否为空,如果为空 ,根据仓库id + 分类id查询
 | 
			
		||||
        String keyword = skuEsQueryVo.getKeyword();
 | 
			
		||||
        if (StringUtils.isEmpty(keyword)) {
 | 
			
		||||
            pageModel = skuRepository.findByCategoryIdAndWareId(skuEsQueryVo.getCategoryId(), skuEsQueryVo.getWareId(), pageable);
 | 
			
		||||
        } else {
 | 
			
		||||
            ///如果keyword不为空根据仓库id + keyword进行查询
 | 
			
		||||
            pageModel = skuRepository.findByKeywordAndWareId(skuEsQueryVo.getKeyword(), skuEsQueryVo.getWareId(), pageable);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //3 查询商品参加优惠活动
 | 
			
		||||
        List<SkuEs> skuEsList = pageModel.getContent();
 | 
			
		||||
 | 
			
		||||
        if (!CollectionUtils.isEmpty(skuEsList)) {
 | 
			
		||||
            //遍历skuEsList,得到所有skuId
 | 
			
		||||
            List<Long> skuIdList = skuEsList.stream()
 | 
			
		||||
                                            .map(SkuEs::getId)
 | 
			
		||||
                                            .collect(Collectors.toList());
 | 
			
		||||
            //根据skuId列表远程调用,调用service-activity里面的接口得到数据
 | 
			
		||||
            //返回Map<Long,List<String>>
 | 
			
		||||
            //// map集合key就是skuId值,Long类型
 | 
			
		||||
            //// map集合value是List集合,sku参与活动里面多个规则名称列表
 | 
			
		||||
            ///// 一个商品参加一个活动,一个活动里面可以有多个规则
 | 
			
		||||
            ////// 比如有活动:中秋节满减活动
 | 
			
		||||
            ////// 一个活动可以有多个规则:
 | 
			
		||||
            ////// 中秋节满减活动有两个规则:满20元减1元,满58元减5元
 | 
			
		||||
            Map<Long, List<String>> skuIdToRuleListMap = activityFeignClient.findActivity(skuIdList);//远程调用
 | 
			
		||||
            //封装获取数据到skuEs里面 ruleList属性里面
 | 
			
		||||
            if (skuIdToRuleListMap != null) {
 | 
			
		||||
                skuEsList.forEach(skuEs -> {
 | 
			
		||||
                    skuEs.setRuleList(skuIdToRuleListMap.get(skuEs.getId()));
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return pageModel;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ spring:
 | 
			
		||||
        acknowledge-mode: manual   #消费端手动确认
 | 
			
		||||
 | 
			
		||||
  redis:
 | 
			
		||||
    host: localhost
 | 
			
		||||
    host: 82.157.68.223
 | 
			
		||||
    port: 6379
 | 
			
		||||
    database: 0
 | 
			
		||||
    timeout: 1800000
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ public class LeaderAddressController {
 | 
			
		||||
 | 
			
		||||
    @ApiOperation("提货点地址信息")
 | 
			
		||||
    @GetMapping("inner/getUserAddressByUserId/{userId}")
 | 
			
		||||
    public LeaderAddressVo getUserAddressByUserId(@PathVariable(value = "userId") Long userId) {
 | 
			
		||||
    public LeaderAddressVo getUserAddressByUserId(@PathVariable("userId") Long userId) {
 | 
			
		||||
        return userService.getLeaderAddressByUserId(userId);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 * @Create 2023/9/22 16:23
 | 
			
		||||
 */
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/api/user/weixin")
 | 
			
		||||
@RequestMapping("api/user/weixin")
 | 
			
		||||
public class WeixinApiController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
@@ -27,12 +27,12 @@ public class WeixinApiController {
 | 
			
		||||
 | 
			
		||||
    //用户微信授权登录
 | 
			
		||||
    @ApiOperation(value = "微信登录获取openid(小程序)")
 | 
			
		||||
    @GetMapping("/wxLogin/{code}")
 | 
			
		||||
    @GetMapping("wxLogin/{code}")
 | 
			
		||||
    public Result loginWx(@PathVariable String code) {
 | 
			
		||||
        return Result.ok(loginWxService.loginWx(code));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/auth/updateUser")
 | 
			
		||||
    @PostMapping("auth/updateUser")
 | 
			
		||||
    @ApiOperation(value = "更新用户昵称与头像")
 | 
			
		||||
    public Result updateUser(@RequestBody User user) {
 | 
			
		||||
        userService.updateUser(user);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user