-
Notifications
You must be signed in to change notification settings - Fork 3
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 #105 from WOONGEYA/refactor
Refactor
- Loading branch information
Showing
16 changed files
with
131 additions
and
127 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
32 changes: 21 additions & 11 deletions
32
...m/woongeya/zoing/domain/application/presetation/dto/request/ApplicationCreateRequest.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,17 +1,27 @@ | ||
package com.woongeya.zoing.domain.application.presetation.dto.request; | ||
|
||
import lombok.Getter; | ||
import com.woongeya.zoing.domain.application.domain.Application; | ||
import com.woongeya.zoing.domain.application.domain.type.ApplicationState; | ||
import com.woongeya.zoing.domain.project.domain.Project; | ||
import com.woongeya.zoing.domain.user.domain.User; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
|
||
@Getter | ||
public class ApplicationCreateRequest { | ||
|
||
private String introduce; | ||
|
||
@NotNull | ||
private String position; | ||
|
||
@NotNull | ||
private String phone; | ||
public record ApplicationCreateRequest ( | ||
@NotNull | ||
String position, | ||
@NotNull | ||
String phone, | ||
String introduce | ||
) { | ||
public Application toEntity(User user, Project project) { | ||
return Application.builder() | ||
.userId(user.getId()) | ||
.projectId(project.getId()) | ||
.introduce(introduce) | ||
.phone(phone) | ||
.state(ApplicationState.PENDING) | ||
.position(position) | ||
.build(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...a/com/woongeya/zoing/domain/application/presetation/dto/response/ApplicationResponse.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,29 @@ | ||
package com.woongeya.zoing.domain.application.presetation.dto.response; | ||
|
||
import com.woongeya.zoing.domain.application.domain.Application; | ||
import com.woongeya.zoing.domain.user.domain.User; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record ApplicationResponse ( | ||
Long id, | ||
String introduce, | ||
Long userId, | ||
String userName, | ||
String userImg, | ||
String phone, | ||
String position | ||
) { | ||
public static ApplicationResponse of(Application application, User user) { | ||
return ApplicationResponse.builder() | ||
.id(application.getId()) | ||
.introduce(application.getIntroduce()) | ||
.userId(user.getId()) | ||
.userName(user.getName()) | ||
.userImg(user.getImgUrl()) | ||
.phone(application.getPhone()) | ||
.position(application.getPosition()) | ||
.build(); | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
...om/woongeya/zoing/domain/application/presetation/dto/response/ApplicationResponseDto.java
This file was deleted.
Oops, something went wrong.
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
14 changes: 4 additions & 10 deletions
14
src/main/java/com/woongeya/zoing/domain/auth/presetation/dto/response/TokenResponse.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,12 +1,6 @@ | ||
package com.woongeya.zoing.domain.auth.presetation.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class TokenResponse { | ||
|
||
private String token; | ||
private String validate; | ||
} | ||
public record TokenResponse ( | ||
String token, | ||
String validate | ||
) {} |
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
18 changes: 9 additions & 9 deletions
18
.../java/com/woongeya/zoing/domain/comment/presetation/dto/request/CreateCommentRequest.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,16 +1,16 @@ | ||
package com.woongeya.zoing.domain.comment.presetation.dto.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import com.woongeya.zoing.domain.comment.domain.Comment; | ||
import com.woongeya.zoing.domain.user.domain.User; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class CreateCommentRequest { | ||
|
||
public record CreateCommentRequest ( | ||
@NotNull | ||
private String content; | ||
String content | ||
) { | ||
|
||
public Comment toEntity(Long postId, User user) { | ||
return new Comment(content, postId, user.getId()); | ||
} | ||
} |
26 changes: 12 additions & 14 deletions
26
...main/java/com/woongeya/zoing/domain/comment/presetation/dto/response/CommentResponse.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
Oops, something went wrong.