-
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.
- Loading branch information
Marc Gorzala
committed
Dec 17, 2023
1 parent
e072872
commit 8e7426b
Showing
8 changed files
with
130 additions
and
60 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
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
54 changes: 54 additions & 0 deletions
54
src/main/java/net/dancier/dancer/core/dto/PublicProfileDto.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,54 @@ | ||
package net.dancier.dancer.core.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import lombok.Data; | ||
import net.dancier.dancer.authentication.model.User; | ||
import net.dancier.dancer.core.model.Dancer; | ||
import net.dancier.dancer.core.model.Gender; | ||
|
||
import java.util.Date; | ||
import java.util.Set; | ||
import java.util.UUID; | ||
|
||
@Data | ||
public class PublicProfileDto { | ||
|
||
public static PublicProfileDto of(Dancer dancer) { | ||
PublicProfileDto publicProfileDto = new PublicProfileDto(); | ||
publicProfileDto.setId(dancer.getId()); | ||
publicProfileDto.setSize(dancer.getSize()); | ||
publicProfileDto.setGender(dancer.getGender()); | ||
publicProfileDto.setDancerName(dancer.getDancerName()); | ||
publicProfileDto.setBirthDate(dancer.getBirthDate()); | ||
//publicProfileDto.setAbleTo(dancer.getAbleTo()); | ||
//publicProfileDto.setWantsTo(dancer.getWantsTo()); | ||
publicProfileDto.setCity(dancer.getCity()); | ||
//publicProfileDto.setCountry(dancer.getCountry()); | ||
publicProfileDto.setProfileImageHash(dancer.getProfileImageHash()); | ||
publicProfileDto.setAboutMe(dancer.getAboutMe()); | ||
return publicProfileDto; | ||
} | ||
|
||
private UUID id; | ||
|
||
private Integer size; | ||
|
||
private Gender gender; | ||
|
||
private String dancerName; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") | ||
private Date birthDate; | ||
|
||
private Set<DanceProfileDto> ableTo; | ||
|
||
private Set<DanceProfileDto> wantsTo; | ||
|
||
private String city; | ||
|
||
private String country; | ||
|
||
private String profileImageHash; | ||
|
||
private String aboutMe; | ||
} |
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
12 changes: 6 additions & 6 deletions
12
src/test/java/net/dancier/dancer/core/ProfileTestFactory.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,15 @@ | ||
package net.dancier.dancer.core; | ||
|
||
import net.dancier.dancer.core.dto.ProfileDto; | ||
import net.dancier.dancer.core.dto.ProfileOfCurrentUserDto; | ||
|
||
import java.util.Set; | ||
|
||
public class ProfileTestFactory { | ||
|
||
public static ProfileDto profileDto() { | ||
ProfileDto profileDto = new ProfileDto(); | ||
profileDto.setWantsTo(Set.of()); | ||
profileDto.setAbleTo(Set.of()); | ||
return profileDto; | ||
public static ProfileOfCurrentUserDto profileDto() { | ||
ProfileOfCurrentUserDto profileOfCurrentUserDto = new ProfileOfCurrentUserDto(); | ||
profileOfCurrentUserDto.setWantsTo(Set.of()); | ||
profileOfCurrentUserDto.setAbleTo(Set.of()); | ||
return profileOfCurrentUserDto; | ||
} | ||
} |