Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
89f49b27
Commit
89f49b27
authored
Jul 22, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
280bf159
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
brg-queue-center/app/base/api/api.base.js
+7
-2
brg-queue-center/app/base/service/impl/utilsSve/utilsLogsSve.js
+11
-1
brg-queue-center/readme.txt
+3
-1
No files found.
brg-queue-center/app/base/api/api.base.js
View file @
89f49b27
...
...
@@ -16,7 +16,10 @@ class APIBase {
if
(
!
pobj
.
actionBody
)
{
pobj
.
actionBody
=
{};
}
pobj
.
actionBody
.
requestId
=
pobj
.
requestId
?
pobj
.
requestId
:
pobj
.
actionBody
.
requestId
||
await
this
.
getBusUid
(
"mq-"
);
pobj
.
actionBody
.
requestId
=
pobj
.
requestId
?
pobj
.
requestId
:
pobj
.
actionBody
.
requestId
;
if
(
pobj
.
actionType
&&
pobj
.
actionType
!=
"queryLogsData"
&&
!
pobj
.
actionBody
.
requestId
)
{
pobj
.
actionBody
.
requestId
=
await
this
.
getBusUid
(
"mq-"
);
}
var
shaStr
=
await
sha256
(
JSON
.
stringify
(
pobj
));
this
.
redisClient
.
setWithEx
(
shaStr
,
1
,
3
);
var
result
=
await
this
[
methodname
](
pobj
,
query
,
req
);
...
...
@@ -30,7 +33,9 @@ class APIBase {
pobj
.
actionBody
.
resultInfo
=
result
;
pobj
.
actionBody
.
requestId
=
result
.
requestId
;
pobj
.
actionBody
.
opTitle
=
"reqPath:"
+
req
.
path
;
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"-apireq"
,
pobj
.
actionBody
);
if
(
pobj
.
actionType
&&
pobj
.
actionType
!=
"queryLogsData"
)
{
this
.
esUtils
.
addEsLogs
(
settings
.
queuedName
+
"-apireq"
,
pobj
.
actionBody
);
}
}
return
result
;
}
catch
(
error
)
{
...
...
brg-queue-center/app/base/service/impl/utilsSve/utilsLogsSve.js
View file @
89f49b27
...
...
@@ -58,7 +58,7 @@ class UtilsLogsService extends AppServiceBase {
,
"sort"
:
[
{
"
created_at
"
:
"desc"
"
timestamp
"
:
"desc"
}
]
}
...
...
@@ -103,6 +103,16 @@ class UtilsLogsService extends AppServiceBase {
}
});
}
if
(
actionBody
.
startTime
&&
actionBody
.
entTime
)
{
params
.
query
.
bool
[
"filter"
]
=
{
"range"
:
{
"timestamp"
:
{
"gte"
:
actionBody
.
startTime
,
"lte"
:
actionBody
.
entTime
}
}
};
}
var
resultData
=
null
;
try
{
resultData
=
await
this
.
esUtils
.
execPostEs
(
settings
.
queuedName
,
params
,
esIndexName
);
...
...
brg-queue-center/readme.txt
View file @
89f49b27
...
...
@@ -114,7 +114,9 @@
"messageBody":"",//N 日志的描述信息
"resultInfo":"",//N 返回信息
"errorInfo": "",//N 错误信息
"requestId": ""//N 请求返回的requestId
"requestId": "",//N 请求返回的requestId
"startTime":1595414873130,//N 开始时间
"entTime":1595414873132//N 结束时间
}
}
返回参数:
...
...
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