forked from 9oormthon-univ/2024_DANPOONG_TEAM_5_BE
-
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.
- Loading branch information
1 parent
2ffe327
commit e82f58c
Showing
6 changed files
with
78 additions
and
3 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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/jangburich/domain/team/domain/repository/TeamRepository.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,9 +1,17 @@ | ||
package com.jangburich.domain.team.domain.repository; | ||
|
||
import com.jangburich.domain.common.Status; | ||
import com.jangburich.domain.team.domain.Team; | ||
import com.jangburich.domain.user.domain.User; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface TeamRepository extends JpaRepository<Team, Long> { | ||
Optional<Team> findBySecretCode(String joinCode); | ||
|
||
@Query("SELECT t FROM Team t JOIN UserTeam ut ON ut.team = t WHERE ut.user = :user AND t.status = :status") | ||
Optional<List<Team>> findAllByUserAndStatus(@Param("user") User user, @Param("status") Status status); | ||
} |
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
13 changes: 13 additions & 0 deletions
13
src/main/java/com/jangburich/domain/team/dto/response/MyTeamResponse.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,13 @@ | ||
package com.jangburich.domain.team.dto.response; | ||
|
||
import java.util.List; | ||
|
||
public record MyTeamResponse( | ||
String teamName, | ||
String teamType, | ||
Boolean isLiked, | ||
int peopleCount, | ||
Boolean isMeLeader, | ||
List<String> profileImageUrl | ||
) { | ||
} |
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