Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qwgame
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵国君
qwgame
Commits
b8c7ebf6
Commit
b8c7ebf6
authored
Apr 18, 2019
by
hxw2303632
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log code
parent
3de0160c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
GetAnswerServlet.java
...ava/com/qiwu/chatbotbackend/servlet/GetAnswerServlet.java
+14
-0
No files found.
src/main/java/com/qiwu/chatbotbackend/servlet/GetAnswerServlet.java
View file @
b8c7ebf6
...
@@ -72,6 +72,7 @@ public class GetAnswerServlet extends HttpServlet {
...
@@ -72,6 +72,7 @@ public class GetAnswerServlet extends HttpServlet {
UserInfo
userinfo
=
null
;
UserInfo
userinfo
=
null
;
UserInfoController
uiController
=
new
UserInfoController
();
UserInfoController
uiController
=
new
UserInfoController
();
logWriter
.
record
(
"query bot config"
,
0
);
userinfo
=
uiController
.
userInfoQuery
(
request
.
getParameter
(
"bot_name"
),
context
);
userinfo
=
uiController
.
userInfoQuery
(
request
.
getParameter
(
"bot_name"
),
context
);
...
@@ -84,9 +85,14 @@ public class GetAnswerServlet extends HttpServlet {
...
@@ -84,9 +85,14 @@ public class GetAnswerServlet extends HttpServlet {
if
(
userinfo
.
varInitialMap
.
get
(
"botType"
)
!=
null
)
if
(
userinfo
.
varInitialMap
.
get
(
"botType"
)
!=
null
)
botType
=
userinfo
.
varInitialMap
.
get
(
"botType"
);
botType
=
userinfo
.
varInitialMap
.
get
(
"botType"
);
logWriter
.
record
(
"get chat cache start"
,
0
);
chatCache
=
ChatCacheController
.
getChatCache
(
userKey
,
randKey
,
context
,
userinfo
,
botType
);
chatCache
=
ChatCacheController
.
getChatCache
(
userKey
,
randKey
,
context
,
userinfo
,
botType
);
logWriter
.
record
(
"get chat cache complete"
,
0
);
if
(
chatCache
==
null
)
{
if
(
chatCache
==
null
)
{
throw
(
new
Exception
(
"chatCache初始化失败"
));
throw
(
new
Exception
(
"chatCache初始化失败"
));
}
}
...
@@ -110,14 +116,19 @@ public class GetAnswerServlet extends HttpServlet {
...
@@ -110,14 +116,19 @@ public class GetAnswerServlet extends HttpServlet {
break
;
break
;
}
}
logWriter
.
record
(
"form preprocessing"
,
0
);
//针对不同游戏类型对信息点做预处理
//针对不同游戏类型对信息点做预处理
debugFlag
=
botUtil
.
preprocessing
(
receiveParamters
,
context
);
debugFlag
=
botUtil
.
preprocessing
(
receiveParamters
,
context
);
logWriter
.
record
(
"action match start"
,
0
);
//信息点预处理
//信息点预处理
ActionMatcher
matcher
=
new
ActionMatcher
(
curInfoPoint
,
logWriter
,
userinfo
,
context
,
botUtil
);
ActionMatcher
matcher
=
new
ActionMatcher
(
curInfoPoint
,
logWriter
,
userinfo
,
context
,
botUtil
);
logWriter
.
record
(
"action match complete"
,
0
);
/*得到答案更新信息点&生成答案,,清除超时会话数据, 转成json,输出*/
/*得到答案更新信息点&生成答案,,清除超时会话数据, 转成json,输出*/
ansAction
=
matcher
.
getBestMatch
(
userinfo
.
conditionTable
,
context
,
userinfo
);
ansAction
=
matcher
.
getBestMatch
(
userinfo
.
conditionTable
,
context
,
userinfo
);
if
(
state
.
equals
(
""
)
&&
ansAction
.
getPriority
()
==
-
1
)
if
(
state
.
equals
(
""
)
&&
ansAction
.
getPriority
()
==
-
1
)
...
@@ -157,6 +168,7 @@ public class GetAnswerServlet extends HttpServlet {
...
@@ -157,6 +168,7 @@ public class GetAnswerServlet extends HttpServlet {
matcher
.
infoTransfer
(
bestMatch
,
context
,
debugFlag
);
matcher
.
infoTransfer
(
bestMatch
,
context
,
debugFlag
);
logWriter
.
record
(
"update chat cache start"
,
0
);
ChatCacheController
.
updateChatCache4Insert
(
curInfoPoint
,
chatCache
,
context
,
userinfo
);
ChatCacheController
.
updateChatCache4Insert
(
curInfoPoint
,
chatCache
,
context
,
userinfo
);
//清理超时的用户数据
//清理超时的用户数据
...
@@ -167,6 +179,8 @@ public class GetAnswerServlet extends HttpServlet {
...
@@ -167,6 +179,8 @@ public class GetAnswerServlet extends HttpServlet {
context
.
setAttribute
(
"cacheUpdateTime"
,
System
.
currentTimeMillis
());
context
.
setAttribute
(
"cacheUpdateTime"
,
System
.
currentTimeMillis
());
}
}
logWriter
.
record
(
"update chat cache complete"
,
0
);
ansJ
=
SimpleUtil
.
toJson
(
bestMatch
);
ansJ
=
SimpleUtil
.
toJson
(
bestMatch
);
}
else
{
}
else
{
...
...
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