-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
변수명 수정 및 service, controller 전반적 로직 수정
- Loading branch information
Showing
9 changed files
with
188 additions
and
157 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
package JWTLogIn.JWT.post.dto; | ||
|
||
import JWTLogIn.JWT.post.entity.PostEntity; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@Builder | ||
public class PostDto { | ||
private String author; | ||
private Long writer; | ||
private String title; | ||
private String description; | ||
private String picture; | ||
private String content; | ||
private String thumbnail; | ||
|
||
public static PostEntity toEntity(PostDto postDto) { | ||
return PostEntity.builder() | ||
.author(postDto.author) | ||
.writer(postDto.writer) | ||
.title(postDto.title) | ||
.description(postDto.description) | ||
.picture(postDto.picture).build(); | ||
.content(postDto.content) | ||
.thumbnail(postDto.thumbnail).build(); | ||
} | ||
|
||
public static PostEntity toEntityWithId (PostDto postDto, Long writerId) { | ||
return PostEntity.builder() | ||
.writer(writerId) | ||
.title(postDto.title) | ||
.content(postDto.content) | ||
.thumbnail(postDto.thumbnail).build(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package JWTLogIn.JWT.post.entity; | ||
|
||
public enum Type { | ||
NOT, GAL | ||
} |
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.