-
Notifications
You must be signed in to change notification settings - Fork 4
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
패키지 구조 리팩터링 및 세미나 게시물 저장 로직 리팩터링 #124
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../demo/domain/board/api/AdminBoardApi.java → .../application/board/api/AdminBoardApi.java
This file contains 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 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
6 changes: 3 additions & 3 deletions
6
...e/demo/domain/board/api/BoardFileApi.java → ...o/application/board/api/BoardFileApi.java
This file contains 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 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 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 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 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 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 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 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
37 changes: 25 additions & 12 deletions
37
...omain/dto/request/BoardCreateRequest.java → ...board/dto/request/BoardCreateRequest.java
This file contains 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 |
---|---|---|
@@ -1,48 +1,61 @@ | ||
package com.example.demo.domain.board.domain.dto.request; | ||
package com.example.demo.application.board.dto.request; | ||
|
||
|
||
import static com.example.demo.global.regex.S3UrlRegex.*; | ||
|
||
import com.example.demo.domain.board.domain.dto.vo.BoardType; | ||
import com.example.demo.application.board.dto.vo.BoardType; | ||
import com.example.demo.domain.board.service.entity.BoardCategoryNames; | ||
import com.example.demo.domain.board.service.entity.BoardCore; | ||
import com.example.demo.global.aop.valid.ValidEnum; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.annotation.Nullable; | ||
import jakarta.validation.constraints.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Schema(description = "게시물 생성 요청") | ||
public class BoardCreateRequest { | ||
public record BoardCreateRequest ( | ||
|
||
@Schema(description = "게시물 제목", example = "게시물 제목") | ||
@NotBlank(message = "제목은 필수 항목입니다.") | ||
@Size(max = 50,message = "최대 제한 45글자 입니다.") | ||
private String title; | ||
String title, | ||
|
||
@Schema(description = "게시물 내용", example = "게시물 내용") | ||
@NotBlank(message = "게시물 내용은 필수 항목입니다.") | ||
private String contents; | ||
String contents, | ||
|
||
@Schema( | ||
description = "게시물 카테고리 이름 리스트", | ||
example = "[\"카테고리1\", \"카테고리2\"]" | ||
) | ||
@Nullable | ||
@Size(max = 5,message = "카테고리는 최대 5개까지 가능합니다.") | ||
private List<String> categoryName; | ||
List<String> categoryName, | ||
|
||
@Schema(description = "게시물 태그", example = "SEMINAR") | ||
@ValidEnum(enumClass = BoardType.class,message = "태그는 'SEMINAR', 'NOTICE' 중 하나여야 합니다.") | ||
@NotNull(message = "태그는 필수 항목입니다.") | ||
private BoardType boardType; | ||
BoardType boardType, | ||
|
||
@Schema(description = "게시물 대표 이미지 URL", example = "https://kumoh-talk-bucket.s3.ap-northeast-2.amazonaws.com/board/15/image/54599f59-1d5b-4167-b9f7-96f84d3c452d/example.jpg") | ||
@NotBlank(message = "게시물 대표 이미지는 필수 항목입니다.") | ||
@Pattern(regexp = S3_BOARD_FILE_URL) | ||
private String boardHeadImageUrl; | ||
String boardHeadImageUrl | ||
){ | ||
public BoardCore toBoardCore(){ | ||
return new BoardCore( | ||
this.title, | ||
this.contents, | ||
this.boardType, | ||
this.boardHeadImageUrl | ||
); | ||
} | ||
|
||
public BoardCategoryNames toBoardCategoryNames() { | ||
return new BoardCategoryNames( | ||
this.categoryName | ||
); | ||
} | ||
} |
This file contains 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
2 changes: 1 addition & 1 deletion
2
...board/domain/dto/request/FileRequest.java → ...cation/board/dto/request/FileRequest.java
This file contains 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
4 changes: 2 additions & 2 deletions
4
...main/dto/request/PresignedUrlRequest.java → ...oard/dto/request/PresignedUrlRequest.java
This file contains 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 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
4 changes: 2 additions & 2 deletions
4
.../dto/response/BoardTitleInfoResponse.java → .../dto/response/BoardTitleInfoResponse.java
This file contains 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
2 changes: 1 addition & 1 deletion
2
...dto/response/DraftBoardTitleResponse.java → ...dto/response/DraftBoardTitleResponse.java
This file contains 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
Oops, something went wrong.
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.
P5 : 혹시 DTO에 record 키워드를 사용하는 것을 컨벤션으로 정하는게 좋다고 생각하시나요?
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.
record 사용하면 장점이 lombok 사용 안해도 보일러 코드를 사용 안해도 되고 불변 객체라는 장점이 있어서 사용하면 좋을거라 판단했습니다
근데 DTO를 record 로 컨벤션을 정하는건 취향따라 달리해도 된다고 생각합니다