-
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.
Merge branch 'develop' into feature/140
- Loading branch information
Showing
20 changed files
with
510 additions
and
110 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
12 changes: 11 additions & 1 deletion
12
src/main/java/io/oduck/api/domain/attractionPoint/dto/AttractionPointReqDto.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,25 +1,35 @@ | ||
package io.oduck.api.domain.attractionPoint.dto; | ||
|
||
import io.oduck.api.domain.attractionPoint.entity.AttractionElement; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class AttractionPointReqDto { | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public static class AttractionPointReq{ | ||
private Long animeId; | ||
@NotNull(message = "입덕포인트를 선택하세요.") | ||
List<AttractionElement> attractionElements; | ||
} | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class UpdateAttractionPoint{ | ||
@NotNull(message = "입덕포인트를 선택하세요.") | ||
AttractionElement attractionElement; | ||
} | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
.../java/io/oduck/api/domain/attractionPoint/repository/AttractionPointRepositoryCustom.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,10 @@ | ||
package io.oduck.api.domain.attractionPoint.repository; | ||
|
||
import io.oduck.api.domain.attractionPoint.entity.AttractionElement; | ||
import io.oduck.api.domain.member.dto.MemberDslDto.ProfileWithoutActivity; | ||
|
||
import java.util.Optional; | ||
|
||
public interface AttractionPointRepositoryCustom { | ||
Long countElementByAnimeId(AttractionElement attractionElement, Long animeId); | ||
} |
29 changes: 29 additions & 0 deletions
29
...in/java/io/oduck/api/domain/attractionPoint/repository/AttractionPointRepositoryImpl.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 io.oduck.api.domain.attractionPoint.repository; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import io.oduck.api.domain.attractionPoint.entity.AttractionElement; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import static io.oduck.api.domain.attractionPoint.entity.QAttractionPoint.attractionPoint; | ||
|
||
|
||
@Slf4j | ||
@Repository | ||
@RequiredArgsConstructor | ||
class AttractionPointRepositoryImpl implements AttractionPointRepositoryCustom { | ||
private final JPAQueryFactory query; | ||
|
||
@Override | ||
public Long countElementByAnimeId(AttractionElement attractionElement, Long animeId) { | ||
Long elementCount = query | ||
.select(attractionPoint.attractionElement.count()) | ||
.from(attractionPoint) | ||
.where(attractionPoint.attractionElement.eq(attractionElement) | ||
.and(attractionPoint.anime.id.eq(animeId))) | ||
.fetchOne(); | ||
return elementCount; | ||
} | ||
|
||
} |
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.