Skip to content

Commit 095c400

Browse files
authored
Merge pull request #91 from TU-NEBULA/feature/SCRUM-198
SCRUM-198: 새 채팅 생성 쿼리 파라미터로 변경
2 parents 808d2ba + 82df332 commit 095c400

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/main/java/com/team_nebula/nebula/domain/chatbot/service/ChatbotServiceImpl.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.Optional;
88

99
import org.springframework.beans.factory.annotation.Value;
10-
import org.springframework.http.HttpEntity;
1110
import org.springframework.http.HttpHeaders;
1211
import org.springframework.http.MediaType;
1312
import org.springframework.stereotype.Service;
@@ -42,18 +41,12 @@ public class ChatbotServiceImpl implements ChatbotService {
4241
@Override
4342
public SessionResponseDTO createSession(Long userId, SessionRequestDTO request) {
4443
try {
45-
String url = aiChatUrl + "/chat/sessions?user_id=" + userId;
46-
47-
HttpHeaders headers = new HttpHeaders();
48-
headers.setContentType(MediaType.APPLICATION_JSON);
49-
50-
Map<String, Object> requestBody = Map.of("title", request.getTitle());
51-
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers);
44+
String url = aiChatUrl + "/chat/sessions?user_id=" + userId + "&title=" + request.getTitle();
5245

5346
String response = webClient.post()
5447
.uri(url)
5548
.contentType(MediaType.APPLICATION_JSON)
56-
.bodyValue(requestBody)
49+
.body(null)
5750
.retrieve()
5851
.bodyToMono(String.class)
5952
.block();

0 commit comments

Comments
 (0)