增加接口

This commit is contained in:
shuo.wang
2025-04-11 21:39:19 +08:00
parent 1c419d10ae
commit c56cc12f62
3 changed files with 9 additions and 4 deletions

View File

@@ -12,5 +12,5 @@ import java.util.List;
*/ */
public interface WarehouseInfoService { public interface WarehouseInfoService {
List<WarehouseInfoDO> getAllAndActive(String keyword); List<WarehouseInfoDO> getAllAndActive(String keyword,Integer pageNum,Integer pageSize);
} }

View File

@@ -3,6 +3,8 @@ package com.cool.store.service.impl;
import com.cool.store.entity.WarehouseInfoDO; import com.cool.store.entity.WarehouseInfoDO;
import com.cool.store.mapper.WarehouseInfoMapper; import com.cool.store.mapper.WarehouseInfoMapper;
import com.cool.store.service.WarehouseInfoService; import com.cool.store.service.WarehouseInfoService;
import com.github.pagehelper.PageHelper;
import com.lowagie.text.PageSize;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -21,7 +23,8 @@ public class WarehouseInfoServiceImpl implements WarehouseInfoService {
@Resource @Resource
private WarehouseInfoMapper warehouseInfoMapper; private WarehouseInfoMapper warehouseInfoMapper;
@Override @Override
public List<WarehouseInfoDO> getAllAndActive(String keyword) { public List<WarehouseInfoDO> getAllAndActive(String keyword,Integer pageNum,Integer pageSize) {
PageHelper.startPage(pageNum,pageSize);
return warehouseInfoMapper.getAllAndActive(keyword); return warehouseInfoMapper.getAllAndActive(keyword);
} }
} }

View File

@@ -29,7 +29,9 @@ public class PCWarehouseInfoController {
@GetMapping("/getAllAndActive") @GetMapping("/getAllAndActive")
@ApiOperation(value = "获取正新鸡排仓库配置") @ApiOperation(value = "获取正新鸡排仓库配置")
public ResponseResult<List<WarehouseInfoDO>> getAllAndActive(@RequestParam("keyword")String keyword ) { public ResponseResult<List<WarehouseInfoDO>> getAllAndActive(@RequestParam("keyword")String keyword ,
return ResponseResult.success(warehouseInfoService.getAllAndActive(keyword)); @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum,
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize) {
return ResponseResult.success(warehouseInfoService.getAllAndActive(keyword,pageNum,pageSize));
} }
} }