diff --git a/src/service/WorldChat.go b/src/service/WorldChat.go_bak similarity index 100% rename from src/service/WorldChat.go rename to src/service/WorldChat.go_bak diff --git a/src/service/WorldChat_HighConcurrency.go_bak b/src/service/WorldChat_HighConcurrency.go similarity index 98% rename from src/service/WorldChat_HighConcurrency.go_bak rename to src/service/WorldChat_HighConcurrency.go index 4f760b1..bac943a 100644 --- a/src/service/WorldChat_HighConcurrency.go_bak +++ b/src/service/WorldChat_HighConcurrency.go @@ -1084,6 +1084,7 @@ func ExtractRating(response WorldEchoResponse) (int, error) { return 0, fmt.Errorf("未找到评分信息") } + func ExtractRating1(response WorldEchoResponse) string { endStr, ok := response.WObj["EndStr"].(string) @@ -1125,9 +1126,9 @@ func ParseEndStrAndReformat(response *WorldSoulReplyMsg) *WorldSoulReplyMsg { if ok { if endStr != "" { // 解析 "EndStr" 中的详细字段 - title := strings.Split(endStr, "@")[0] // 提取 '@' 前的标题 - overallScore := extractBetween(endStr, "【整体评分】:", "\n") // 提取整体评分 - objectiveEvaluation := extractToEnd(endStr, "【客观评价】:") // 提取客观评价至字符串末尾 + title := strings.Split(endStr, "@")[0] // 提取 '@' 前的标题 + overallScore := extractBetween(endStr, "【整体评分】:", "\n") // 提取整体评分 + objectiveEvaluation := extractBetween(endStr, "【客观评价】:", "## 【整体评分】") // 提取客观评价至字符串末尾 // 将 "EndStr" 结构化为 JSON 对象 endStrObj := map[string]interface{}{ @@ -1152,7 +1153,10 @@ func ParseEndStrAndReformat(response *WorldSoulReplyMsg) *WorldSoulReplyMsg { newResponse.WObj["emotion"] = emotion delete(newResponse.WObj, "表情") } - + if chatTime, exists := newResponse.WObj["时间"]; exists { + newResponse.WObj["time"] = chatTime + delete(newResponse.WObj, "时间") + } return &newResponse // 返回修改后的新响应体 }