|
| 1 | +package in.koreatech.koin.admin.callvan.controller; |
| 2 | + |
| 3 | +import static in.koreatech.koin.domain.user.model.UserType.ADMIN; |
| 4 | +import static in.koreatech.koin.global.code.ApiResponseCode.*; |
| 5 | +import static io.swagger.v3.oas.annotations.enums.ParameterIn.PATH; |
| 6 | + |
| 7 | +import org.springframework.http.ResponseEntity; |
| 8 | +import org.springframework.web.bind.annotation.GetMapping; |
| 9 | +import org.springframework.web.bind.annotation.PathVariable; |
| 10 | +import org.springframework.web.bind.annotation.PostMapping; |
| 11 | +import org.springframework.web.bind.annotation.RequestBody; |
| 12 | +import org.springframework.web.bind.annotation.RequestMapping; |
| 13 | +import org.springframework.web.bind.annotation.RequestParam; |
| 14 | + |
| 15 | +import in.koreatech.koin.admin.callvan.dto.AdminCallvanReportProcessRequest; |
| 16 | +import in.koreatech.koin.admin.callvan.dto.AdminCallvanReportsResponse; |
| 17 | +import in.koreatech.koin.global.auth.Auth; |
| 18 | +import in.koreatech.koin.global.code.ApiResponseCodes; |
| 19 | +import io.swagger.v3.oas.annotations.Operation; |
| 20 | +import io.swagger.v3.oas.annotations.Parameter; |
| 21 | +import io.swagger.v3.oas.annotations.tags.Tag; |
| 22 | +import jakarta.validation.Valid; |
| 23 | + |
| 24 | +@Tag(name = "(Admin) Callvan: 신고 처리", description = "어드민 콜벤 사용자 신고 내역 관리") |
| 25 | +@RequestMapping("/admin/callvan/reports") |
| 26 | +public interface AdminCallvanReportApi { |
| 27 | + |
| 28 | + @ApiResponseCodes({ |
| 29 | + OK, |
| 30 | + UNAUTHORIZED_USER, |
| 31 | + FORBIDDEN_ADMIN |
| 32 | + }) |
| 33 | + @Operation(summary = "콜벤 신고 목록 조회", description = """ |
| 34 | + 콜벤 사용자 신고 접수 목록을 조회합니다. |
| 35 | + - `only_pending=true` 이면 미처리 신고(PENDING)만 조회합니다. |
| 36 | + - 각 항목에는 피신고자 정보, 신고 사유, 첨부 이미지, 처리 유형, 누적 신고 이력이 포함됩니다. |
| 37 | + """) |
| 38 | + @GetMapping |
| 39 | + ResponseEntity<AdminCallvanReportsResponse> getCallvanReports( |
| 40 | + @RequestParam(name = "only_pending", required = false, defaultValue = "false") Boolean onlyPending, |
| 41 | + @RequestParam(name = "page", required = false) Integer page, |
| 42 | + @RequestParam(name = "limit", required = false) Integer limit, |
| 43 | + @Auth(permit = {ADMIN}) Integer adminId); |
| 44 | + |
| 45 | + @ApiResponseCodes({ |
| 46 | + OK, |
| 47 | + UNAUTHORIZED_USER, |
| 48 | + FORBIDDEN_ADMIN, |
| 49 | + INVALID_REQUEST_BODY, |
| 50 | + NOT_FOUND_CALLVAN_REPORT, |
| 51 | + CALLVAN_REPORT_ALREADY_PROCESSED |
| 52 | + }) |
| 53 | + @Operation(summary = "콜벤 신고 처리", description = """ |
| 54 | + 콜벤 신고를 처리합니다. |
| 55 | + - `WARNING`: 신고 확정 후 주의 안내 알림을 발송합니다. |
| 56 | + - `TEMPORARY_RESTRICTION_14_DAYS`: 신고 확정 후 14일간 새 모집/참여를 제한하며, 제재 알림을 발송합니다. |
| 57 | + - `PERMANENT_RESTRICTION`: 신고 확정 후 콜벤 기능을 영구 제한하며, 제재 알림을 발송합니다. |
| 58 | + - `REJECT`: 신고를 반려하고 상태를 REJECTED로 변경합니다. 알림은 발송되지 않습니다. |
| 59 | + |
| 60 | + #### 제재 유형별 알림 메시지 |
| 61 | + | 처리 유형 | 알림 타입 | 메시지 | |
| 62 | + | :--- | :--- | :--- | |
| 63 | + | `WARNING` | `REPORT_WARNING` | 콜벤팟 이용 과정에서 신고가 접수되어 운영 검토 후 주의 안내가 전달되었습니다. 이후 동일한 문제가 반복될 경우 콜벤 기능 이용이 제한될 수 있습니다. | |
| 64 | + | `TEMPORARY_RESTRICTION_14_DAYS` | `REPORT_RESTRICTION_14_DAYS` | 콜벤팟 이용 과정에서 신고가 접수되어 운영 검토 후 14일간 콜벤 기능 이용이 제한되었습니다. | |
| 65 | + | `PERMANENT_RESTRICTION` | `REPORT_PERMANENT_RESTRICTION` | 콜벤팟 이용 과정에서 신고가 접수되어 운영 검토 후 콜벤 기능 이용이 영구적으로 제한되었습니다. | |
| 66 | + """) |
| 67 | + @PostMapping("/{reportId}/process") |
| 68 | + ResponseEntity<Void> processCallvanReport( |
| 69 | + @Parameter(in = PATH) @PathVariable Integer reportId, |
| 70 | + @RequestBody @Valid AdminCallvanReportProcessRequest request, |
| 71 | + @Auth(permit = {ADMIN}) Integer adminId); |
| 72 | +} |
0 commit comments