use of com.actionworks.flashsale.app.model.query.FlashActivitiesQuery in project flash-sale by ThoughtsBeta.
the class FlashActivityController method getOnlineFlashActivities.
@GetMapping(value = "/flash-activities/online")
@SentinelResource("GetOnlineActivitiesResource")
public MultiResponse<FlashActivityResponse> getOnlineFlashActivities(@RequestAttribute Long userId, @RequestParam Integer pageSize, @RequestParam Integer pageNumber, @RequestParam(required = false) String keyword) {
FlashActivitiesQuery flashActivitiesQuery = new FlashActivitiesQuery().setKeyword(keyword).setPageSize(pageSize).setPageNumber(pageNumber).setStatus(FlashActivityStatus.ONLINE.getCode());
AppMultiResult<FlashActivityDTO> flashActivitiesResult = flashActivityAppService.getFlashActivities(userId, flashActivitiesQuery);
if (!flashActivitiesResult.isSuccess() || flashActivitiesResult.getData() == null) {
return ResponseBuilder.withMulti(flashActivitiesResult);
}
return MultiResponse.of(toFlashActivitiesResponse(flashActivitiesResult.getData()), flashActivitiesResult.getTotal());
}
use of com.actionworks.flashsale.app.model.query.FlashActivitiesQuery in project flash-sale by ThoughtsBeta.
the class FlashActivityController method getFlashActivities.
@GetMapping(value = "/flash-activities")
@SentinelResource("GetActivitiesResource")
public MultiResponse<FlashActivityResponse> getFlashActivities(@RequestAttribute Long userId, @RequestParam Integer pageSize, @RequestParam Integer pageNumber, @RequestParam(required = false) String keyword) {
FlashActivitiesQuery flashActivitiesQuery = new FlashActivitiesQuery().setKeyword(keyword).setPageSize(pageSize).setPageNumber(pageNumber);
AppMultiResult<FlashActivityDTO> flashActivitiesResult = flashActivityAppService.getFlashActivities(userId, flashActivitiesQuery);
return ResponseBuilder.withMulti(flashActivitiesResult);
}
Aggregations