小程序主页接口

This commit is contained in:
张松
2025-03-07 14:35:44 +08:00
parent 4fb4863cb1
commit 8e601b65dd
6 changed files with 11 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ public class HomeController {
* @return 商品列表
*/
@GetMapping("/product")
public CzgResult<Page<RecommendProVO>> home(String lng, String lat, String address, Integer categoryId, Integer orderType, Integer distanceType) {
return CzgResult.success(homePageService.getProd(lng, lat, address, categoryId, orderType, distanceType));
public CzgResult<Page<RecommendProVO>> home(String lng, String lat, String address, Integer categoryId, Integer orderType, Integer distanceType, String name) {
return CzgResult.success(homePageService.getProd(lng, lat, address, categoryId, orderType, distanceType, name));
}
}

View File

@@ -42,7 +42,7 @@ public class PrinterEditDTO {
/**
* 打印机品牌
*/
@Size(min = 1, message = "打印机品牌不为空")
// @Size(min = 1, message = "打印机品牌不为空")
private String contentType;

View File

@@ -10,6 +10,6 @@ import com.mybatisflex.core.paginate.Page;
public interface HomePageService {
HomePageVO getHomeInfo();
Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType);
Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType, String name);
}

View File

@@ -41,5 +41,5 @@ public interface ProductMapper extends BaseMapper<Product> {
List<RecommendProVO> selectRecommendProductList(@Param("lng") String lng, @Param("lat") String lat, @Param("address") String address,
@Param("classify") Integer classify, @Param("orderType") Integer orderType,
@Param("distanceType") Integer distanceType);
@Param("distanceType") Integer distanceType, @Param("name") String name);
}

View File

@@ -106,8 +106,8 @@ public class HomePageServiceImpl implements HomePageService {
}
@Override
public Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType) {
public Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType, String name) {
PageHelper.startPage(PageUtil.buildPageHelp());
return PageUtil.convert(new PageInfo<>(productMapper.selectRecommendProductList(lng, lat, address, classify, orderType, distanceType)));
return PageUtil.convert(new PageInfo<>(productMapper.selectRecommendProductList(lng, lat, address, classify, orderType, distanceType, name)));
}
}

View File

@@ -173,6 +173,10 @@
<if test="address != null and address != ''">
and (b.cities like concat('%', #{address}, '%') or b.districts like concat('%', #{address}, '%'))
</if>
<if test="name != null and name != ''">
and a.name like concat('%', #{name}, '%')
</if>
<if test="classify != null">
and c.category_id = #{classify}
</if>