-
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 #43 from tukcomCD2024/SNOW-110-feat#42/generate-an…
…d-get-meme Snow 110 feat#42/generate and get meme
- Loading branch information
Showing
14 changed files
with
279 additions
and
4 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
26 changes: 26 additions & 0 deletions
26
backend/memetory/src/main/java/com/example/memetory/domain/meme/dto/AIServerSendDto.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.meme.dto; | ||
|
||
import java.util.List; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AIServerSendDto { | ||
@SerializedName("member_id") | ||
private String memberId; | ||
@SerializedName("scene") | ||
private List<GenerateMemeDto> scene; | ||
|
||
@Builder | ||
public AIServerSendDto(Long memberId, List<GenerateMemeDto> scene) { | ||
this.memberId = String.valueOf(memberId); | ||
this.scene = scene; | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
backend/memetory/src/main/java/com/example/memetory/domain/meme/dto/GenerateMemeDto.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,18 @@ | ||
package com.example.memetory.domain.meme.dto; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class GenerateMemeDto { | ||
@SerializedName("source_image") | ||
private String sourceImage; | ||
@SerializedName("target_image") | ||
private String targetImage; | ||
@SerializedName("text") | ||
private String text; | ||
} |
20 changes: 20 additions & 0 deletions
20
.../memetory/src/main/java/com/example/memetory/domain/meme/dto/GenerateMemeListRequest.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,20 @@ | ||
package com.example.memetory.domain.meme.dto; | ||
|
||
import java.util.List; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class GenerateMemeListRequest { | ||
private List<GenerateMemeDto> scene; | ||
|
||
public MemeServiceDto toServiceDto(String email) { | ||
return MemeServiceDto.builder() | ||
.email(email) | ||
.scene(scene) | ||
.build(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
backend/memetory/src/main/java/com/example/memetory/domain/meme/dto/MemeListResponse.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.meme.dto; | ||
|
||
import java.util.List; | ||
|
||
import com.example.memetory.domain.meme.entity.Meme; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class MemeListResponse { | ||
private List<MemeResponse> memeList; | ||
|
||
@Builder | ||
public MemeListResponse(List<MemeResponse> memeList) { | ||
this.memeList = memeList; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
backend/memetory/src/main/java/com/example/memetory/domain/meme/dto/MemeResponse.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,36 @@ | ||
package com.example.memetory.domain.meme.dto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import com.example.memetory.domain.meme.entity.Meme; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class MemeResponse { | ||
private Long memeId; | ||
private String s3Url; | ||
private LocalDateTime createAt; | ||
private LocalDateTime updateAt; | ||
|
||
@Builder | ||
public MemeResponse(Long memeId, String s3Url, LocalDateTime createAt, LocalDateTime updateAt) { | ||
this.memeId = memeId; | ||
this.s3Url = s3Url; | ||
this.createAt = createAt; | ||
this.updateAt = updateAt; | ||
} | ||
|
||
public static MemeResponse of(Meme meme) { | ||
return MemeResponse.builder() | ||
.memeId(meme.getId()) | ||
.s3Url(meme.getS3Url()) | ||
.createAt(meme.getCreatedAt()) | ||
.updateAt(meme.getUpdatedAt()) | ||
.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
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
14 changes: 14 additions & 0 deletions
14
...etory/src/main/java/com/example/memetory/domain/meme/exception/NotFoundMemeException.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,14 @@ | ||
package com.example.memetory.domain.meme.exception; | ||
|
||
public class NotFoundMemeException extends RuntimeException{ | ||
public NotFoundMemeException() { | ||
} | ||
|
||
public NotFoundMemeException(String message) { | ||
super(message); | ||
} | ||
|
||
public NotFoundMemeException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...nd/memetory/src/main/java/com/example/memetory/domain/meme/repository/MemeRepository.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,8 +1,12 @@ | ||
package com.example.memetory.domain.meme.repository; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.example.memetory.domain.member.entity.Member; | ||
import com.example.memetory.domain.meme.entity.Meme; | ||
|
||
public interface MemeRepository extends JpaRepository<Meme, Long> { | ||
List<Meme> findAllByMember(Member member); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,6 @@ spring: | |
port: 6379 | ||
refreshToken: | ||
expiration: 1209600 | ||
|
||
ai-server: | ||
url: "http://localhost:5001/files" |