Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
WorldEpcho
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ford
WorldEpcho
Commits
19dc6853
Commit
19dc6853
authored
7 months ago
by
Ford
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了WorldChat支持高并发,加了协程。
parent
03e12793
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/service/WorldChat.go_bak
+0
-0
src/service/WorldChat_HighConcurrency.go
+6
-2
No files found.
src/service/WorldChat.go
→
src/service/WorldChat.go
_bak
View file @
19dc6853
File moved
This diff is collapsed.
Click to expand it.
src/service/WorldChat_HighConcurrency.go
_bak
→
src/service/WorldChat_HighConcurrency.go
View file @
19dc6853
...
...
@@ -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
)
...
...
@@ -1127,7 +1128,7 @@ func ParseEndStrAndReformat(response *WorldSoulReplyMsg) *WorldSoulReplyMsg {
// 解析 "EndStr" 中的详细字段
title
:=
strings
.
Split
(
endStr
,
"@"
)[
0
]
// 提取 '@' 前的标题
overallScore
:=
extractBetween
(
endStr
,
"【整体评分】:"
,
"
\n
"
)
// 提取整体评分
objectiveEvaluation
:=
extract
ToEnd
(
endStr
,
"【客观评价】:"
)
//
提取客观评价至字符串末尾
objectiveEvaluation
:=
extract
Between
(
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
// 返回修改后的新响应体
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment