From add16a53df1758aa3221015a34e9424733629198 Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Thu, 12 Oct 2023 16:37:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?remove:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20API=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gsm/blabla/crew/api/CrewController.java | 9 --------- .../gsm/blabla/crew/application/CrewService.java | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/src/main/java/com/gsm/blabla/crew/api/CrewController.java b/src/main/java/com/gsm/blabla/crew/api/CrewController.java index a9eab068..dc578759 100644 --- a/src/main/java/com/gsm/blabla/crew/api/CrewController.java +++ b/src/main/java/com/gsm/blabla/crew/api/CrewController.java @@ -57,15 +57,6 @@ public DataResponseDto getReport( return DataResponseDto.of(crewService.getReport(reportId)); } - @Operation(summary = "멤버 프로필 조회 API") - @GetMapping("/{language}/crews/{crewId}/profile/{memberId}") - public DataResponseDto getMemberProfile( - @PathVariable String language, - @PathVariable Long crewId, - @PathVariable Long memberId) { - return DataResponseDto.of(crewService.getMemberProfile(language, crewId, memberId)); - } - @Operation(summary = "음성 채팅 유저 피드백 저장 API") @PostMapping(value = "/voice-files/{voiceFileId}/feedback") public DataResponseDto> createFeedback( diff --git a/src/main/java/com/gsm/blabla/crew/application/CrewService.java b/src/main/java/com/gsm/blabla/crew/application/CrewService.java index 0a759ca8..8bc8101e 100644 --- a/src/main/java/com/gsm/blabla/crew/application/CrewService.java +++ b/src/main/java/com/gsm/blabla/crew/application/CrewService.java @@ -137,19 +137,6 @@ public Map createVoiceFileRequest(Long reportId, MultipartFile fil return Collections.singletonMap("voiceFileId", voiceFileId); } - @Transactional(readOnly = true) - public MemberProfileResponseDto getMemberProfile(String language, Long crewId, Long memberId) { - if (!Objects.equals(language, "ko") && !Objects.equals(language, "en")) { - throw new GeneralException(Code.LANGUAGE_NOT_SUPPORTED, "ko 또는 en만 지원합니다."); - } - - Member member = memberRepository.findById(memberId).orElseThrow( - () -> new GeneralException(Code.MEMBER_NOT_FOUND, "존재하지 않는 유저입니다.") - ); - - return MemberProfileResponseDto.getCrewMemberProfile(member); - } - public Map createReportRequest(Long reportId) { LocalDateTime endAt = LocalDateTime.now(); From 99a552bf53aed7f4b13be18ea806c599e536842d Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Thu, 12 Oct 2023 16:46:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20URL=EC=97=90=20API=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gsm/blabla/admin/api/AdminController.java | 2 +- .../com/gsm/blabla/agora/api/AgoraController.java | 2 +- .../java/com/gsm/blabla/auth/api/AuthController.java | 2 +- .../com/gsm/blabla/content/api/ContentController.java | 2 +- .../java/com/gsm/blabla/crew/api/CrewController.java | 11 ++++++----- .../com/gsm/blabla/crew/api/ScheduleController.java | 2 +- .../com/gsm/blabla/member/api/MemberController.java | 1 + .../com/gsm/blabla/report/api/ReportController.java | 2 +- .../com/gsm/blabla/admin/api/AdminControllerTest.java | 2 +- .../com/gsm/blabla/agora/api/AgoraControllerTest.java | 6 +++--- .../com/gsm/blabla/auth/api/AuthControllerTest.java | 2 +- .../gsm/blabla/content/api/ContentControllerTest.java | 6 +++--- .../com/gsm/blabla/crew/api/CrewControllerTest.java | 2 +- .../gsm/blabla/crew/api/ScheduleControllerTest.java | 10 +++++----- .../gsm/blabla/report/api/ReportControllerTest.java | 2 +- 15 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/gsm/blabla/admin/api/AdminController.java b/src/main/java/com/gsm/blabla/admin/api/AdminController.java index d4489606..84349271 100644 --- a/src/main/java/com/gsm/blabla/admin/api/AdminController.java +++ b/src/main/java/com/gsm/blabla/admin/api/AdminController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController; @Tag(name = "Admin 관련 API") -@RequestMapping("/admin") +@RequestMapping("/api/v1/admin") @RestController @RequiredArgsConstructor public class AdminController { diff --git a/src/main/java/com/gsm/blabla/agora/api/AgoraController.java b/src/main/java/com/gsm/blabla/agora/api/AgoraController.java index f3ce02fd..6d027268 100644 --- a/src/main/java/com/gsm/blabla/agora/api/AgoraController.java +++ b/src/main/java/com/gsm/blabla/agora/api/AgoraController.java @@ -15,7 +15,7 @@ @Tag(name = "Agora 관련 API") @RestController -@RequestMapping("/crews/voice-room") +@RequestMapping("/api/v1/crews/voice-room") @RequiredArgsConstructor public class AgoraController { private final AgoraService agoraService; diff --git a/src/main/java/com/gsm/blabla/auth/api/AuthController.java b/src/main/java/com/gsm/blabla/auth/api/AuthController.java index 6f0429cb..551fd6d2 100644 --- a/src/main/java/com/gsm/blabla/auth/api/AuthController.java +++ b/src/main/java/com/gsm/blabla/auth/api/AuthController.java @@ -19,7 +19,7 @@ @Tag(name = "OAuth 관련 API") @RestController -@RequestMapping("/oauth") +@RequestMapping("/api/v1/oauth") @RequiredArgsConstructor public class AuthController { private final AuthService authService; diff --git a/src/main/java/com/gsm/blabla/content/api/ContentController.java b/src/main/java/com/gsm/blabla/content/api/ContentController.java index 29df740a..c3e3fc4a 100644 --- a/src/main/java/com/gsm/blabla/content/api/ContentController.java +++ b/src/main/java/com/gsm/blabla/content/api/ContentController.java @@ -18,7 +18,7 @@ @Validated @Tag(name = "컨텐츠 관련 API") @RestController -@RequestMapping("/contents") +@RequestMapping("/api/v1/contents") @RequiredArgsConstructor public class ContentController { diff --git a/src/main/java/com/gsm/blabla/crew/api/CrewController.java b/src/main/java/com/gsm/blabla/crew/api/CrewController.java index dc578759..5bb3774f 100644 --- a/src/main/java/com/gsm/blabla/crew/api/CrewController.java +++ b/src/main/java/com/gsm/blabla/crew/api/CrewController.java @@ -14,6 +14,7 @@ @Tag(name = "Crew 관련 API") @RestController +@RequestMapping("/api/v1/crews/reports") @RequiredArgsConstructor public class CrewController { @@ -21,14 +22,14 @@ public class CrewController { @Operation(summary = "음성 파일 분석 API") - @PostMapping(value = "/crews/reports/voice-file") + @PostMapping(value = "/voice-file") public DataResponseDto> createVoiceFile( @RequestBody VoiceAnalysisResponseDto voiceAnalysisResponseDto) { return DataResponseDto.of(crewService.createVoiceFile(voiceAnalysisResponseDto)); } @Operation(summary = "음성 파일 분석 요청 API") - @PostMapping(value = "/crews/reports/{reportId}/voice-file/request") + @PostMapping(value = "/{reportId}/voice-file/request") public DataResponseDto> createVoiceFileRequest( @PathVariable("reportId") Long reportId, @RequestParam("file") MultipartFile file, @@ -37,21 +38,21 @@ public DataResponseDto> createVoiceFileRequest( } @Operation(summary = "크루 리포트 생성 API") - @PostMapping(value = "/crews/reports/{reportId}") + @PostMapping(value = "/{reportId}") public DataResponseDto> createReport( @PathVariable("reportId") Long reportId) { return DataResponseDto.of(crewService.createReport(reportId)); } @Operation(summary = "크루 리포트 생성 요청 API") - @PostMapping(value = "/crews/reports/{reportId}/request") + @PostMapping(value = "/{reportId}/request") public DataResponseDto> createReportRequest( @PathVariable("reportId") Long reportId) { return DataResponseDto.of(crewService.createReportRequest(reportId)); } @Operation(summary = "크루 리포트 조회 API") - @GetMapping(value = "/crews/reports/{reportId}") + @GetMapping(value = "/{reportId}") public DataResponseDto getReport( @PathVariable("reportId") Long reportId) { return DataResponseDto.of(crewService.getReport(reportId)); diff --git a/src/main/java/com/gsm/blabla/crew/api/ScheduleController.java b/src/main/java/com/gsm/blabla/crew/api/ScheduleController.java index 2c31cb54..6fef6412 100644 --- a/src/main/java/com/gsm/blabla/crew/api/ScheduleController.java +++ b/src/main/java/com/gsm/blabla/crew/api/ScheduleController.java @@ -18,7 +18,7 @@ @Tag(name = "크루 스페이스 일정 관련 API") @RestController -@RequestMapping("/crews/schedules") +@RequestMapping("/api/v1/crews/schedules") @RequiredArgsConstructor public class ScheduleController { diff --git a/src/main/java/com/gsm/blabla/member/api/MemberController.java b/src/main/java/com/gsm/blabla/member/api/MemberController.java index 2aed4c7e..dd56f93f 100644 --- a/src/main/java/com/gsm/blabla/member/api/MemberController.java +++ b/src/main/java/com/gsm/blabla/member/api/MemberController.java @@ -17,6 +17,7 @@ @Validated @Tag(name = "멤버 관련 API") @RestController +@RequestMapping("/api/v1") @RequiredArgsConstructor public class MemberController { private final MemberService memberService; diff --git a/src/main/java/com/gsm/blabla/report/api/ReportController.java b/src/main/java/com/gsm/blabla/report/api/ReportController.java index dca9bafd..b7a03461 100644 --- a/src/main/java/com/gsm/blabla/report/api/ReportController.java +++ b/src/main/java/com/gsm/blabla/report/api/ReportController.java @@ -14,7 +14,7 @@ @Tag(name = "Report 관련 API") @RestController -@RequestMapping("/reports") +@RequestMapping("/api/v1/reports") @RequiredArgsConstructor public class ReportController { diff --git a/src/test/java/com/gsm/blabla/admin/api/AdminControllerTest.java b/src/test/java/com/gsm/blabla/admin/api/AdminControllerTest.java index 07a8e4e7..d578ff3b 100644 --- a/src/test/java/com/gsm/blabla/admin/api/AdminControllerTest.java +++ b/src/test/java/com/gsm/blabla/admin/api/AdminControllerTest.java @@ -17,7 +17,7 @@ class AdminControllerTest extends ControllerTestSupport { @WithCustomMockUser void getHealthCheck() throws Exception { mockMvc.perform( - get("/admin/health-check") + get("/api/v1/admin/health-check") ) .andDo(print()) .andExpect(status().isOk()) diff --git a/src/test/java/com/gsm/blabla/agora/api/AgoraControllerTest.java b/src/test/java/com/gsm/blabla/agora/api/AgoraControllerTest.java index 9ae20a4f..014719a7 100644 --- a/src/test/java/com/gsm/blabla/agora/api/AgoraControllerTest.java +++ b/src/test/java/com/gsm/blabla/agora/api/AgoraControllerTest.java @@ -43,7 +43,7 @@ void create() throws Exception { // when // then mockMvc.perform( - post("/crews/voice-room") + post("/api/v1/crews/voice-room") .with(csrf()) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString( @@ -73,7 +73,7 @@ void getMembers() throws Exception { // when // then mockMvc.perform( - get("/crews/voice-room") + get("/api/v1/crews/voice-room") ) .andDo(print()) @@ -94,7 +94,7 @@ void accuse() throws Exception { // when // then mockMvc.perform( - post("/crews/voice-room/accuse") + post("/api/v1/crews/voice-room/accuse") .with(csrf()) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(AccuseRequestDto.builder() diff --git a/src/test/java/com/gsm/blabla/auth/api/AuthControllerTest.java b/src/test/java/com/gsm/blabla/auth/api/AuthControllerTest.java index c01b370d..15ce527e 100644 --- a/src/test/java/com/gsm/blabla/auth/api/AuthControllerTest.java +++ b/src/test/java/com/gsm/blabla/auth/api/AuthControllerTest.java @@ -34,7 +34,7 @@ void signUp() throws Exception { // when // then mockMvc.perform( - post("/oauth/sign-up") + post("/api/v1/oauth/sign-up") .with(csrf()) .contentType(MediaType.APPLICATION_JSON_VALUE) .header("Authorization", "test") diff --git a/src/test/java/com/gsm/blabla/content/api/ContentControllerTest.java b/src/test/java/com/gsm/blabla/content/api/ContentControllerTest.java index 6842b180..a9a3146d 100644 --- a/src/test/java/com/gsm/blabla/content/api/ContentControllerTest.java +++ b/src/test/java/com/gsm/blabla/content/api/ContentControllerTest.java @@ -35,7 +35,7 @@ void getContents() throws Exception { // when // then mockMvc.perform( - get("/contents").header("Content-Language", "ko") + get("/api/v1/contents").header("Content-Language", "ko") ) .andDo(print()) .andExpect(status().isOk()) @@ -73,7 +73,7 @@ void getContentDetails() throws Exception { // when // then mockMvc.perform( - get("/contents/{contentId}", 1L) + get("/api/v1/contents/{contentId}", 1L) ) .andDo(print()) .andExpect(status().isOk()) @@ -113,7 +113,7 @@ void getContentDetail() throws Exception { // when // then mockMvc.perform( - get("/contents/detail/{contentDetailId}", 1L) + get("/api/v1/contents/detail/{contentDetailId}", 1L) ) .andDo(print()) .andExpect(status().isOk()) diff --git a/src/test/java/com/gsm/blabla/crew/api/CrewControllerTest.java b/src/test/java/com/gsm/blabla/crew/api/CrewControllerTest.java index f85b5bed..7c578557 100644 --- a/src/test/java/com/gsm/blabla/crew/api/CrewControllerTest.java +++ b/src/test/java/com/gsm/blabla/crew/api/CrewControllerTest.java @@ -61,7 +61,7 @@ void getReport() throws Exception { // when // then mockMvc.perform( - get("/crews/reports/{reportId}", any(Long.class)) + get("/api/v1/crews/reports/{reportId}", any(Long.class)) ) .andDo(print()) .andExpect(status().isOk()) diff --git a/src/test/java/com/gsm/blabla/crew/api/ScheduleControllerTest.java b/src/test/java/com/gsm/blabla/crew/api/ScheduleControllerTest.java index 71540653..2cf28eef 100644 --- a/src/test/java/com/gsm/blabla/crew/api/ScheduleControllerTest.java +++ b/src/test/java/com/gsm/blabla/crew/api/ScheduleControllerTest.java @@ -38,7 +38,7 @@ void create() throws Exception { // when // then mockMvc.perform( - post("/crews/schedules") + post("/api/v1/crews/schedules") .with(csrf()) .contentType(MediaType.APPLICATION_JSON_VALUE) .header("Authorization", "test") @@ -66,7 +66,7 @@ void getAll() throws Exception { // when // then mockMvc.perform( - get("/crews/schedules") + get("/api/v1/crews/schedules") ) .andDo(print()) .andExpect(status().isOk()) @@ -90,7 +90,7 @@ void getUpcomingSchedule() throws Exception { // when // then mockMvc.perform( - get("/crews/schedules/upcoming") + get("/api/v1/crews/schedules/upcoming") ) .andDo(print()) .andExpect(status().isOk()) @@ -111,7 +111,7 @@ void joinSchedule() throws Exception { // when // then mockMvc.perform( - post("/crews/schedules/join") + post("/api/v1/crews/schedules/join") .with(csrf()) .header("Authorization", "test") .contentType(MediaType.APPLICATION_JSON_VALUE) @@ -136,7 +136,7 @@ void cancelSchedule() throws Exception { // when // then mockMvc.perform( - delete("/crews/schedules") + delete("/api/v1/crews/schedules") .with(csrf()) .header("Authorization", "test") .contentType(MediaType.APPLICATION_JSON_VALUE) diff --git a/src/test/java/com/gsm/blabla/report/api/ReportControllerTest.java b/src/test/java/com/gsm/blabla/report/api/ReportControllerTest.java index 303913ab..c1c140d2 100644 --- a/src/test/java/com/gsm/blabla/report/api/ReportControllerTest.java +++ b/src/test/java/com/gsm/blabla/report/api/ReportControllerTest.java @@ -50,7 +50,7 @@ void getHistory() throws Exception { // when // then mockMvc.perform( - get("/reports/history") + get("/api/v1/reports/history") .with(csrf()) ) .andDo(print())