-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
259 additions
and
10 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
26 changes: 26 additions & 0 deletions
26
.../main/java/com/woowacourse/pickgit/post/application/dto/request/PostDeleteRequestDto.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,26 @@ | ||
package com.woowacourse.pickgit.post.application.dto.request; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public class PostDeleteRequestDto { | ||
|
||
private Long postId; | ||
|
||
private PostDeleteRequestDto() { | ||
} | ||
|
||
public static PostDeleteRequestDto toPostDeleteRequestDto(Long postId) { | ||
return PostDeleteRequestDto.builder() | ||
.postId(postId) | ||
.build(); | ||
} | ||
|
||
public PostDeleteRequestDto(Long postId) { | ||
this.postId = postId; | ||
} | ||
|
||
public Long getPostId() { | ||
return postId; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
.../main/java/com/woowacourse/pickgit/post/application/dto/request/PostUpdateRequestDto.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,45 @@ | ||
package com.woowacourse.pickgit.post.application.dto.request; | ||
|
||
import com.woowacourse.pickgit.post.presentation.dto.request.PostUpdateRequest; | ||
import java.util.List; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public class PostUpdateRequestDto { | ||
|
||
private Long postId; | ||
private List<String> tags; | ||
private String content; | ||
|
||
private PostUpdateRequestDto() { | ||
} | ||
|
||
public PostUpdateRequestDto(Long postId, List<String> tags, String content) { | ||
this.postId = postId; | ||
this.tags = tags; | ||
this.content = content; | ||
} | ||
|
||
public static PostUpdateRequestDto toUpdateRequestDto( | ||
Long postId, | ||
PostUpdateRequest updateRequest | ||
) { | ||
return PostUpdateRequestDto.builder() | ||
.postId(postId) | ||
.tags(updateRequest.getTags()) | ||
.content(updateRequest.getContent()) | ||
.build(); | ||
} | ||
|
||
public Long getPostId() { | ||
return postId; | ||
} | ||
|
||
public List<String> getTags() { | ||
return tags; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ain/java/com/woowacourse/pickgit/post/application/dto/response/PostUpdateResponseDto.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,37 @@ | ||
package com.woowacourse.pickgit.post.application.dto.response; | ||
|
||
import com.woowacourse.pickgit.post.application.dto.request.PostUpdateRequestDto; | ||
import java.util.List; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public class PostUpdateResponseDto { | ||
|
||
private List<String> tags; | ||
private String content; | ||
|
||
private PostUpdateResponseDto() { | ||
} | ||
|
||
public PostUpdateResponseDto(List<String> tags, String content) { | ||
this.tags = tags; | ||
this.content = content; | ||
} | ||
|
||
public static PostUpdateResponseDto toPostUpdateResponseDto( | ||
PostUpdateRequestDto updateRequestDto) | ||
{ | ||
return PostUpdateResponseDto.builder() | ||
.content(updateRequestDto.getContent()) | ||
.tags(updateRequestDto.getTags()) | ||
.build(); | ||
} | ||
|
||
public List<String> getTags() { | ||
return tags; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...rc/main/java/com/woowacourse/pickgit/post/presentation/dto/request/PostUpdateRequest.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,32 @@ | ||
package com.woowacourse.pickgit.post.presentation.dto.request; | ||
|
||
import java.util.List; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Size; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public class PostUpdateRequest { | ||
|
||
private List<String> tags; | ||
|
||
@NotNull(message = "F0001") | ||
@Size(max = 500, message = "F0004") | ||
private String content; | ||
|
||
private PostUpdateRequest() { | ||
} | ||
|
||
public PostUpdateRequest(List<String> tags, String content) { | ||
this.tags = tags; | ||
this.content = content; | ||
} | ||
|
||
public List<String> getTags() { | ||
return tags; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
.../main/java/com/woowacourse/pickgit/post/presentation/dto/response/PostUpdateResponse.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 com.woowacourse.pickgit.post.presentation.dto.response; | ||
|
||
import com.woowacourse.pickgit.post.application.dto.response.PostUpdateResponseDto; | ||
import java.util.List; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public class PostUpdateResponse { | ||
|
||
private List<String> tags; | ||
private String content; | ||
|
||
private PostUpdateResponse() { | ||
} | ||
|
||
public PostUpdateResponse(List<String> tags, String content) { | ||
this.tags = tags; | ||
this.content = content; | ||
} | ||
|
||
public static PostUpdateResponse toPostUpdateResponse(PostUpdateResponseDto updateResponseDto) { | ||
return PostUpdateResponse.builder() | ||
.tags(updateResponseDto.getTags()) | ||
.content(updateResponseDto.getContent()) | ||
.build(); | ||
} | ||
|
||
public List<String> getTags() { | ||
return tags; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
} |
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