-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/#54/게시판 게시글 작성 #74
Merged
The head ref may contain hidden characters: "feat/#54/\uAC8C\uC2DC\uD310-\uAC8C\uC2DC\uAE00-\uC791\uC131"
+166
−17
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f91fefd
feat: Post 엔티티 builder 생성
arkchive f1188af
feat: 컬럼명 변경
arkchive abee4fa
feat: 필드명 변경
arkchive 5196394
feat: postImage 빌더 생성
arkchive c7f6d88
feat: CreatePostRequest 게시글 작성 request 생성
arkchive 02b6b64
feat: 게시글 작성 controller, service 작성
arkchive b9faf21
Merge branch 'develop' of https://github.com/KUIT-Space/KUIT_Space_Ba…
arkchive cf9ad21
feat: PostException 생성
arkchive 0aab179
feat: 이미지 저장 로직 수정
arkchive 4d3fb9a
feat: Post, PostImage 엔티티 매핑 수정
arkchive 91018ca
feat: PostImage 객체 생성시 Post 객체 할당
arkchive 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
35 changes: 35 additions & 0 deletions
35
src/main/java/space/space_spring/dto/post/request/CreatePostRequest.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package space.space_spring.dto.post.request; | ||
|
||
import lombok.*; | ||
import org.springframework.web.multipart.MultipartFile; | ||
import space.space_spring.entity.Post; | ||
import space.space_spring.entity.PostImage; | ||
import space.space_spring.entity.Space; | ||
import space.space_spring.entity.User; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class CreatePostRequest { | ||
private String title; | ||
private String content; | ||
private String type; // "notice" or "general" | ||
private List<MultipartFile> postImages; | ||
|
||
public Post toEntity(User user, Space space, List<PostImage> postImages){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3: 정적 팩토리 메소드 |
||
return Post.builder() | ||
.user(user) | ||
.space(space) | ||
.title(title) | ||
.content(content) | ||
.type(type) | ||
.postImages(postImages) | ||
.build(); | ||
} | ||
} | ||
|
||
|
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.
추후에 Enum으로 관리하면 좋을 것 같습니다.