Skip to content

Conversation

@kkeunii
Copy link
Collaborator

@kkeunii kkeunii commented Jan 17, 2026

🔗 Related Issue

📝 Summary

Finance MBTI 테스트 제출 API

  • 테스트 제출 시 서버 기준의 활성 문항 목록을 기준으로 검증

  • 첫검사와 재검사를 동일한 API로 통합하여 처리

  • 재검사 전용 엔드포인트를 추가하지 않고, 테스트 재제출 시 기존 active 결과를 비활성화(isActive=false) 하고 새 결과를 active로 저장하는 방식으로 구현

  • answers 데이터에 대한 예외처리를 서비스에 추가

    1. questionId 중복 제출 여부
    2. 활성화되지 않은 문항 ID 포함 여부
    3. choiceValue가 1~5 범위를 벗어나는 경우
    4. answers 개수와 활성 문항 개수 동일 여부

MBTI 결과 조회

  • member 기준으로 항상 최신(active) 결과 1건만 조회
  • 이전 결과는 히스토리로 남고, 조회 대상에서는 제외

MBTI 유형 정보 조회

  • 각 MBTI 유형(16유형)에 대해 영문 타입명/축 이름을 함께 제공

MBTI 유형별 질문 조회

  • 4가지 영역별 질문 12개 조회 가능

🔄 Changes

  • API 변경 (추가/수정)
  • 데이터 및 도메인 변경 (DB, 비즈니스 로직)
  • 설정 또는 인프라 관련 변경
  • 리팩토링

💬 Questions & Review Points

재검사의 경우 딱히 횟수 제한이나, mbti 변경시 비교 화면이 없어서 굳이 새 엔드포인트 만들 필요는 없다고 판단해서 테스트 엔드포인트 그대로 사용합니다!!

📸 API Test Results (Swagger)

POST /api/finance-mbti/test

image image

GET /api/finance-mbti/result

image

GET /api/finance-mbti/questions

image

GET /api/finance-mbti/result/type

image

✅ Checklist

  • API 테스트 완료
  • 테스트 결과 사진 첨부
  • 빌드 성공 확인 (./gradlew build)

JeongGyul and others added 8 commits January 15, 2026 22:54
## 🔗 Related Issue
<!-- 이슈 번호를 작성하여 종료시켜주세요 -->
- Closes #18 

## 📝 Summary
<!-- 작업한 기능을 설명해주세요 -->
Swagger 접속을 위해 Spring Security를 설정했습니다.
- build.grade에 Spring Security 의존성 추가
- Swagger 관련 주소 접속 허용

## 🔄 Changes
<!-- 구체적으로 어떤 파일/로직이 변경되었는지 체크해주세요 -->
- [ ] API 변경 (추가/수정)
- [ ] 데이터 및 도메인 변경 (DB, 비즈니스 로직)
- [x] 설정 또는 인프라 관련 변경
- [ ] 리팩토링

## 💬 Questions & Review Points
<!-- 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요 -->
Swagger 접속을 위해 JWT 및 다른 기능들은 제외하고 SecurityConfig만 먼저 올립니다!
다른 기능들은 [기존 PR](https://github.com/Valuedi/Valuedi_Backend/pull/14)에서
확인해주세요!

## 📸 API Test Results (Swagger)
<!-- API 테스트 스크린샷 첨부 -->
<img width="1325" height="713" alt="스크린샷 2026-01-15 오후 10 27 24"
src="https://github.com/user-attachments/assets/763ce258-99b4-4810-bad1-4bb4a0bf36a9"
/>


## ✅ Checklist
- [x] API 테스트 완료
- [x] 테스트 결과 사진 첨부
- [x] 빌드 성공 확인 (./gradlew build)
@kkeunii kkeunii self-assigned this Jan 17, 2026
Copy link
Contributor

@seamooll seamooll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

커밋 메시지 작성 시에는 단순히 충돌 해결이라고 적기보다는, 어떤 충돌을 어떤 방식으로 해결했는지 조금 더 구체적으로 작성해주시면 좋을 것 같습니다. 또한 커밋 메시지 특성상 감정 표현은 제외해주시면 좋을 것 같습니다

on:
pull_request:
branches: [ "main" ,"develop" ]
branches: [ "develop" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci.yml 파일 수정하시면 안 됩니다! 충돌 잡을 때 꼼꼼하게 봐주세요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 main꺼를 처음에 머지 하면서 잘못 반영된거 같습니다...! ㅠㅠ 죄송합니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

컨트롤러단에 스웨거 명세해주세요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스웨거에서 각 필드에 기본 예시값 들어갈 수 있게 @Schema 추가해주세요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가했습니다!!

@Table(name = "mbti_question")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AllArgsConstructor 쓰실 때 access = AccessLevel.PRIVATE도 설정해주세요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵! 수정했습니다.

private MbtiQuestionCategory category;

@Lob
@Column(nullable = false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@column에 name 속성도 빠짐없이 설정해주세요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵! 추가했습니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

각 도메인별 Exception 정의하실 때 워크북에 나온 방식으로 해주세요! 7주차 워크북 참고해주시면 좋을 것 같습니다. 아래 에러 코드 부분도 같이 수정해주세요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니당

Comment on lines 58 to 70
MemberMbtiTest test = MemberMbtiTest.builder()
.memberId(memberId)
.resultType(score.resultType())
.anxietyScore(score.anxietyScore())
.stabilityScore(score.stabilityScore())
.impulseScore(score.impulseScore())
.planningScore(score.planningScore())
.aggressiveScore(score.aggressiveScore())
.conservativeScore(score.conservativeScore())
.avoidanceScore(score.avoidanceScore())
.rationalScore(score.rationalScore())
.isActive(true)
.build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엔티티와 DTO 간 변환은 컨버터에서 하는게 가독성과 책임분리 측면에서 좋을 것 같습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서비스단은 Query, Command로 나눠서 작성해주세요! 트랜잭션 어노테이션은 클래스 분리 후 클래스 단에서 붙이는 게 좋을 것같습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!!

@Transactional(readOnly = true)
public FinanceMbtiTypeInfoDto get(MbtiType type) {
MbtiTypeInfo e = mbtiTypeInfoRepository.findByType(type)
.orElseThrow(() -> new IllegalStateException("Finance MBTI type info not found: " + type));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

에러 처리하실 때 전역핸들러 사용해서 해주셔요! 7주차 워크북 참고해주시면 좋을 것 같습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네!!

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
public class MemberMbtiResponse {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

도메인은 BaseEntity 상속해주시고 createdAt 필드 삭제해주세요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵! MemberMbtiTest랑 MbtiQuestion도 동일하게 적용했습니당

Copy link
Collaborator

@JeongGyul JeongGyul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다! 코멘트 확인 부탁드려요!

@kkeunii kkeunii merged commit aab70ff into develop Jan 18, 2026
@kkeunii kkeunii added ✨ feat 기능 구현 가은 가은 labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 기능 구현 가은 가은

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants