-
Notifications
You must be signed in to change notification settings - Fork 1
[refactor] 유저 장애유형,이동보조수단 enum 처리 및 유저 이미지 등록 관련 로직 주석 처리 #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c3cb2eb
ad3c3aa
f43b334
0dbf474
2f733d7
95ef08d
c8cd113
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.wayble.server.user.entity; | ||
|
|
||
| public enum DisabilityType { | ||
| DEVELOPMENTAL, // 발달장애 | ||
| VISUAL, // 시각장애 | ||
| PHYSICAL, // 지체장애 | ||
| AUDITORY // 청각장애 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.wayble.server.user.entity; | ||
|
|
||
| public enum MobilityAid { | ||
| GUIDE_DOG, // 안내견 | ||
| CANE, // 지팡이 | ||
| WHEELCHAIR, // 휠체어 | ||
| NONE // 없음 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| package com.wayble.server.user.entity; | ||
|
|
||
| import com.wayble.server.common.converter.StringListConverter; | ||
| import com.wayble.server.common.entity.BaseEntity; | ||
| import com.wayble.server.review.entity.Review; | ||
| import jakarta.persistence.*; | ||
|
|
@@ -59,14 +58,17 @@ public class User extends BaseEntity { | |
| @Column(name = "profile_image_url") | ||
| private String profileImageUrl; | ||
|
|
||
| @Convert(converter = StringListConverter.class) | ||
| @ElementCollection(fetch = FetchType.LAZY) | ||
| @CollectionTable(name = "user_disability_type", joinColumns = @JoinColumn(name = "user_id")) | ||
| @Enumerated(EnumType.STRING) | ||
| @Column(name = "disability_type") | ||
| private List<String> disabilityType; // 장애 유형 (발달장애,시각장애,지체장애,청각장애) | ||
|
|
||
| private List<DisabilityType> disabilityType = new ArrayList<>(); // 장애 유형 (발달장애,시각장애,지체장애,청각장애) | ||
|
Comment on lines
+61
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainJPA @ElementCollection 매핑으로 개선됨
기존 데이터가 있다면 마이그레이션 스크립트가 필요할 수 있습니다. 다음 스크립트로 관련 마이그레이션 파일을 확인해주세요: Also applies to: 68-72 🏁 Script executed: #!/bin/bash
# 마이그레이션 파일 확인
fd -e sql . | xargs grep -l "user_disability_type\|user_mobility_aid" 2>/dev/null || echo "마이그레이션 파일을 찾을 수 없습니다"Length of output: 122 DB 마이그레이션 스크립트 누락 확인 및 불필요한 import 제거 필요
🤖 Prompt for AI Agents |
||
|
|
||
| @Convert(converter = StringListConverter.class) | ||
| @ElementCollection(fetch = FetchType.LAZY) | ||
| @CollectionTable(name = "user_mobility_aid", joinColumns = @JoinColumn(name = "user_id")) | ||
| @Enumerated(EnumType.STRING) | ||
| @Column(name = "mobility_aid") | ||
| private List<String> mobilityAid; // 이동 보조 수단 (안내견,지팡이,동행인,휠체어) | ||
| private List<MobilityAid> mobilityAid = new ArrayList<>(); // 이동보조수단 (안내견,지팡이,휠체어,없음) | ||
|
|
||
| @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true) | ||
| private List<Review> reviewList = new ArrayList<>(); | ||
|
|
@@ -121,9 +123,9 @@ public void setNickname(String nickname) { | |
| this.nickname = nickname; | ||
| } | ||
|
|
||
| public void setDisabilityType(List<String> disabilityType) { this.disabilityType = disabilityType; } | ||
| public void setDisabilityType(List<DisabilityType> disabilityType) { this.disabilityType = disabilityType; } | ||
|
|
||
| public void setMobilityAid(List<String> mobilityAid) { this.mobilityAid = mobilityAid; } | ||
| public void setMobilityAid(List<MobilityAid> mobilityAid) { this.mobilityAid = mobilityAid; } | ||
|
|
||
| public void setBirthDate(LocalDate birthDate) { this.birthDate = birthDate; } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
강타입 enum 사용으로 개선됨
List<String>에서List<DisabilityType>,List<MobilityAid>로 변경하여 타입 안전성이 향상되었습니다. 다만 validation 검증이 필요합니다.다음 스크립트로 enum 값들이 올바르게 정의되어 있는지 확인해주세요:
Also applies to: 34-34
🏁 Script executed:
Length of output: 102
다음 스크립트로 Java 소스 전체에서 enum 정의를 다시 확인해주세요.
(이전 ast-grep 결과가 없었으므로 ripgrep으로 재검증)
🏁 Script executed:
Length of output: 990
강타입 enum 정의 검증 완료 — Validation 로직 추가 필요
• DEVELOPMENTAL, VISUAL
• GUIDE_DOG, CANE
위 enum 정의가 정상 확인되었습니다.
따라서 DTO(src/main/java/com/wayble/server/user/dto/UserInfoRegisterRequestDto.java, 32·34)에서
List<DisabilityType>·List<MobilityAid>사용은 안전합니다.다만 아래 사항을 검증하는 Validation 로직을 추가해주세요:
userType == DISABLED일 때만 값이 전달되는지🤖 Prompt for AI Agents