package com.caliverse.admin.domain.api;

import com.caliverse.admin.domain.response.HistoryResponse;
import com.caliverse.admin.domain.service.HistoryService;

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/history")
public class HistoryController {
    private final HistoryService historyService;

    //사용 이력 조회
    @GetMapping("/list")
    public ResponseEntity<HistoryResponse> getHistoryList(
            @RequestParam Map<String, String> requestParams){
        return ResponseEntity.ok().body(historyService.getHistoryList(requestParams));
    }
    //사용이력 상세 조회
    @GetMapping("/detail/{id}")
    public ResponseEntity<HistoryResponse> getHistoryDetail(
            @PathVariable("id") String id){
        return ResponseEntity.ok().body(historyService.getHistoryDetail(id));
    }
}
