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
0166bafe
Commit
0166bafe
authored
Mar 16, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送失败日志
parent
6d5e0e33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
center-channel/app/base/api/impl/action/opLog.js
+26
-0
center-channel/app/base/service/impl/common/pushlogSve.js
+39
-0
center-channel/app/base/service/sve.base.js
+3
-0
No files found.
center-channel/app/base/api/impl/action/opLog.js
View file @
0166bafe
...
...
@@ -5,6 +5,7 @@ const logCtl = system.getObject("service.common.oplogSve");
class
opLog
extends
WEBBase
{
constructor
()
{
super
();
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
}
async
info
(
pobj
,
qobj
,
req
)
{
this
.
logCtl
.
info
(
pobj
);
...
...
@@ -12,5 +13,29 @@ class opLog extends WEBBase {
async
error
(
pobj
,
qobj
,
req
)
{
this
.
logCtl
.
error
(
pobj
);
}
/**
* 获取推送失败日志列表
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async
getPushFailLogList
(
pobj
,
qobj
,
req
){
let
list
=
await
this
.
pushlogSve
.
getPushFailLogList
(
pobj
.
actionBody
);
return
list
;
}
/**
* 重新推送
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async
rePush
(
pobj
,
qobj
,
req
){
let
result
=
await
this
.
pushlogSve
.
rePush
(
pobj
.
actionBody
);
return
result
;
}
}
module
.
exports
=
opLog
;
\ No newline at end of file
center-channel/app/base/service/impl/common/pushlogSve.js
View file @
0166bafe
...
...
@@ -51,6 +51,45 @@ class PushlogService extends ServiceBase {
return
result
;
}
async
getPushFailLogList
(
actionBody
)
{
var
sql
=
"SELECT id,appid,`content`,failType,pushNumber,opTitle,resultInfo,created_at FROM `center_channel_pushfaillog` WHERE pushNumber=10 "
;
let
whereParams
=
{};
if
(
actionBody
.
appid
){
sql
+=
" and appid = :appid"
;
whereParams
.
appid
=
actionBody
.
appid
;
}
if
(
actionBody
.
likeStr
){
sql
+=
" and content like :likeStr"
;
whereParams
.
likeStr
=
"%"
+
actionBody
.
likeStr
+
"%"
;
}
sql
+=
" order by created_at desc"
var
list
=
await
this
.
pushfaillogDao
.
customQuery
(
sql
,
whereParams
);
var
result
=
system
.
getResultSuccess
(
list
);
return
result
;
}
/**
* 重新推送
* @param actionBody
* @returns {Promise<void>}
*/
async
rePush
(
actionBody
){
let
content
=
actionBody
.
content
;
let
sql
=
'update `center_channel_pushfaillog` set pushNumber = :pushNumber'
;
let
params
=
{
pushNumber
:
actionBody
.
pushNumber
||
9
}
if
(
Object
.
keys
(
content
).
length
>
0
){
sql
+=
',content=:content'
;
params
.
content
=
JSON
.
stringify
(
actionBody
.
content
);
}
sql
+=
' where id = :id'
;
params
.
id
=
actionBody
.
id
;
let
result
=
await
this
.
customUpdate
(
sql
,
params
);
return
system
.
getResult
(
result
);
}
async
addPublicServiceLog
(
pobj
,
req
)
{
var
sql
=
"INSERT INTO `igirl_api`.`center_channel_public_servicelog` (`appkey`,`pushUrl`,`pushContent`,`resultInfo`,`pushNumber`,`clientIp`,created_at)"
+
"VALUES(:appkey,:pushUrl,:pushContent,:resultInfo,:pushNumber,:clientIp,:created_at)"
;
...
...
center-channel/app/base/service/sve.base.js
View file @
0166bafe
...
...
@@ -169,6 +169,9 @@ class ServiceBase {
async
customQuery
(
sql
,
paras
,
t
)
{
return
this
.
dao
.
customQuery
(
sql
,
paras
,
t
);
}
async
customUpdate
(
sql
,
paras
,
t
)
{
return
this
.
dao
.
customUpdate
(
sql
,
paras
,
t
);
}
async
findCount
(
whereObj
=
null
)
{
return
this
.
dao
.
findCount
(
whereObj
);
}
...
...
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