Ver código fonte

优化代码返回命名

chendt 3 anos atrás
pai
commit
aabf533b3c

+ 2 - 2
yami-shop-admin/src/main/java/com/yami/shop/admin/controller/IndexImgController.java

@@ -48,11 +48,11 @@ public class IndexImgController {
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('admin:indexImg:page')")
     public ResponseEntity<IPage<IndexImg>> page(IndexImg indexImg, PageParam<IndexImg> page) {
-        IPage<IndexImg> indexImgIPage = indexImgService.page(page,
+        IPage<IndexImg> indexImgPage = indexImgService.page(page,
                 new LambdaQueryWrapper<IndexImg>()
                         .eq(indexImg.getStatus() != null, IndexImg::getStatus, indexImg.getStatus())
                         .orderByDesc(IndexImg::getSeq));
-        return ResponseEntity.ok(indexImgIPage);
+        return ResponseEntity.ok(indexImgPage);
     }
 
     /**

+ 11 - 8
yami-shop-api/src/main/java/com/yami/shop/api/controller/ProdController.java

@@ -36,6 +36,9 @@ import org.springframework.web.bind.annotation.RestController;
 import java.util.List;
 import java.util.stream.Collectors;
 
+/**
+ * @author lgh on 2018/11/26.
+ */
 @RestController
 @RequestMapping("/prod")
 @Api(tags = "商品接口")
@@ -61,8 +64,8 @@ public class ProdController {
     })
     public ResponseEntity<IPage<ProductDto>> prodList(
             @RequestParam(value = "categoryId") Long categoryId,PageParam<ProductDto> page) {
-        IPage<ProductDto> productDtoIPage = prodService.pageByCategoryId(page, categoryId);
-        return ResponseEntity.ok(productDtoIPage);
+        IPage<ProductDto> productPage = prodService.pageByCategoryId(page, categoryId);
+        return ResponseEntity.ok(productPage);
     }
 
     @GetMapping("/prodInfo")
@@ -98,8 +101,8 @@ public class ProdController {
     @ApiImplicitParams({
     })
     public ResponseEntity<IPage<ProductDto>> lastedProdPage(PageParam<ProductDto> page) {
-        IPage<ProductDto> productDtoIPage = prodService.pageByPutawayTime(page);
-        return ResponseEntity.ok(productDtoIPage);
+        IPage<ProductDto> productPage = prodService.pageByPutawayTime(page);
+        return ResponseEntity.ok(productPage);
     }
 
     @GetMapping("/prodListByTagId")
@@ -109,16 +112,16 @@ public class ProdController {
     })
     public ResponseEntity<IPage<ProductDto>> prodListByTagId(
             @RequestParam(value = "tagId") Long tagId,PageParam<ProductDto> page) {
-        IPage<ProductDto> productDtoIPage = prodService.pageByTagId(page, tagId);
-        return ResponseEntity.ok(productDtoIPage);
+        IPage<ProductDto> productPage = prodService.pageByTagId(page, tagId);
+        return ResponseEntity.ok(productPage);
     }
 
     @GetMapping("/moreBuyProdList")
     @ApiOperation(value = "每日疯抢", notes = "获取销量最多的商品列表")
     @ApiImplicitParams({})
     public ResponseEntity<IPage<ProductDto>> moreBuyProdList(PageParam<ProductDto> page) {
-        IPage<ProductDto> productDtoIPage = prodService.moreBuyProdList(page);
-        return ResponseEntity.ok(productDtoIPage);
+        IPage<ProductDto> productPage = prodService.moreBuyProdList(page);
+        return ResponseEntity.ok(productPage);
     }
 
     @GetMapping("/tagProdList")