package com.caliverse.admin.domain.api;

import java.util.Map;

import org.springframework.http.ResponseEntity;
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.RestController;

import com.caliverse.admin.domain.request.UserReportRequest;
import com.caliverse.admin.domain.response.UserReportResponse;
import com.caliverse.admin.domain.service.UserReportService;

import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;

@Tag(name = "신고내역", description = "신고내역 api")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/report")
public class UserReportController {
    private final UserReportService userReportService;

    @GetMapping("/list")
    public ResponseEntity<UserReportResponse> list(
            @RequestParam Map<String, String> requestParams){
        return ResponseEntity.ok().body( userReportService.list(requestParams));
    }
    @GetMapping("/total")
    public ResponseEntity<UserReportResponse> total(
            @RequestParam Map<String, String> requestParams){
        return ResponseEntity.ok().body( userReportService.totalCnt(requestParams));
    }
    @GetMapping("/report-detail")
    public ResponseEntity<UserReportResponse> reportDetail(
            @RequestParam Map<String, String> requestParams){
        return ResponseEntity.ok().body( userReportService.reportDetail(requestParams));
    }
    @GetMapping("/reply-detail")
    public ResponseEntity<UserReportResponse> replyDetail(
            @RequestParam Map<String, String> requestParams){
        return ResponseEntity.ok().body( userReportService.replyDetail(requestParams));
    }
    @PostMapping("/reply")
    public ResponseEntity<UserReportResponse> reply(
            @RequestBody UserReportRequest userReportRequest){
        return ResponseEntity.ok().body( userReportService.reportReply(userReportRequest));
    }
    @PostMapping("/dummy")
    public void dummy(
            @RequestBody Map<String, String> map){
        userReportService.dummy(map);
    }
}
