use of com.actionworks.flashsale.app.model.query.FlashItemsQuery in project flash-sale by ThoughtsBeta.
the class FlashItemController method getOnlineFlashItems.
@GetMapping(value = "/activities/{activityId}/flash-items/online")
@SentinelResource("GetOnlineFlashItems")
public MultiResponse<FlashItemResponse> getOnlineFlashItems(@RequestAttribute Long userId, @PathVariable Long activityId, @RequestParam Integer pageSize, @RequestParam Integer pageNumber, @RequestParam(required = false) String keyword) {
FlashItemsQuery flashItemsQuery = new FlashItemsQuery().setKeyword(keyword).setPageSize(pageSize).setPageNumber(pageNumber).setStatus(FlashItemStatus.ONLINE.getCode());
AppMultiResult<FlashItemDTO> flashItemsResult = flashItemAppService.getFlashItems(userId, activityId, flashItemsQuery);
if (!flashItemsResult.isSuccess() || flashItemsResult.getData() == null) {
return ResponseBuilder.withMulti(flashItemsResult);
}
return MultiResponse.of(toFlashItemsResponse(flashItemsResult.getData()), flashItemsResult.getTotal());
}
use of com.actionworks.flashsale.app.model.query.FlashItemsQuery in project flash-sale by ThoughtsBeta.
the class FlashItemController method getFlashItems.
@GetMapping(value = "/activities/{activityId}/flash-items")
@SentinelResource("GetFlashItems")
public MultiResponse<FlashItemDTO> getFlashItems(@RequestAttribute Long userId, @PathVariable Long activityId, @RequestParam Integer pageSize, @RequestParam Integer pageNumber, @RequestParam(required = false) String keyword) {
FlashItemsQuery flashItemsQuery = new FlashItemsQuery().setKeyword(keyword).setPageSize(pageSize).setPageNumber(pageNumber);
AppMultiResult<FlashItemDTO> flashItemsResult = flashItemAppService.getFlashItems(userId, activityId, flashItemsQuery);
return ResponseBuilder.withMulti(flashItemsResult);
}
Aggregations