From d7938815157fca0e6cbd7efcbd971d4669de503e Mon Sep 17 00:00:00 2001 From: TaeGang Kim <80620674+Pochomo@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:33:10 +0900 Subject: [PATCH 1/4] Create pr_template.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pr_template.md 생성, pr 컨벤션 적용 --- .github/PUL_REQUEST_TEMPLATE/pr_template.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/PUL_REQUEST_TEMPLATE/pr_template.md diff --git a/.github/PUL_REQUEST_TEMPLATE/pr_template.md b/.github/PUL_REQUEST_TEMPLATE/pr_template.md new file mode 100644 index 0000000..5eaa1e1 --- /dev/null +++ b/.github/PUL_REQUEST_TEMPLATE/pr_template.md @@ -0,0 +1,14 @@ +### PR 타입(하나 이상의 PR 타입을 선택해주세요) +-[] 기능 추가 +-[] 기능 삭제 +-[] 버그 수정 +-[] 의존성, 환경 변수, 빌드 관련 코드 업데이트 + +### 반영 브랜치 +ex) feat/login -> dev + +### 변경 사항 +ex) 로그인 시, 구글 소셜 로그인 기능을 추가했습니다. + +### 테스트 결과 +ex) 베이스 브랜치에 포함되기 위한 코드는 모두 정상적으로 동작해야 합니다. From 563e991d87ab13b52d528c5d5b3bb16ddd3c1562 Mon Sep 17 00:00:00 2001 From: TaeGang Kim <80620674+Pochomo@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:34:32 +0900 Subject: [PATCH 2/4] Delete .github/PUL_REQUEST_TEMPLATE directory --- .github/PUL_REQUEST_TEMPLATE/pr_template.md | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/PUL_REQUEST_TEMPLATE/pr_template.md diff --git a/.github/PUL_REQUEST_TEMPLATE/pr_template.md b/.github/PUL_REQUEST_TEMPLATE/pr_template.md deleted file mode 100644 index 5eaa1e1..0000000 --- a/.github/PUL_REQUEST_TEMPLATE/pr_template.md +++ /dev/null @@ -1,14 +0,0 @@ -### PR 타입(하나 이상의 PR 타입을 선택해주세요) --[] 기능 추가 --[] 기능 삭제 --[] 버그 수정 --[] 의존성, 환경 변수, 빌드 관련 코드 업데이트 - -### 반영 브랜치 -ex) feat/login -> dev - -### 변경 사항 -ex) 로그인 시, 구글 소셜 로그인 기능을 추가했습니다. - -### 테스트 결과 -ex) 베이스 브랜치에 포함되기 위한 코드는 모두 정상적으로 동작해야 합니다. From a2844b8a9e1081ba7b91f2c5e9efad8613e4b63b Mon Sep 17 00:00:00 2001 From: TaeGang Kim <80620674+Pochomo@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:36:12 +0900 Subject: [PATCH 3/4] Create pull_request_template.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pr 템플릿 적용 --- .github/pull_request_template.md | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..f42a6f5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,35 @@ +## #️⃣ Issue Number + + +## 📝 요약(Summary) + + +## 🛠️ PR 유형 +어떤 변경 사항이 있나요? + +- [ ] 새로운 기능 추가 +- [ ] 버그 수정 +- [ ] CSS 등 사용자 UI 디자인 변경 +- [ ] 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경) +- [ ] 코드 리팩토링 +- [ ] 주석 추가 및 수정 +- [ ] 문서 수정 +- [ ] 테스트 추가, 테스트 리팩토링 +- [ ] 빌드 부분 혹은 패키지 매니저 수정 +- [ ] 파일 혹은 폴더명 수정 +- [ ] 파일 혹은 폴더 삭제 + +## 📸스크린샷 (선택) + +## 💬 공유사항 to 리뷰어 + + + + + +## ✅ PR Checklist + +PR이 다음 요구 사항을 충족하는지 확인하세요. + +- [ ] 커밋 메시지 컨벤션에 맞게 작성했습니다. +- [ ] 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트). From 25f681ec7de09e5cdbb82aae2ef0b190429adb09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EA=B0=95=EC=A4=80?= Date: Thu, 13 Mar 2025 17:10:17 +0900 Subject: [PATCH 4/4] fix:mbitcontroller --- .../java/com/example/web/MBTIController.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/resource-server/src/main/java/com/example/web/MBTIController.java b/resource-server/src/main/java/com/example/web/MBTIController.java index 01b597d..e1aa148 100644 --- a/resource-server/src/main/java/com/example/web/MBTIController.java +++ b/resource-server/src/main/java/com/example/web/MBTIController.java @@ -2,29 +2,46 @@ import com.example.web.recommending.usecase.MBTISongService; import com.example.web.recommending.dto.MBTISongResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; - import java.util.Map; @RestController @RequestMapping("/recommendation") public class MBTIController { - @Autowired private MBTISongService songService; + @Operation( + summary = "MBTI 유형별 노래 추천", + description = "입력된 MBTI 유형을 기반으로 10개의 노래를 랜덤으로 추천합니다." + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "추천 노래 목록 반환", + content = @Content(schema = @Schema(implementation = MBTISongResponse.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청", + content = @Content(schema = @Schema(example = "{\"status\": 400, \"message\": \"잘못된 요청입니다.\"}"))) + }) @GetMapping - public ResponseEntity getMBTISongs(@RequestParam(required = false) String mbti) { + public ResponseEntity getMBTISongs ( + @Parameter(description = "사용자의 MBTI 유형 (예: ISFP, ENTJ)", example = "ISTJ") + @RequestParam(required = false) String mbti){ + if (mbti == null || mbti.length() != 4) { return ResponseEntity.badRequest().body(Map.of( "status", 400, "message", "잘못된 요청입니다." )); } - MBTISongResponse response = songService.getRandomSongsByMBTI(mbti); return ResponseEntity.ok(response); } } +