forked from Me1tingPot/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.
Merge branch 'develop' of https://github.com/Me1tingPot/BE into develop
- Loading branch information
Showing
5 changed files
with
41 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
4 changes: 4 additions & 0 deletions
4
src/main/java/meltingpot/server/domain/repository/party/PartyParticipantRepository.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 meltingpot.server.domain.repository.party; | ||
|
||
import meltingpot.server.domain.entity.Account; | ||
import meltingpot.server.domain.entity.party.PartyParticipant; | ||
import meltingpot.server.domain.entity.party.enums.ParticipantStatus; | ||
import meltingpot.server.domain.entity.party.enums.PartyStatus; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface PartyParticipantRepository extends JpaRepository<PartyParticipant, Long> { | ||
int countByParty_PartyStatusAndParticipantStatusAndAccount(PartyStatus partyStatus, ParticipantStatus participantStatus, Account account); | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/meltingpot/server/party/dto/PartyOwnerResponse.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,32 @@ | ||
package meltingpot.server.party.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Setter; | ||
import meltingpot.server.domain.entity.Account; | ||
import meltingpot.server.domain.entity.AccountProfileImage; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record PartyOwnerResponse( | ||
String name, | ||
String introduction, | ||
String nationality, | ||
String country, | ||
String language, | ||
String city, | ||
List<String> profileImages, | ||
int partyParticipantCount, | ||
int partyCreationCount | ||
) { | ||
public static PartyOwnerResponse of(Account account) { | ||
return PartyOwnerResponse.builder() | ||
.name(account.getName()) | ||
.nationality(account.getNationality()) | ||
.country(account.getCountry()) | ||
.language(account.getLanguage()) | ||
.city(account.getCity()) | ||
.profileImages(account.getProfileImages().stream().map(AccountProfileImage::getImageKey).toList()) | ||
.build(); | ||
} | ||
} |
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