-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 회원 정보 수정 #63
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
[FEAT] 회원 정보 수정 #63
Changes from 1 commit
2e413c7
2534429
d5fccbc
270d93c
193f9a1
55c7e03
e40e4b7
ff5d805
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.example.FixLog.dto; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public class WithdrawRequestDto { | ||
| private String password; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,9 @@ | ||||||||||||||||||||||||||||||||
| package com.example.FixLog.dto.member; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import com.example.FixLog.domain.member.Member; | ||||||||||||||||||||||||||||||||
| import com.example.FixLog.domain.member.SocialType; | ||||||||||||||||||||||||||||||||
| import com.example.FixLog.util.DefaultImage; | ||||||||||||||||||||||||||||||||
| import com.example.FixLog.util.DefaultText; | ||||||||||||||||||||||||||||||||
| import lombok.AllArgsConstructor; | ||||||||||||||||||||||||||||||||
| import lombok.Getter; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -12,4 +15,18 @@ public class MemberInfoResponseDto { | |||||||||||||||||||||||||||||||
| private String profileImageUrl; | ||||||||||||||||||||||||||||||||
| private String bio; | ||||||||||||||||||||||||||||||||
| private SocialType socialType; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| public static MemberInfoResponseDto from(Member member) { | ||||||||||||||||||||||||||||||||
| return new MemberInfoResponseDto( | ||||||||||||||||||||||||||||||||
| member.getEmail(), | ||||||||||||||||||||||||||||||||
| member.getNickname(), | ||||||||||||||||||||||||||||||||
| member.getProfileImageUrl() != null | ||||||||||||||||||||||||||||||||
| ? member.getProfileImageUrl() | ||||||||||||||||||||||||||||||||
| : DefaultImage.PROFILE, | ||||||||||||||||||||||||||||||||
| member.getBio() != null | ||||||||||||||||||||||||||||||||
| ? member.getBio() | ||||||||||||||||||||||||||||||||
| : DefaultText.BIO, | ||||||||||||||||||||||||||||||||
| member.getSocialType() | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| public static MemberInfoResponseDto from(Member member) { | |
| return new MemberInfoResponseDto( | |
| member.getEmail(), | |
| member.getNickname(), | |
| member.getProfileImageUrl() != null | |
| ? member.getProfileImageUrl() | |
| : DefaultImage.PROFILE, | |
| member.getBio() != null | |
| ? member.getBio() | |
| : DefaultText.BIO, | |
| member.getSocialType() | |
| ); | |
| } | |
| // In MemberController.java, inside getMyInfo(): | |
| MemberInfoResponseDto responseDto = MemberInfoResponseDto.from(member); |
🤖 Prompt for AI Agents
In src/main/java/com/example/FixLog/dto/member/MemberInfoResponseDto.java lines
19 to 31, the static factory method correctly handles null values with default
constants. To fix the issue, update the MemberController.getMyInfo method to use
this factory method when creating MemberInfoResponseDto instances. This will
ensure consistent default value handling and avoid duplication of null checks
across the codebase.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.example.FixLog.util; | ||
|
|
||
| public class DefaultImage { | ||
| public static final String PROFILE = "https://dummyimage.com/200x200/cccccc/ffffff&text=Profile"; // 임시 기본 프로필 이미지 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.example.FixLog.util; | ||
|
|
||
| public class DefaultText { | ||
| public static final String BIO = "오늘도 에러 없는 하루 보내세요!"; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,34 +1,33 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.application.name=FixLog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //# DB setting | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.h2.console.enabled=true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # DB setting | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.h2.console.enabled=true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ''spring.h2.console.path=/h2-console | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //# DataBase Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.datasource.url=jdbc:h2:tcp://localhost/~/fixlog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.datasource.driver-class-name=org.h2.Driver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.datasource.username=sa | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.datasource.password= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # DataBase Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.datasource.url=jdbc:h2:tcp://localhost/~/fixlog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.datasource.driver-class-name=org.h2.Driver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.datasource.username=sa | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.datasource.password= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.jpa.show-sql=true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.jpa.hibernate.ddl-auto=update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.jpa.show-sql=true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.jpa.hibernate.ddl-auto=update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # DB setting | |
| spring.h2.console.enabled=true | |
| ''spring.h2.console.path=/h2-console | |
| //# DataBase Info | |
| //spring.datasource.url=jdbc:h2:tcp://localhost/~/fixlog | |
| //spring.datasource.driver-class-name=org.h2.Driver | |
| //spring.datasource.username=sa | |
| //spring.datasource.password= | |
| # DataBase Info | |
| spring.datasource.url=jdbc:h2:tcp://localhost/~/fixlog | |
| spring.datasource.driver-class-name=org.h2.Driver | |
| spring.datasource.username=sa | |
| spring.datasource.password= | |
| //spring.jpa.show-sql=true | |
| //spring.jpa.hibernate.ddl-auto=update | |
| //spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect | |
| spring.jpa.show-sql=true | |
| spring.jpa.hibernate.ddl-auto=update | |
| spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect | |
| # DB setting | |
| spring.h2.console.enabled=true | |
| spring.h2.console.path=/h2-console | |
| # DataBase Info | |
| spring.datasource.url=jdbc:h2:tcp://localhost/~/fixlog | |
| spring.datasource.driver-class-name=org.h2.Driver | |
| spring.datasource.username=sa | |
| spring.datasource.password= | |
| spring.jpa.show-sql=true | |
| spring.jpa.hibernate.ddl-auto=update | |
| spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect |
🤖 Prompt for AI Agents
In src/main/resources/application.properties around lines 2 to 14, the H2
console path setting has incorrect syntax due to unnecessary single quotes
before the property key. Remove the leading two single quotes from the line
`''spring.h2.console.path=/h2-console` so it reads
`spring.h2.console.path=/h2-console` to fix the configuration error.
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.
이 부분들은 서비스단에서 처리하는 게 더 좋지 않을까요?
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.
말씀 주신 부분을 반영하여 해당 처리는 서비스 단에서 담당하도록 변경했습니다.
확인 부탁드립니다! :)