Search in sources :

Example 6 with FlashItemDTO

use of com.actionworks.flashsale.app.model.dto.FlashItemDTO in project flash-sale by ThoughtsBeta.

the class FlashItemAppBuilder method toFlashItemDTO.

public static FlashItemDTO toFlashItemDTO(FlashItem flashItem) {
    FlashItemDTO flashItemDto = new FlashItemDTO();
    BeanUtils.copyProperties(flashItem, flashItemDto);
    return flashItemDto;
}
Also used : FlashItemDTO(com.actionworks.flashsale.app.model.dto.FlashItemDTO)

Example 7 with FlashItemDTO

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

Aggregations

FlashItemDTO (com.actionworks.flashsale.app.model.dto.FlashItemDTO)7 BizException (com.actionworks.flashsale.app.exception.BizException)2 FlashItemsQuery (com.actionworks.flashsale.app.model.query.FlashItemsQuery)2 SentinelResource (com.alibaba.csp.sentinel.annotation.SentinelResource)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 PlaceOrderTask (com.actionworks.flashsale.app.model.PlaceOrderTask)1 OrderTaskSubmitResult (com.actionworks.flashsale.app.model.result.OrderTaskSubmitResult)1 FlashItemCache (com.actionworks.flashsale.app.service.item.cache.model.FlashItemCache)1 FlashItemsCache (com.actionworks.flashsale.app.service.item.cache.model.FlashItemsCache)1 OrderNoGenerateContext (com.actionworks.flashsale.app.util.OrderNoGenerateContext)1 StockDeduction (com.actionworks.flashsale.domain.model.StockDeduction)1 FlashItem (com.actionworks.flashsale.domain.model.entity.FlashItem)1 FlashOrder (com.actionworks.flashsale.domain.model.entity.FlashOrder)1