Commit 98e6d99f by tyfanchz

Add APIs for querying all records.

1 parent 55a3ab0f
......@@ -36,7 +36,20 @@ public class ProductController {
private ProductFeignClient productFeignClient;
/**
* 获取产品列表。
* 分页获取产品列表。
*
* @param req 请求体
* @return 结果
*/
@RequestMapping(value = "/getPageList", method = {RequestMethod.GET, RequestMethod.POST})
public R getPageList(ProductReq req) {
log.info("$$$$ /product/getPageList param: {}", JSON.toJSONString(req));
PageInfo<ProductResp> pageInfo = productFeignClient.getPageList(req);
return R.ok().putPageData(pageInfo);
}
/**
* 获取产品列表,不分页。
*
* @param req 请求体
* @return 结果
......@@ -44,8 +57,8 @@ public class ProductController {
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public R getList(ProductReq req) {
log.info("$$$$ /product/getList param: {}", JSON.toJSONString(req));
PageInfo<ProductResp> pageInfo = productFeignClient.getList(req);
return R.ok().putPageData(pageInfo);
List<ProductResp> respList = productFeignClient.getList(req);
return R.ok().data(respList);
}
/**
......
......@@ -32,7 +32,20 @@ public class ProductTypeController {
private ProductTypeFeignClient productTypeFeignClient;
/**
* 获取产品类型列表。
* 分页获取产品类型列表。
*
* @param req 请求
* @return 结果
*/
@RequestMapping(value = "/getPageList", method = {RequestMethod.GET, RequestMethod.POST})
public R getPageList(ProductTypeReq req) {
log.info("$$$$ /productType/getPageList param: {}", JSON.toJSONString(req));
PageInfo<ProductTypeResp> pageInfo = productTypeFeignClient.getPageList(req);
return R.ok().putPageData(pageInfo);
}
/**
* 获取产品类型列表,不分页。
*
* @param req 请求
* @return 结果
......@@ -40,8 +53,8 @@ public class ProductTypeController {
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public R getList(ProductTypeReq req) {
log.info("$$$$ /productType/getList param: {}", JSON.toJSONString(req));
PageInfo<ProductTypeResp> pageInfo = productTypeFeignClient.getList(req);
return R.ok().putPageData(pageInfo);
List<ProductTypeResp> respList = productTypeFeignClient.getList(req);
return R.ok().data(respList);
}
/**
......
......@@ -21,9 +21,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
@FeignClient(name = "${feign.server.name}",url = "${feign.server.url}")
public interface ProductFeignClient {
@RequestMapping(value = "/product/getPageList", method = {RequestMethod.GET})
@ResponseBody
PageInfo<ProductResp> getPageList(@SpringQueryMap ProductReq req);
@RequestMapping(value = "/product/getList", method = {RequestMethod.GET})
@ResponseBody
PageInfo<ProductResp> getList(@SpringQueryMap ProductReq req);
List<ProductResp> getList(@SpringQueryMap ProductReq req);
@RequestMapping(value = "/product/getById", method = {RequestMethod.GET})
@ResponseBody
......
......@@ -20,9 +20,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
@FeignClient(name = "${feign.server.name}",url = "${feign.server.url}")
public interface ProductTypeFeignClient {
@RequestMapping(value = "/productType/getPageList", method = {RequestMethod.GET})
@ResponseBody
PageInfo<ProductTypeResp> getPageList(@SpringQueryMap ProductTypeReq req);
@RequestMapping(value = "/productType/getList", method = {RequestMethod.GET})
@ResponseBody
PageInfo<ProductTypeResp> getList(@SpringQueryMap ProductTypeReq req);
List<ProductTypeResp> getList(@SpringQueryMap ProductTypeReq req);
@RequestMapping(value = "/productType/getById", method = {RequestMethod.GET})
@ResponseBody
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!