-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#31 마이페이지 추가 #32
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
Open
ojy0903
wants to merge
16
commits into
develop
Choose a base branch
from
feat/#31
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d71bfb7
:sparkles: feat: 마이페이지 Response DTO 추가
ojy0903 cfefe28
:sparkles: feat: 마이페이지 캐싱을 위한 RedisConfig 추가
ojy0903 f5b69d0
:sparkles: feat: 마이페이지 Entity -> Respone DTO 변환 Converter 메서드 추가
ojy0903 243fac4
:sparkles: feat: 마이페이지 Service 메서드 추가
ojy0903 b0b4a43
:sparkles: feat: 마이페이지 API 추가 & Swagger Docs 추가
ojy0903 d2cc693
Merge remote-tracking branch 'origin/develop' into feat/#31
ojy0903 f35a7f1
:sparkles: feat: SecurityConfig 마이페이지 접근 시 인증 요구 메서드 추가
ojy0903 e8f39ec
:sparkles: feat: 마이페이지 Provider enum 에 이메일 로그인 유형 추가
ojy0903 ae0d98a
:sparkles: feat: 소셜 로그인 Provider 반환 로직 추가
ojy0903 f9414ab
:sparkles: feat: 일반 이메일 로그인 Provider 반환 로직 추가
ojy0903 b15de47
:sparkles: feat: JWT 토큰에 Provider 정보 추가, JWT 필터에서 Provider 를 올바르게 반환하…
ojy0903 c039cc4
:sparkles: feat: 마이페이지 Response DTO 에 Provider 추가 (String 으로 출력)
ojy0903 e30d91b
:sparkles: feat: UserService 마이페이지 조회 캐시 로직 수정, Converter DTO 에 맞게 추가
ojy0903 3fcd035
:sparkles: feat: 마이페이지 API Controller 에 추가
ojy0903 b88478b
:sparkles: feat: 미사용 import 문 제거
ojy0903 41f9655
:sparkles: feat: 디버그용 출력 코드 제거
ojy0903 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
.../java/com/whereyouad/WhereYouAd/domains/user/application/dto/response/MyPageResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.whereyouad.WhereYouAd.domains.user.application.dto.response; | ||
|
|
||
| public record MyPageResponse( | ||
| Long userId, | ||
| String email, | ||
| String name, | ||
| String profileImageUrl, | ||
| String phoneNumber, | ||
| boolean isEmailVerified, | ||
| String providerType | ||
| ) { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/com/whereyouad/WhereYouAd/global/config/RedisConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package com.whereyouad.WhereYouAd.global.config; | ||
|
|
||
| import org.springframework.cache.annotation.EnableCaching; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.data.redis.cache.RedisCacheConfiguration; | ||
| import org.springframework.data.redis.cache.RedisCacheManager; | ||
| import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
| import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; | ||
| import org.springframework.data.redis.serializer.RedisSerializationContext; | ||
| import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
|
|
||
| import java.time.Duration; | ||
|
|
||
| @Configuration | ||
| @EnableCaching | ||
| public class RedisConfig { | ||
|
|
||
| @Bean | ||
| public RedisCacheManager cacheManager(RedisConnectionFactory connectionFactory) { | ||
| // Redis 캐시 설정 정의 | ||
| RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig() | ||
| // Key 직렬화: String ("user:profile::1" 처럼 보기 좋게 저장) | ||
| .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer())) | ||
| // Value 직렬화: JSON (자바 객체 -> JSON 변환 저장) | ||
| .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer())) | ||
| // TTL 설정: 데이터 유효 시간 (30분) | ||
| .entryTtl(Duration.ofMinutes(30)) | ||
| // null 데이터는 캐싱하지 않음 | ||
| .disableCachingNullValues(); | ||
|
|
||
| return RedisCacheManager.builder(connectionFactory) | ||
| .cacheDefaults(config) | ||
| .build(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
같은 유저인데 provider별로 캐시를 분리하는 것이 정말 필요한지 검토해 주세요.
현재 캐시 키가
userId + ':' + provider이므로 같은 유저(userId=1)가 이메일 로그인, 구글 로그인할 때마다 별도 캐시 엔티리가 생깁니다. 하지만MyPageResponse에서 provider 외의 필드(email,name,phoneNumber등)는 모두 DB의 동일한User엔티티에서 가져오므로, 프로필 업데이트 시 모든 provider 변형의 캐시를 각각 evict해야 데이터 불일치를 방지할 수 있습니다.예를 들어 유저가 이름을 변경하면
user:profile::1:EMAIL,user:profile::1:GOOGLE등을 모두 무효화해야 하는데, 이는 관리가 복잡해집니다.대안으로,
provider정보는 캐시에 포함하지 않고 캐시 키를userId로만 설정한 뒤, 응답 조립 시 provider를 동적으로 추가하는 방식을 고려해 보세요:💡 캐시 키 단순화 예시
단, 이 경우에도 provider가 응답에 포함되면 캐시된 값과 현재 로그인 provider가 다를 수 있으므로, provider를 캐시 대상에서 분리하는 구조가 더 적합합니다:
🤖 Prompt for AI Agents