Search in sources :

Example 6 with FlashActivityDTO

use of com.actionworks.flashsale.app.model.dto.FlashActivityDTO 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);
}
Also used : FlashActivityDTO(com.actionworks.flashsale.app.model.dto.FlashActivityDTO) FlashActivitiesQuery(com.actionworks.flashsale.app.model.query.FlashActivitiesQuery) GetMapping(org.springframework.web.bind.annotation.GetMapping) SentinelResource(com.alibaba.csp.sentinel.annotation.SentinelResource)

Aggregations

FlashActivityDTO (com.actionworks.flashsale.app.model.dto.FlashActivityDTO)6 SentinelResource (com.alibaba.csp.sentinel.annotation.SentinelResource)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3 FlashActivitiesQuery (com.actionworks.flashsale.app.model.query.FlashActivitiesQuery)2 BizException (com.actionworks.flashsale.app.exception.BizException)1 FlashActivitiesCache (com.actionworks.flashsale.app.service.activity.cache.model.FlashActivitiesCache)1 FlashActivityCache (com.actionworks.flashsale.app.service.activity.cache.model.FlashActivityCache)1 FlashActivity (com.actionworks.flashsale.domain.model.entity.FlashActivity)1