Skip to content

Commit

Permalink
chore: 주석 해제
Browse files Browse the repository at this point in the history
  • Loading branch information
smartandhandsome committed Mar 10, 2024
1 parent 6c2161b commit 47522ec
Showing 1 changed file with 36 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package coffeemeet.server.admin.presentation;

import static coffeemeet.server.admin.exception.AdminErrorCode.NOT_AUTHORIZED;

import coffeemeet.server.admin.presentation.dto.AdminCustomPage;
import coffeemeet.server.admin.presentation.dto.AdminCustomSlice;
import coffeemeet.server.admin.presentation.dto.AdminLoginHTTP;
Expand All @@ -12,6 +14,7 @@
import coffeemeet.server.certification.service.CertificationService;
import coffeemeet.server.certification.service.dto.PendingCertification;
import coffeemeet.server.certification.service.dto.PendingCertificationPageDto;
import coffeemeet.server.common.execption.InvalidAuthException;
import coffeemeet.server.inquiry.presentation.dto.InquiryDetailHTTP;
import coffeemeet.server.inquiry.service.InquiryService;
import coffeemeet.server.inquiry.service.dto.InquiryDetailDto;
Expand Down Expand Up @@ -82,9 +85,9 @@ public ResponseEntity<Void> logout(
public ResponseEntity<Void> approveCertification(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@PathVariable Long certificationId) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
adminService.approveCertification(certificationId);
return ResponseEntity.ok().build();
}
Expand All @@ -93,9 +96,9 @@ public ResponseEntity<Void> approveCertification(
public ResponseEntity<Void> rejectCertification(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@PathVariable Long certificationId) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
adminService.rejectCertification(certificationId);
return ResponseEntity.ok().build();
}
Expand All @@ -106,9 +109,9 @@ public ResponseEntity<Void> assignReportPenalty(
@PathVariable Long targetedId,
@Valid @RequestBody UserPunishmentHTTP.Request request
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
adminService.approveReport(targetedId, request.reportIds());
return ResponseEntity.ok().build();
}
Expand All @@ -118,9 +121,9 @@ public ResponseEntity<Void> dismissReport(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@Valid @RequestBody ReportDeletionHTTP.Request request
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
adminService.dismissReport(request.reportIds());
return ResponseEntity.ok().build();
}
Expand All @@ -131,9 +134,9 @@ public ResponseEntity<AdminCustomSlice<ReportSummary>> findAllReports(
@RequestParam(defaultValue = "0") Long lastReportId,
@RequestParam(defaultValue = "10") int pageSize
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
ReportListDto reportListDto = reportService.findAllReports(lastReportId, pageSize);
return ResponseEntity.ok(
AdminCustomSlice.of(reportListDto.contents(), reportListDto.hasNext()));
Expand All @@ -144,9 +147,9 @@ public ResponseEntity<GroupReportHTTP.Response> findReportByTargetIdAndChattingR
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@ModelAttribute FindGroupReportsParam findGroupReportsParam
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
List<GroupReportDto> responses = reportService.findReportByTargetIdAndChattingRoomId(
findGroupReportsParam.targetedId(), findGroupReportsParam.chattingRoomId());
return ResponseEntity.ok(GroupReportHTTP.Response.from(responses));
Expand All @@ -157,9 +160,9 @@ public ResponseEntity<ReportDetailHTTP.Response> findReport(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@PathVariable Long reportId
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
ReportDetailDto response = reportService.findReportById(reportId);
return ResponseEntity.ok(ReportDetailHTTP.Response.from(response));
}
Expand All @@ -169,9 +172,9 @@ public ResponseEntity<AdminCustomSlice<InquirySummary>> searchInquiries(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@RequestParam(defaultValue = "0") Long lastInquiryId,
@RequestParam(defaultValue = "10") int pageSize) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
InquirySearchDto inquiries = inquiryService.searchInquiries(lastInquiryId, pageSize);
return ResponseEntity.ok(AdminCustomSlice.of(inquiries.contents(), inquiries.hasNext()));
}
Expand All @@ -181,9 +184,9 @@ public ResponseEntity<InquiryDetailHTTP.Response> viewInquiry(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@PathVariable Long inquiryId
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
InquiryDetailDto response = inquiryService.findInquiryBy(inquiryId);
return ResponseEntity.ok(InquiryDetailHTTP.Response.from(response));
}
Expand All @@ -192,9 +195,9 @@ public ResponseEntity<InquiryDetailHTTP.Response> viewInquiry(
public ResponseEntity<Void> checkInquiry(
@SessionAttribute(name = ADMIN_SESSION_ATTRIBUTE, required = false) String adminId,
@PathVariable Long inquiryId) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}
adminService.checkInquiry(inquiryId);
return ResponseEntity.ok().build();
}
Expand All @@ -205,9 +208,9 @@ public ResponseEntity<AdminCustomPage<PendingCertification>> getPendingCertifica
@RequestParam(defaultValue = "0") int offset,
@RequestParam(defaultValue = "10") int size
) {
// if (adminId == null) {
// throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
// }
if (adminId == null) {
throw new InvalidAuthException(NOT_AUTHORIZED, REQUEST_WITHOUT_SESSION_MESSAGE);
}

int pageNumber = offset / size;
Pageable pageable = PageRequest.of(pageNumber, size);
Expand Down

0 comments on commit 47522ec

Please sign in to comment.