Skip to content

Commit

Permalink
fix: 스크립트 생성 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hong-sile committed Feb 23, 2024
1 parent c1323c5 commit fba4ab5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/gdsc/goodeat/domain/ScriptGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import static com.gdsc.goodeat.domain.Language.ENGLISH;
import static java.lang.System.lineSeparator;
import static java.util.stream.Collectors.joining;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.stereotype.Component;

@Component
Expand All @@ -27,8 +27,8 @@ public ScriptGenerator(final TranslationClient translationClient) {
private static String concatOrder(final List<OrderItem> orderItems) {
return orderItems.stream()
.map(orderItem -> String.format(ORDER_ITEM_FORMAT, orderItem.quantity(),
orderItem.originMenuName()))
.collect(Collectors.joining(lineSeparator()));
orderItem.userMenuName()))
.collect(joining(lineSeparator()));
}

/**
Expand All @@ -40,10 +40,10 @@ private static String concatOrder(final List<OrderItem> orderItems) {
public Script generate(
final Language sourceLanguage, final Language targetLanguage, final List<OrderItem> orderItems
) {
final String concatOrders = concatOrder(orderItems);

final String orderScriptPrefix = createOrderScriptPrefix(sourceLanguage);

final String concatOrders = concatOrder(orderItems);

final String userScript = orderScriptPrefix + lineSeparator() + concatOrders;
final String travelScript = translationClient.translate(
sourceLanguage, targetLanguage, userScript
Expand Down

0 comments on commit fba4ab5

Please sign in to comment.