-
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 #193 from Team-Smeme/sohyeon_#192
[FIX] 뱃지 전체 조회 수정
- Loading branch information
Showing
8 changed files
with
134 additions
and
29 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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/smeme/server/repository/badge/BadgeCustomRepository.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,9 @@ | ||
package com.smeme.server.repository.badge; | ||
|
||
import com.smeme.server.model.badge.Badge; | ||
|
||
import java.util.List; | ||
|
||
public interface BadgeCustomRepository { | ||
List<Badge> findAllOrderById(); | ||
} |
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: 24 additions & 0 deletions
24
src/main/java/com/smeme/server/repository/badge/BadgeRepositoryImpl.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,24 @@ | ||
package com.smeme.server.repository.badge; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import com.smeme.server.model.badge.Badge; | ||
import lombok.*; | ||
import org.springframework.stereotype.Repository; | ||
import java.util.List; | ||
|
||
import static com.smeme.server.model.badge.QBadge.badge; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class BadgeRepositoryImpl implements BadgeCustomRepository { | ||
|
||
private final JPAQueryFactory queryFactory; | ||
|
||
@Override | ||
public List<Badge> findAllOrderById() { | ||
return queryFactory | ||
.selectFrom(badge) | ||
.orderBy(badge.id.asc()) | ||
.fetch(); | ||
} | ||
} |
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