-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: 도메인별 패키지 구조로 재구성 #322
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
refactor: 도메인별 패키지 구조로 재구성 #322
Conversation
9d21b0b to
950a6b9
Compare
|
고생하셨습니다!! 커밋을 잘 작성해주셔서 읽기 엄청 편하네요!!
|
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 90 files out of 197 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
항상 꼼꼼히 봐주셔서 감사합니다
특정 도메인에만 관련된 config들은 그 도메인 안으로 이동하셨는데 redis config는 안옮기신 이유가 따로 있나요?
redis는 토큰 저장할 때도 쓰여서 특정 도메인에만 사용되는게 아니기 때문입니다.
특히 아래 코드블럭은 ‘어플리케이션과 레디스의 연결’을 설정하는것이기 때문에, 범용적으로 사용됩니다!
public RedisConfig(@Value("${spring.data.redis.host}") final String redisHost,
@Value("${spring.data.redis.port}") final int redisPort) {
this.redisHost = redisHost;
this.redisPort = redisPort;
}redis 관련 서비스나 RedisConstants는 post로 옮기셨길래 여쭤봐요!
RedisService나 RedisConstants는 RedisConfig와 달리 post 하위에서만 사용되고 있어서 옮겼어요~
RedisService 의 increaseViewCount 는 ‘조회수를 증가시키는’ 특정한 역할을 하고 있어요.
RedisConstants는 ‘게시글 조회수의 락 TTL’이 선언되어있고요.
(RedisConstants나 RedisService의 클래스의 이름이 동작을 잘 설명하지 못하는 것 같아요.
리팩터링이 필요하다 생각합니다😅)
범용적으로 쓰이는 config 패키지는 그럼 최상위에 있는 것보단 common 안에 있는 게 의미가 더 명확한 거 같은데 어떤가요?
그게 더 좋겠네요! 반영했습니다. (81142f2)
s3 패키지만 다른 패키지와 달리 한 패키지 안에 config, service, dto, controller 등이 있는데 이것도 고쳐야할까요?
그것도 이번에 바꾸는게 좋겠네요! 반영했습니다. (3c856ac)
짚어주셔서 감사합니다 🙇🏻♀️
- BoardCode를 community.board.domain 으로 - PostCategory를 community.post.domain 으로 - RedisConstants 를 community.post.service 로
- ImgType을 s3로
- LanguageTestType, SemesterAvailableForDispatch, TuitionFeeType을 university.domain 으로
- PreparationStatus, Role을 siteuser.domain 로
- VerifyStatus 을 application.domain 로
- RedisService, UpdateViewCountService 를 post.service 로
- location 패키지 하위에 region 과 country 를 생성 - Region, InterestedRegion 을 location.region.domain 으로 - Country, InterestedCountry 을 location.country.domain 으로 - RegionRepository, InterestedRegionRepository를 location.region.repository 으로 - CountryRepository, InterestedCountyRepository를 location.country.repository 으로 - 테스트 코드는 프로덕션 코드와 대응하는 위치로
- custom.security에 있던 security를 루트 경로로 - 스프링 시큐리티는 서블릿 밖에 존재하므로, 분리된 하나의 관심사라 볼 수 있다.
- custom -> common
- 특정 dto 에서만 사용하므로, 그 하위로 옮긴다. - RejectedReasonRequired, RejectedReasonValidator를 admin.dto.validation 으로 - ValidUniversityChoice, ValidUniversityChoiceValidator를 university.dto.validation 으로
- 여러 도메인에서 쓰이므로 common 하위로
- 관련 도메인 하위에서만 필요한 설정은 그 도메인 하위로 옮긴다. - AppleOAuthClientProperties, KakaoOAuthClientProperties 를 auth.client.config 로 - CorsProperties, JwtProperties, SecurityConfiguration, AuthenticationManagerConfig 를 security.config 로
config -> common.config
- 다른 도메인 패키지들과 마찬가지로, 레이어별로 패키지를 나눈다.
3c856ac to
2b16142
Compare
작업 내용
지난 회의에서 말씀드렸던, 패키지 재구성에 대한 PR입니다.
특이 사항
❗️커밋의 바디에 설명을 적어뒀으니, 따라가며 읽어주세요❗️
리뷰 요구사항 (선택)