Search in sources :

Example 11 with SentinelResource

use of com.alibaba.csp.sentinel.annotation.SentinelResource 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

SentinelResource (com.alibaba.csp.sentinel.annotation.SentinelResource)11 GetMapping (org.springframework.web.bind.annotation.GetMapping)5 FlashActivityDTO (com.actionworks.flashsale.app.model.dto.FlashActivityDTO)3 Method (java.lang.reflect.Method)3 FlashItemDTO (com.actionworks.flashsale.app.model.dto.FlashItemDTO)2 FlashActivitiesQuery (com.actionworks.flashsale.app.model.query.FlashActivitiesQuery)2 FlashItemsQuery (com.actionworks.flashsale.app.model.query.FlashItemsQuery)2 Entry (com.alibaba.csp.sentinel.Entry)2 EntryType (com.alibaba.csp.sentinel.EntryType)2 BlockException (com.alibaba.csp.sentinel.slots.block.BlockException)2 FlashPlaceOrderCommand (com.actionworks.flashsale.app.model.command.FlashPlaceOrderCommand)1 PlaceOrderResult (com.actionworks.flashsale.app.model.result.PlaceOrderResult)1 Person (com.xiaolyuh.entity.Person)1 ProceedingJoinPoint (org.aspectj.lang.ProceedingJoinPoint)1 Around (org.aspectj.lang.annotation.Around)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1