微信小程序主页完成
This commit is contained in:
@@ -56,4 +56,16 @@ public class ProductInnnerController {
|
||||
public List<SkuInfo> findSkuInfoByKeyword(@PathVariable("keyword") String keyword) {
|
||||
return skuInfoService.findSkuInfoByKeyword(keyword);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取所有分类")
|
||||
@GetMapping("inner/findAllCategoryList")
|
||||
public List<Category> findAllCategoryList() {
|
||||
return categoryService.list();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取新人专享商品")
|
||||
@GetMapping("inner/findNewPersonSkuInfoList")
|
||||
public List<SkuInfo> findNewPersonSkuInfoList() {
|
||||
return skuInfoService.findNewPersonSkuInfoList();
|
||||
}
|
||||
}
|
||||
|
@@ -98,4 +98,11 @@ public interface SkuInfoService extends IService<SkuInfo> {
|
||||
* @return
|
||||
*/
|
||||
List<SkuInfo> findSkuInfoByKeyword(String keyword);
|
||||
|
||||
/**
|
||||
* 获取新人专享商品
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SkuInfo> findNewPersonSkuInfoList();
|
||||
}
|
||||
|
@@ -286,6 +286,25 @@ public class SkuInfoServiceImpl extends ServiceImpl<SkuInfoMapper, SkuInfo> impl
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SkuInfo>().like(SkuInfo::getSkuName, keyword));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新人专享商品
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SkuInfo> findNewPersonSkuInfoList() {
|
||||
//条件1 : is_new_person=1
|
||||
//条件2 : publish_status=1
|
||||
//条件3 :显示其中三个
|
||||
//获取第一页数据,每页显示三条记录
|
||||
Page<SkuInfo> pageParam = new Page<>(1, 3);
|
||||
//调用方法查询
|
||||
IPage<SkuInfo> skuInfoPage = baseMapper.selectPage(pageParam, new LambdaQueryWrapper<SkuInfo>().eq(SkuInfo::getIsNewPerson, 1)
|
||||
.eq(SkuInfo::getPublishStatus, 1)
|
||||
.orderByDesc(SkuInfo::getStock));
|
||||
return skuInfoPage.getRecords();
|
||||
}
|
||||
|
||||
private SkuInfoVo getSkuInfoDB(Long skuId) {
|
||||
SkuInfoVo skuInfoVo = new SkuInfoVo();
|
||||
|
||||
|
Reference in New Issue
Block a user