-
Notifications
You must be signed in to change notification settings - Fork 1
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
1b2f375
commit c70d7fd
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/com/example/reddiserver/dto/chatgpt/response/ChatGptCreationResultDto.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,12 +1,44 @@ | ||
package com.example.reddiserver.dto.chatgpt.response; | ||
|
||
import com.example.reddiserver.entity.Prompt; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
@Builder | ||
@Getter | ||
public class ChatGptCreationResultDto { | ||
private Map<String, String> result; | ||
|
||
public static ChatGptCreationResultDto from(Prompt prompt) { | ||
Map<String, String> result = new LinkedHashMap<>(); | ||
|
||
if (prompt.getName() != null) { | ||
result.put("name", prompt.getName()); | ||
} | ||
if (prompt.getReason() != null) { | ||
result.put("reason", prompt.getReason()); | ||
} | ||
if (prompt.getSlogan() != null) { | ||
result.put("slogan", prompt.getSlogan()); | ||
} | ||
if (prompt.getVision() != null) { | ||
result.put("vision", prompt.getVision()); | ||
} | ||
if (prompt.getEssence() != null) { | ||
result.put("essence", prompt.getEssence()); | ||
} | ||
if (prompt.getKeyword() != null) { | ||
result.put("keyword", prompt.getKeyword()); | ||
} | ||
if (prompt.getManifesto() != null) { | ||
result.put("manifesto", prompt.getManifesto()); | ||
} | ||
|
||
return ChatGptCreationResultDto.builder() | ||
.result(result) | ||
.build(); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/com/example/reddiserver/dto/chatgpt/response/ChatGptResultResponseDto.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,47 @@ | ||
package com.example.reddiserver.dto.chatgpt.response; | ||
|
||
import com.example.reddiserver.entity.Prompt; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Builder | ||
@Getter | ||
public class ChatGptResultResponseDto { | ||
private Long id; | ||
private String name; | ||
private List<String> elements; | ||
|
||
public static ChatGptResultResponseDto from(Prompt prompt) { | ||
List<String> elements = new ArrayList<>(); | ||
|
||
if (prompt.getName() != null) { | ||
elements.add("네이밍"); | ||
} | ||
if (prompt.getSlogan() != null) { | ||
elements.add("슬로건"); | ||
} | ||
if (prompt.getVision() != null) { | ||
elements.add("비전 미션"); | ||
} | ||
if (prompt.getEssence() != null) { | ||
elements.add("브랜드 에센스"); | ||
} | ||
if (prompt.getKeyword() != null) { | ||
elements.add("키워드"); | ||
} | ||
if (prompt.getManifesto() != null) { | ||
elements.add("메니페스토"); | ||
} | ||
|
||
return ChatGptResultResponseDto.builder() | ||
.id(prompt.getId()) | ||
.name(prompt.getName()) | ||
.elements(elements) | ||
.build(); | ||
} | ||
} |