优化代码返回命名

master
chendt 4 years ago
parent 888d41e8e3
commit aabf533b3c

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

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

Loading…
Cancel
Save