-
Notifications
You must be signed in to change notification settings - Fork 0
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 #152 from lemonssoju/develop-v2
[develop-v2] main merge
- Loading branch information
Showing
12 changed files
with
117 additions
and
11 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/lesso/neverland/album/dto/AlbumByLocationDto.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,16 @@ | ||
package com.lesso.neverland.album.dto; | ||
|
||
import com.lesso.neverland.album.domain.Album; | ||
|
||
public record AlbumByLocationDto(Long albumIdx, | ||
String albumImage, | ||
String x, | ||
String y) { | ||
public static AlbumByLocationDto from(Album album) { | ||
return new AlbumByLocationDto( | ||
album.getAlbumIdx(), | ||
album.getAlbumImage(), | ||
album.getPuzzle().getLocation().getX(), | ||
album.getPuzzle().getLocation().getY()); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/lesso/neverland/album/dto/AlbumByTimeDto.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.lesso.neverland.album.dto; | ||
|
||
import com.lesso.neverland.album.domain.Album; | ||
|
||
import java.util.List; | ||
|
||
public record AlbumByTimeDto(Long albumIdx, | ||
String title, | ||
String content, | ||
String albumImage, | ||
String puzzleDate, | ||
Integer puzzlerCount, | ||
List<String> puzzlerImageList) { | ||
public static AlbumByTimeDto from(Album album) { | ||
return new AlbumByTimeDto( | ||
album.getAlbumIdx(), | ||
album.getPuzzle().getTitle(), | ||
album.getContent(), | ||
album.getAlbumImage(), | ||
album.getPuzzle().getPuzzleDate().toString(), | ||
album.getPuzzle().getPuzzleMembers().size(), | ||
album.getPuzzle().getPuzzleMembers().stream() | ||
.map(puzzleMember -> puzzleMember.getUser().getProfile().getProfileImage()).toList() | ||
); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/lesso/neverland/album/dto/AlbumListByLocationResponse.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,5 @@ | ||
package com.lesso.neverland.album.dto; | ||
|
||
import java.util.List; | ||
|
||
public record AlbumListByLocationResponse(List<AlbumByLocationDto> albumList) {} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/lesso/neverland/album/dto/AlbumListByTimeResponse.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,5 @@ | ||
package com.lesso.neverland.album.dto; | ||
|
||
import java.util.List; | ||
|
||
public record AlbumListByTimeResponse(List<AlbumByTimeDto> albumList) {} |
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
4 changes: 4 additions & 0 deletions
4
src/main/java/com/lesso/neverland/album/repository/AlbumRepository.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,7 +1,11 @@ | ||
package com.lesso.neverland.album.repository; | ||
|
||
import com.lesso.neverland.album.domain.Album; | ||
import com.lesso.neverland.group.domain.Team; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface AlbumRepository extends JpaRepository<Album, Long> { | ||
List<Album> findByTeamOrderByCreatedDateDesc(Team team); | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/lesso/neverland/puzzle/domain/PuzzleLocation.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,23 @@ | ||
package com.lesso.neverland.puzzle.domain; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Embeddable | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class PuzzleLocation { | ||
|
||
@Column(nullable = false) | ||
private String location; | ||
|
||
private String x; | ||
private String y; | ||
|
||
@Builder | ||
public PuzzleLocation(String location) {this.location = location;} | ||
} |