-
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 #104 from WOONGEYA/refactor
Refactor
- Loading branch information
Showing
24 changed files
with
201 additions
and
254 deletions.
There are no files selected for viewing
17 changes: 6 additions & 11 deletions
17
src/main/java/com/woongeya/zoing/domain/like/presentation/dto/response/LikerResponseDto.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,15 +1,10 @@ | ||
package com.woongeya.zoing.domain.like.presentation.dto.response; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class LikerResponseDto { | ||
|
||
private Long id; | ||
private String name; | ||
|
||
public LikerResponseDto(Long id, String name) { | ||
this.id = id; | ||
this.name = name; | ||
public record LikerResponseDto ( | ||
Long id, | ||
String name | ||
) { | ||
public static LikerResponseDto of(Long id, String name) { | ||
return new LikerResponseDto(id, name); | ||
} | ||
} |
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
24 changes: 11 additions & 13 deletions
24
.../java/com/woongeya/zoing/domain/notice/presetation/dto/response/NotificationResponse.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
33 changes: 15 additions & 18 deletions
33
src/main/java/com/woongeya/zoing/domain/post/presetation/dto/response/PostResponse.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
18 changes: 5 additions & 13 deletions
18
src/main/java/com/woongeya/zoing/domain/post/presetation/dto/response/PostResponseList.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,19 +1,11 @@ | ||
package com.woongeya.zoing.domain.post.presetation.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class PostResponseList { | ||
|
||
private List<PostResponse> postResponses; | ||
|
||
public static PostResponseList of(List<PostResponse> postResponses) { | ||
return PostResponseList.builder() | ||
.postResponses(postResponses) | ||
.build(); | ||
public record PostResponseList( | ||
List<PostResponse> postResponses | ||
) { | ||
public static PostResponseList from(List<PostResponse> postResponses) { | ||
return new PostResponseList(postResponses); | ||
} | ||
} |
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
56 changes: 27 additions & 29 deletions
56
...va/com/woongeya/zoing/domain/project/presetation/dto/request/CreateProjectRequestDto.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,37 +1,35 @@ | ||
package com.woongeya.zoing.domain.project.presetation.dto.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class CreateProjectRequestDto { | ||
|
||
@NotNull | ||
private String name; | ||
|
||
@NotNull | ||
private String content; | ||
|
||
@NotNull | ||
private Integer requiredPeople; | ||
import com.woongeya.zoing.domain.project.domain.Project; | ||
import com.woongeya.zoing.domain.project.domain.type.ProjectState; | ||
|
||
@NotNull | ||
private LocalDate endDate; | ||
|
||
private String imgUrl; | ||
|
||
private List<String> skills; | ||
|
||
private List<String> coops; | ||
|
||
private List<String> moods; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Getter; | ||
|
||
private List<String> positions; | ||
public record CreateProjectRequestDto ( | ||
@NotNull String name, | ||
@NotNull String content, | ||
@NotNull Integer requiredPeople, | ||
@NotNull LocalDate endDate, | ||
String imgUrl, | ||
List<String> skills, | ||
List<String> coops, | ||
List<String> moods, | ||
List<String> positions | ||
) { | ||
|
||
public Project toEntity() { | ||
return Project.builder() | ||
.name(name) | ||
.content(content) | ||
.requiredPeople(requiredPeople) | ||
.endDate(endDate) | ||
.imgUrl(imgUrl) | ||
.currentPeople(1) | ||
.state(ProjectState.FINDING) | ||
.build(); | ||
} | ||
} |
13 changes: 3 additions & 10 deletions
13
...main/java/com/woongeya/zoing/domain/project/presetation/dto/request/MemberRequestDto.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,13 +1,6 @@ | ||
package com.woongeya.zoing.domain.project.presetation.dto.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class MemberRequestDto { | ||
|
||
private Long memberId; | ||
public record MemberRequestDto ( | ||
Long memberId | ||
) { | ||
} |
14 changes: 5 additions & 9 deletions
14
...ain/java/com/woongeya/zoing/domain/project/presetation/dto/response/ImageResponseDto.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,13 +1,9 @@ | ||
package com.woongeya.zoing.domain.project.presetation.dto.response; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ImageResponseDto { | ||
|
||
private String imgUrl; | ||
|
||
public ImageResponseDto(String imgUrl) { | ||
this.imgUrl = imgUrl; | ||
public record ImageResponseDto ( | ||
String imgUrl | ||
){ | ||
public static ImageResponseDto from(String imgUrl) { | ||
return new ImageResponseDto(imgUrl); | ||
} | ||
} |
24 changes: 7 additions & 17 deletions
24
...in/java/com/woongeya/zoing/domain/project/presetation/dto/response/MemberResponseDto.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,23 +1,13 @@ | ||
package com.woongeya.zoing.domain.project.presetation.dto.response; | ||
|
||
import com.woongeya.zoing.domain.project.domain.Member; | ||
import com.woongeya.zoing.domain.user.domain.User; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class MemberResponseDto { | ||
|
||
private Long userId; | ||
private String name; | ||
private String imgUrl; | ||
|
||
public static MemberResponseDto of(User user) { | ||
return MemberResponseDto.builder() | ||
.userId(user.getId()) | ||
.name(user.getName()) | ||
.imgUrl(user.getImgUrl()) | ||
.build(); | ||
public record MemberResponseDto ( | ||
Long userId, | ||
String name, | ||
String imgUrl | ||
){ | ||
public static MemberResponseDto from(User user) { | ||
return new MemberResponseDto(user.getId(), user.getName(), user.getImgUrl()); | ||
} | ||
} |
Oops, something went wrong.