-
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 #89 from tukcomCD2024/feat#87/search-voice
Feat#87/search voice
- Loading branch information
Showing
12 changed files
with
199 additions
and
10 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
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
21 changes: 21 additions & 0 deletions
21
...n/java/com/example/memetory/domain/voice/dto/response/ElevenlabsVoiceLibraryResponse.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,21 @@ | ||
package com.example.memetory.domain.voice.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ElevenlabsVoiceLibraryResponse { | ||
|
||
@JsonProperty("voices") | ||
private List<ElevenlabsVoiceResponse> voices; | ||
|
||
@JsonProperty("has_more") | ||
private boolean hasMore; | ||
|
||
@JsonProperty("last_sort_id") | ||
private String lastSortId; | ||
} |
19 changes: 19 additions & 0 deletions
19
...src/main/java/com/example/memetory/domain/voice/dto/response/ElevenlabsVoiceResponse.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,19 @@ | ||
package com.example.memetory.domain.voice.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ElevenlabsVoiceResponse { | ||
|
||
@JsonProperty("voice_id") | ||
private String elevenlabsVoiceId; | ||
|
||
@JsonProperty("name") | ||
private String name; | ||
|
||
@JsonProperty("description") | ||
private String description; | ||
} |
10 changes: 10 additions & 0 deletions
10
...ory/src/main/java/com/example/memetory/domain/voice/exception/NotFoundVoiceException.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 com.example.memetory.domain.voice.exception; | ||
|
||
import com.example.memetory.global.exception.BusinessException; | ||
import com.example.memetory.global.response.ErrorCode; | ||
|
||
public class NotFoundVoiceException extends BusinessException { | ||
public NotFoundVoiceException() { | ||
super(ErrorCode.VOICE_NOT_FOUND); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...tory/src/main/java/com/example/memetory/domain/voice/repository/VoiceQueryRepository.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.example.memetory.domain.voice.repository; | ||
|
||
import com.example.memetory.domain.voice.entity.Voice; | ||
|
||
import java.util.Optional; | ||
|
||
public interface VoiceQueryRepository { | ||
Optional<Voice> findByMemberId(Long memberId); | ||
} |
26 changes: 26 additions & 0 deletions
26
.../src/main/java/com/example/memetory/domain/voice/repository/VoiceQueryRepositoryImpl.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,26 @@ | ||
package com.example.memetory.domain.voice.repository; | ||
|
||
import com.example.memetory.domain.voice.entity.Voice; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
import static com.example.memetory.domain.member.entity.QMember.member; | ||
import static com.example.memetory.domain.voice.entity.QVoice.voice; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class VoiceQueryRepositoryImpl implements VoiceQueryRepository{ | ||
|
||
private final JPAQueryFactory jpaQueryFactory; | ||
|
||
@Override | ||
public Optional<Voice> findByMemberId(Long memberId) { | ||
return Optional.ofNullable(jpaQueryFactory.selectFrom(voice) | ||
.where(voice.member.id.eq(memberId)) | ||
.join(voice.member, member) | ||
.fetchOne()); | ||
} | ||
} |
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