Commit 92d322a5 by sdif

用户端代码提交

parent e5230c34
package com.pz.applet; package com.pz.applet;
import com.pz.applet.util.CityIdUtils;
import com.pz.common.core.controller.BaseController; import com.pz.common.core.controller.BaseController;
import com.pz.common.core.domain.PageQuery; import com.pz.common.core.domain.PageQuery;
import com.pz.common.core.domain.R; import com.pz.common.core.domain.R;
...@@ -35,7 +36,7 @@ public class AppletCarouselController extends BaseController { ...@@ -35,7 +36,7 @@ public class AppletCarouselController extends BaseController {
*/ */
@GetMapping("/home") @GetMapping("/home")
public R<HomeVo> getHome(HttpServletRequest reques) { public R<HomeVo> getHome(HttpServletRequest reques) {
return R.ok(iCarouselService.selectHome(Integer.parseInt(reques.getHeader("city_id")))); return R.ok(iCarouselService.selectHome(CityIdUtils.setCityIdPasInteger(reques)));
} }
/** /**
* 查询轮播图列表 * 查询轮播图列表
......
...@@ -54,7 +54,8 @@ public class AppletStoreGoodsController extends BaseController { ...@@ -54,7 +54,8 @@ public class AppletStoreGoodsController extends BaseController {
* 搜索商品 * 搜索商品
*/ */
@GetMapping("/searchShop") @GetMapping("/searchShop")
public TableDataInfo<StoreGoodsVo> searchShop(StoreGoodsBo bo, PageQuery pageQuery) { public TableDataInfo<StoreGoodsVo> searchShop(StoreGoodsBo bo, PageQuery pageQuery, HttpServletRequest reques) {
bo.setCityId(CityIdUtils.setCityIdPasLong(reques));
return iStoreGoodsService.searchAppShop(bo, pageQuery); return iStoreGoodsService.searchAppShop(bo, pageQuery);
} }
...@@ -62,8 +63,8 @@ public class AppletStoreGoodsController extends BaseController { ...@@ -62,8 +63,8 @@ public class AppletStoreGoodsController extends BaseController {
* 商城商品分类列表 * 商城商品分类列表
*/ */
@GetMapping("/shopGoodsClassify") @GetMapping("/shopGoodsClassify")
public R<List<StoreApplyVo>> shopGoodsClassify() { public R<List<StoreApplyVo>> shopGoodsClassify(HttpServletRequest reques) {
return R.ok(iStoreGoodsService.shopGoodsClassify()); return R.ok(iStoreGoodsService.shopGoodsClassify(CityIdUtils.setCityIdPasInteger(reques)));
} }
/** /**
......
...@@ -3,6 +3,9 @@ package com.pz.system.mapper; ...@@ -3,6 +3,9 @@ package com.pz.system.mapper;
import com.pz.system.domain.ArticleComment; import com.pz.system.domain.ArticleComment;
import com.pz.system.domain.vo.ArticleCommentVo; import com.pz.system.domain.vo.ArticleCommentVo;
import com.pz.common.core.mapper.BaseMapperPlus; import com.pz.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 文章评论Mapper接口 * 文章评论Mapper接口
...@@ -11,5 +14,5 @@ import com.pz.common.core.mapper.BaseMapperPlus; ...@@ -11,5 +14,5 @@ import com.pz.common.core.mapper.BaseMapperPlus;
* @date 2023-09-07 * @date 2023-09-07
*/ */
public interface ArticleCommentMapper extends BaseMapperPlus<ArticleCommentMapper, ArticleComment, ArticleCommentVo> { public interface ArticleCommentMapper extends BaseMapperPlus<ArticleCommentMapper, ArticleComment, ArticleCommentVo> {
List<ArticleCommentVo> selectByArticleComment(@Param("aid") Integer aid, @Param("uid") Integer uid);
} }
...@@ -45,7 +45,7 @@ public interface IStoreGoodsService { ...@@ -45,7 +45,7 @@ public interface IStoreGoodsService {
/** /**
*查询商品分类 *查询商品分类
*/ */
List<StoreApplyVo> shopGoodsClassify(); List<StoreApplyVo> shopGoodsClassify(int cityId);
/** /**
* 查询商品列表 * 查询商品列表
......
...@@ -80,11 +80,10 @@ public class ArticleServiceImpl implements IArticleService { ...@@ -80,11 +80,10 @@ public class ArticleServiceImpl implements IArticleService {
articleVo.setCollectNum(Math.toIntExact(collectCount)); articleVo.setCollectNum(Math.toIntExact(collectCount));
// 查询用户评论 // 查询用户评论
List<ArticleCommentVo> articleCommentVos = articleCommentMapper.selectVoList(Wrappers.<ArticleComment>lambdaQuery() List<ArticleCommentVo> articleCommentVos = articleCommentMapper.selectByArticleComment(id,loginUser.getUserId().intValue());
.eq(ArticleComment::getAid, id).eq(ArticleComment::getUid, loginUser.getUserId()));
// 查询用户信息并设置到评论中 // 查询用户信息并设置到评论中
if (articleCommentVos != null && !articleCommentVos.isEmpty()) { /*if (articleCommentVos != null && !articleCommentVos.isEmpty()) {
Set<Long> userIds = new HashSet<>(); Set<Long> userIds = new HashSet<>();
for (ArticleCommentVo articleCommentVo : articleCommentVos) { for (ArticleCommentVo articleCommentVo : articleCommentVos) {
Long uid = articleCommentVo.getUid(); Long uid = articleCommentVo.getUid();
...@@ -112,7 +111,7 @@ public class ArticleServiceImpl implements IArticleService { ...@@ -112,7 +111,7 @@ public class ArticleServiceImpl implements IArticleService {
} }
} }
} }
*/
articleVo.setComment(articleCommentVos); articleVo.setComment(articleCommentVos);
return articleVo; return articleVo;
} }
......
...@@ -144,11 +144,12 @@ public class StoreGoodsServiceImpl implements IStoreGoodsService { ...@@ -144,11 +144,12 @@ public class StoreGoodsServiceImpl implements IStoreGoodsService {
} }
@Override @Override
public List<StoreApplyVo> shopGoodsClassify() { public List<StoreApplyVo> shopGoodsClassify(int cityId) {
//查询所有商户分类 //查询所有商户分类
List<StoreApplyVo> storeApplies = storeApplyMapper.selectVoList( List<StoreApplyVo> storeApplies = storeApplyMapper.selectVoList(
new LambdaQueryWrapper<StoreApply>().eq(StoreApply::getStatus, 1) new LambdaQueryWrapper<StoreApply>().eq(StoreApply::getStatus, 1)
.eq(StoreApply::getCityId,cityId)
); );
//查询商户下面的商品 //查询商户下面的商品
for (StoreApplyVo storeApply : storeApplies) { for (StoreApplyVo storeApply : storeApplies) {
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pz.system.mapper.ArticleCommentMapper" >
<select id="selectByArticleComment" resultType="com.pz.system.domain.vo.ArticleCommentVo">
SELECT a.*,s.avatar,s.user_name FROM article_comment a left join sys_user s on s.user_id = a.uid
WHERE a.aid = #{aid} and a.uid = #{uid}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment