Commit 3c009632 authored by 何金镒's avatar 何金镒

中文

parent a203daee
......@@ -30,6 +30,9 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.List;
......@@ -181,7 +184,7 @@ public class DifyControllerV2 {
@GetMapping("/chatSteamMessages")
public Flux<String> chatSteamMessages(@RequestParam(name = "query") String query,
@RequestHeader("sn") String sn){
@RequestHeader("sn") String sn) throws UnsupportedEncodingException {
log.info("【{}】:开始 流式 对话, query:{}",sn,query);
QueryWrapper<CDCToken> wrapper = new QueryWrapper<>();
......@@ -225,10 +228,14 @@ public class DifyControllerV2 {
inputs.set("communityId",userEntity.getCommunityId());
inputs.set("easId",userEntity.getEasId());
inputs.set("roomId",userEntity.getRoomInfo().getRoomId());
inputs.set("roomName",userEntity.getRoomInfo().getRoomId());
// inputs.set("roomName",userEntity.getRoomInfo().getRoomName());
inputs.set("roomName",URLEncoder.encode(userEntity.getRoomInfo().getRoomName(), StandardCharsets.UTF_8.name()));
inputs.set("buildingId",userEntity.getRoomInfo().getBuildingId());
inputs.set("userPhone",userEntity.getPhoneNum());
inputs.set("userName",userEntity.getPhoneNum());
// inputs.set("userName",userEntity.getPhoneNum());
inputs.set("userName",URLEncoder.encode(userEntity.getNickName(), StandardCharsets.UTF_8.name()));
inputs.set("today", DateUtil.today());
JSONObject body = new JSONObject();
......
......@@ -89,30 +89,31 @@ public class SpacesService {
Double price = 0.0;
//查详情-子空间-正常
String s1 = cdcHttpUtils.get(getSpacesRoomDetailUrl + id, sn);
JSONObject spacesRoomDetailJson = JSONUtil.parseObj(s1);
if(spacesRoomDetailJson.getInt("code") == 200){
JSONObject result = spacesRoomDetailJson.getJSONObject("data");
price = result.getDouble("price");
response_spaces.set("price",price);
if(result.containsKey("subspacePd") && StrUtil.isNotBlank(result.getStr("subspacePd"))){
JSONArray subspacePd = result.getJSONArray("subspacePd");//子空间
JSONArray child = new JSONArray();
for( int j = 0; j < subspacePd.size(); j++){
JSONObject jsonObject1 = subspacePd.getJSONObject(j);
String subspacePdName = jsonObject1.getStr("name");
String subspacePdId = jsonObject1.getStr("id");
JSONObject childJsonObject = new JSONObject();
childJsonObject.set("subspaceName", subspacePdName);
childJsonObject.set("subspaceId", subspacePdId);
child.set(childJsonObject);
}
response_spaces.set("subspaces", child);
}
}
// String s1 = cdcHttpUtils.get(getSpacesRoomDetailUrl + id, sn);
// JSONObject spacesRoomDetailJson = JSONUtil.parseObj(s1);
// if(spacesRoomDetailJson.getInt("code") == 200){
// JSONObject result = spacesRoomDetailJson.getJSONObject("data");
// if(result!=null){
// price = result.getDouble("price");
// response_spaces.set("price",price);
//
// if(result.containsKey("subspacePd") && StrUtil.isNotBlank(result.getStr("subspacePd"))){
// JSONArray subspacePd = result.getJSONArray("subspacePd");//子空间
// JSONArray child = new JSONArray();
// for( int j = 0; j < subspacePd.size(); j++){
// JSONObject jsonObject1 = subspacePd.getJSONObject(j);
// String subspacePdName = jsonObject1.getStr("name");
// String subspacePdId = jsonObject1.getStr("id");
//
// JSONObject childJsonObject = new JSONObject();
// childJsonObject.set("subspaceName", subspacePdName);
// childJsonObject.set("subspaceId", subspacePdId);
// child.set(childJsonObject);
// }
// response_spaces.set("subspaces", child);
// }
// }
// }
response.set(response_spaces);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment