-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from Kumoh-talk/feat/refactor-board-save
패키지 구조 리팩터링 및 세미나 게시물 저장 로직 리팩터링
- Loading branch information
Showing
107 changed files
with
838 additions
and
552 deletions.
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.