优化代码返回命名

This commit is contained in:
chendt 2022-07-04 09:41:09 +08:00
parent 888d41e8e3
commit aabf533b3c
2 changed files with 13 additions and 10 deletions

View File

@ -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);
}
/**

View File

@ -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")