-
Notifications
You must be signed in to change notification settings - Fork 0
Comment: comment 모듈 추가 및 application, api 작성 #68
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
base: main
Are you sure you want to change the base?
Conversation
…radle.kts, yml, build.gradle.kts)
project(":comment:application").projectDir = comment("application") | ||
project(":comment:rdb-adapter").projectDir = comment("rdb") | ||
project(":comment:webmvc-adapter").projectDir = comment("web-mvc") |
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.
❗️ "web-mvc"
폴더가 존재하지 않습니다.
단, 이것을 해결해도 다른 오류가 남아 있어 정상적으로 실행되지는 않습니다.
(자주 언급되고 있는 오류이므로 다른 리뷰보다 먼저 싱글 코멘트로 남기겠습니다.)
val comment = getDirectories("services", "comment") | ||
|
||
// SERVICE/COMMENT | ||
include( |
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.
타 도메인과 중복되는 모듈명으로 부터 main-runner 모듈에서 yml 파일 import 부분에 트러블슈팅이 있었습니다!
하기와 같은 수정을 요청 드립니다.
- 수정 예시
include(
":comment",
":comment:comment-api",
":comment:comment-api-domain",
":comment:comment-api-exception",
":comment:comment-api-readmodel",
":comment:comment-application",
":comment:comment-rdb-adapter",
":comment:comment-webmvc-adapter",
)
project(":comment").projectDir = comment("comment")
project(":comment:comment-api").projectDir = comment("api")
project(":comment:comment-api-domain").projectDir = comment("domain")
project(":comment:comment-api-exception").projectDir = comment("exception")
project(":comment:comment-api-readmodel").projectDir = comment("readmodel")
project(":comment:comment-application").projectDir = comment("application")
project(":comment:comment-rdb-adapter").projectDir = comment("rdb")
project(":comment:comment-webmvc-adapter").projectDir = comment("web-mvc")
@Getter | ||
@DynamicUpdate | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity(name = "comment") | ||
public class ReplyEntity extends LongBaseTimeEntity { | ||
|
||
@Id | ||
private Long id; | ||
|
||
private String content; | ||
|
||
@Convert | ||
private ReplyEntityStatus status; | ||
} |
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.
엔티티 관련한 문의사항이 있습니다!
- 접근제한자 private
- Entity 필드의 접근 제한자는 멀티 모듈 환경에서 public으로 지정하기로 하였습니다.
- 모듈이란 스코프 내에서 코딩이 이루어지기 때문에 private는 불필요 했습니다.
- 테스트 코드를 짤 때 더 유연해집니다.
- @convert에 컨버터를 위한 클래스 지칭
- Convert는 따로 해당 필드를 위한 컨버터 클래스를 지칭해야 하는 것으로 알고 있습니다. 혹시 이 작업은 누락일까요?
- board 예시
@Getter
@DynamicUpdate
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Entity(name = "board")
public class BoardEntity extends LongBaseTimeEntity {
public String title;
public String content;
@Convert(converter = BoardEntityStatusConverter.class)
public BoardEntityStatus status;
@Builder
public BoardEntity(String title, String content, BoardEntityStatus status) {
this.title = title;
this.content = content;
this.status = status;
}
}
- builder 패턴을 적용하지 않은 이유가 있을까요?
// spring | ||
implementation("org.springframework.boot:spring-boot-starter-data-jpa") |
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.
❗ 중복된 라이브러리 생략
얼마 전 Snowflake ID 모듈을 개발하면서 jpa-core의 build.gradle.kts가 다음과 같이 수정되었습니다.
dependencies {
api(project(":snowflake-id-hibernate"))
api("org.springframework.boot:spring-boot-starter-data-jpa")
이에 JPA 라이브러리를 이용하기 위한 driven 모듈은 하기와 같은 라이브러리를 중복으로 등록할 필요가 없습니다 👍
// ❌ 삭제 대상
// spring
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
Pull Request
Issues
Description
services/comment/api 모듈 추가
services/comment/application 모듈 추가
services/comment/driven/rdb 모듈 추가
How Has This Been Tested?
Additional Notes
board랑 일일이 대조해보면서 똑같은 구조로 작성했다고 생각하는데, board 테이블은 생성이 되지만 comment 테이블은 생성이 안됩니다.. 혹시 문제 원인에 대해서 도움을 받을 수 있을까요 ?