-
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 remote-tracking branch 'origin/main'
- Loading branch information
Showing
70 changed files
with
2,159 additions
and
568 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
41 changes: 41 additions & 0 deletions
41
...src/main/java/com/hallyugo/hallyugo/content/domain/response/ContentForMapResponseDto.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,41 @@ | ||
package com.hallyugo.hallyugo.content.domain.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.hallyugo.hallyugo.content.domain.Category; | ||
import com.hallyugo.hallyugo.content.domain.Content; | ||
import com.hallyugo.hallyugo.location.domain.response.LocationWithImagesResponseDto; | ||
import java.util.List; | ||
import lombok.Getter; | ||
|
||
public class ContentForMapResponseDto { | ||
|
||
@JsonProperty | ||
private Long id; | ||
|
||
@JsonProperty | ||
private Category category; | ||
|
||
@JsonProperty | ||
private String title; | ||
|
||
@JsonProperty | ||
private String hashtag; | ||
|
||
@JsonProperty | ||
@Getter | ||
private List<LocationWithImagesResponseDto> locations; | ||
|
||
private ContentForMapResponseDto(Content content, List<LocationWithImagesResponseDto> locations) { | ||
this.id = content.getId(); | ||
this.category = content.getCategory(); | ||
this.title = content.getTitle(); | ||
this.hashtag = content.getHashtag(); | ||
this.locations = locations; | ||
} | ||
|
||
public static ContentForMapResponseDto toDto(Content content, | ||
List<LocationWithImagesResponseDto> locationWithImages) { | ||
return new ContentForMapResponseDto(content, locationWithImages); | ||
} | ||
|
||
} |
4 changes: 3 additions & 1 deletion
4
...go/content/domain/ContentResponseDto.java → ...t/domain/response/ContentResponseDto.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
6 changes: 0 additions & 6 deletions
6
backend/src/main/java/com/hallyugo/hallyugo/favorite/domain/EntityType.java
This file was deleted.
Oops, something went wrong.
4 changes: 1 addition & 3 deletions
4
...nd/src/main/java/com/hallyugo/hallyugo/favorite/domain/response/FavoriteResponseItem.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
7 changes: 5 additions & 2 deletions
7
backend/src/main/java/com/hallyugo/hallyugo/favorite/repository/FavoriteRepository.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,10 +1,13 @@ | ||
package com.hallyugo.hallyugo.favorite.repository; | ||
|
||
import com.hallyugo.hallyugo.favorite.domain.Favorite; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface FavoriteRepository extends JpaRepository<Favorite, Long> { | ||
List<Favorite> findByUserId(Long userId); | ||
|
||
boolean existsByUserIdAndLocationId(Long userId, Long locationId); | ||
|
||
void deleteByUserIdAndLocationId(Long userId, Long locationId); | ||
} |
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
52 changes: 52 additions & 0 deletions
52
backend/src/main/java/com/hallyugo/hallyugo/image/domain/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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.hallyugo.hallyugo.image.domain.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.hallyugo.hallyugo.image.domain.Image; | ||
import java.time.LocalDateTime; | ||
import java.util.Objects; | ||
|
||
public class ImageResponseDto { | ||
|
||
@JsonProperty | ||
private Long id; | ||
|
||
@JsonProperty("image_url") | ||
private String imageUrl; | ||
|
||
@JsonProperty | ||
private String description; | ||
|
||
@JsonProperty("created_at") | ||
private LocalDateTime createdAt; | ||
|
||
private ImageResponseDto(Image image) { | ||
this.id = image.getId(); | ||
this.imageUrl = image.getImageUrl(); | ||
this.description = image.getDescription(); | ||
this.createdAt = image.getCreatedAt(); | ||
} | ||
|
||
public static ImageResponseDto toDto(Image image) { | ||
return new ImageResponseDto(image); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null || getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
|
||
ImageResponseDto that = (ImageResponseDto) obj; | ||
|
||
return Objects.equals(id, that.id); | ||
} | ||
|
||
} |
Oops, something went wrong.