package com.caliverse.admin.domain.api;

import com.caliverse.admin.domain.request.BlackListRequest;
import com.caliverse.admin.domain.request.ItemsRequest;
import com.caliverse.admin.domain.response.BlackListResponse;
import com.caliverse.admin.domain.response.ItemDeleteResponse;
import com.caliverse.admin.domain.response.ItemsResponse;
import com.caliverse.admin.domain.service.ItemsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Tag(name = "아이템조회", description = "아이템조회 api")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/items")
public class ItemsController {
    private final ItemsService itemsService;

    @GetMapping("/list")
    public ResponseEntity<ItemsResponse> findItems(
            @RequestParam Map<String, String> requestParams){
        return ResponseEntity.ok().body( itemsService.findItems(requestParams));
    }

    @PostMapping("/delete")
    public ResponseEntity<ItemDeleteResponse> postItemDelete(
            @RequestBody ItemsRequest ItemDeleteRequest){
        return ResponseEntity.ok().body( itemsService.postItemDelete(ItemDeleteRequest));
    }


}
