File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
src/main/java/com/team_nebula/nebula/domain/chatbot/service Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 7
7
import java .util .Optional ;
8
8
9
9
import org .springframework .beans .factory .annotation .Value ;
10
- import org .springframework .http .HttpEntity ;
11
10
import org .springframework .http .HttpHeaders ;
12
11
import org .springframework .http .MediaType ;
13
12
import org .springframework .stereotype .Service ;
@@ -42,18 +41,12 @@ public class ChatbotServiceImpl implements ChatbotService {
42
41
@ Override
43
42
public SessionResponseDTO createSession (Long userId , SessionRequestDTO request ) {
44
43
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 ();
52
45
53
46
String response = webClient .post ()
54
47
.uri (url )
55
48
.contentType (MediaType .APPLICATION_JSON )
56
- .bodyValue ( requestBody )
49
+ .body ( null )
57
50
.retrieve ()
58
51
.bodyToMono (String .class )
59
52
.block ();
You can’t perform that action at this time.
0 commit comments