Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: 동화생성 이미지 null 오류 해결 #51

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private Tale findTale(Long taleId) {

private Tale createTale(TaleCreateCommand taleCreateCommand) {
Member member = findMember(taleCreateCommand.getMemberId());
CreatedTale createdTale = createEnglishTale(taleCreateCommand);
CreatedTale createdTale = createTaleByLLM(taleCreateCommand);
return Tale.builder()
.title(createdTale.getTitle())
.engTale(createdTale.getEngTale())
Expand All @@ -91,7 +91,7 @@ private Member findMember(Long memberId) {
.orElseThrow(() -> new NotFoundException(ErrorCode.MEMBER_NOT_FOUND, memberId));
}

private CreatedTale createEnglishTale(TaleCreateCommand taleCreateCommand) {
private CreatedTale createTaleByLLM(TaleCreateCommand taleCreateCommand) {
verifyInputKeywords(taleCreateCommand);
return taleManageService.post(taleCreateCommand.getModel(), taleCreateCommand.getKeywords());
}
Expand All @@ -102,7 +102,7 @@ private void verifyInputKeywords(TaleCreateCommand taleCreateCommand) {
}

private TaleCreateResponse saveTaleAndKeywords(Tale tale, List<Keyword> keywords, MultipartFile image) {
if (!image.isEmpty()) {
if (image != null) {
tale.putImage(createAndSaveTaleImage(image));
}
saveTaleKeywords(tale, keywords);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TaleController {

@PostMapping("create")
public TaleCreateResponse create(@Validated @RequestPart TaleCreateDto taleCreateDto,
@RequestPart MultipartFile image) {
@RequestPart(required = false) MultipartFile image) {
return taleCommandService.create(toCreateCommand(taleCreateDto, image));
}

Expand Down