qcast-api/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemController.java

73 lines
2.5 KiB
Java

package com.interplug.qcast.biz.displayItem;
import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest;
import com.interplug.qcast.biz.displayItem.dto.ItemDetailResponse;
import com.interplug.qcast.biz.displayItem.dto.ItemRequest;
import com.interplug.qcast.biz.displayItem.dto.ItemResponse;
import com.interplug.qcast.config.Exception.QcastException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/api/display-item")
@RequiredArgsConstructor
@Tag(name = "DisplayItemController", description = "전시(표시) 제품 관련 API")
public class DisplayItemController {
private final DisplayItemService displayItemService;
/**
* 전시제품 정보 등록/수정
*
* @param displayItemRequest
* @throws QcastException
*/
@Operation(description = "전시제품 정보를 등록/수정한다. (동기화)")
@PostMapping("/display-item-save")
@ResponseStatus(HttpStatus.OK)
public void setStoreDisplayItemSave(@RequestBody DisplayItemRequest displayItemRequest)
throws QcastException {
displayItemService.setStoreDisplayItemSave(displayItemRequest);
}
/**
* 제품 목록 조회
*
* @param itemRequest
* @return
* @throws QcastException
*/
@Operation(description = "제품 목록을 조회한다.")
@PostMapping("/item-list")
@ResponseStatus(HttpStatus.OK)
public List<ItemResponse> getItemList(@RequestBody ItemRequest itemRequest)
throws QcastException {
return displayItemService.getItemList(itemRequest);
}
/**
* 제품 상세 정보 조회
*
* @param itemId
* @return
* @throws QcastException
*/
@Operation(description = "제품 상세 정보를 조회한다.")
@GetMapping("/item-detail")
@ResponseStatus(HttpStatus.OK)
public ItemDetailResponse getItemDetail(@RequestParam String itemId) throws QcastException {
return displayItemService.getItemDetail(itemId);
}
}