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
2d7ef743
Commit
2d7ef743
authored
Mar 11, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
da32b3ab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
1 deletions
+76
-1
bpo-admin/app/base/api/impl/channelApi.js
+44
-0
bpo-admin/app/base/service/impl/channelSve.js
+8
-0
bpo-admin/app/base/system.js
+1
-1
bpo-admin/chanle-service.txt
+23
-0
No files found.
bpo-admin/app/base/api/impl/channelApi.js
0 → 100644
View file @
2d7ef743
var
system
=
require
(
"../../system"
)
const
md5
=
require
(
"MD5"
);
const
logCtl
=
system
.
getObject
(
"web.oplogCtl"
);
const
moment
=
require
(
"moment"
);
class
ChannelApi
{
constructor
()
{
this
.
channelSve
=
system
.
getObject
(
"service.channelSve"
);
}
//渠道绑定
async
bindPlatform
(
queryobj
,
qobj
,
req
)
{
if
(
!
this
.
trim
(
queryobj
.
platform_id
)){
return
system
.
getErrResult2
(
"platform_id不能为空"
)
}
if
(
!
this
.
trim
(
queryobj
.
channel_id
)){
return
system
.
getErrResult2
(
"channel_id不能为空"
)
}
if
(
!
this
.
trim
(
queryobj
.
platform_channel_id
)){
return
system
.
getErrResult2
(
"platform_channel_id不能为空"
)
}
var
result
=
await
this
.
channelSve
.
bindPlatform
(
queryobj
);
return
result
;
}
//绑定渠道推送
async
pushbindingchannel
(
queryobj
,
qobj
,
req
){
queryobj
.
begin
=
moment
().
subtract
(
1
,
'days'
).
format
(
'YYYY-MM-DD 00:00:00'
);
/*前一天的时间*/
queryobj
.
end
=
moment
().
subtract
(
1
,
'days'
).
format
(
'YYYY-MM-DD 23:59:59'
);
/*前一天的时间*/
console
.
log
(
queryobj
);
var
result
=
await
this
.
channelSve
.
pushbindingchannel
(
queryobj
);
return
result
;
}
trim
(
o
)
{
if
(
!
o
)
{
return
""
;
}
return
o
.
toString
().
trim
();
}
}
module
.
exports
=
ChannelApi
;
bpo-admin/app/base/service/impl/channelSve.js
View file @
2d7ef743
...
...
@@ -38,6 +38,14 @@ class ChannelService extends microService {
return
await
this
.
callms
(
"channel"
,
"channelPage"
,
params
);
}
async
bindPlatform
(
params
){
return
await
this
.
callms
(
"channel"
,
"bindPlatform"
,
params
);
}
async
pushbindingchannel
(
params
){
return
await
this
.
callms
(
"channel"
,
"pushbindingchannel"
,
params
);
}
// 商户api
async
merchantInfo
(
params
)
{
return
await
this
.
callms
(
"channel"
,
"merchantInfo"
,
params
);
...
...
bpo-admin/app/base/system.js
View file @
2d7ef743
...
...
@@ -262,7 +262,7 @@ class System {
var
domain
=
"http://39.107.234.14"
;
return
{
// 渠道服务
channel
:
domain
+
":3003"
+
path
,
channel
:
domain
2
+
":3003"
+
path
,
}
}
else
{
// var odomain = "http://123.57.217.203"
...
...
bpo-admin/chanle-service.txt
View file @
2d7ef743
...
...
@@ -233,3 +233,26 @@
"msg": "success",
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
3.4 渠道绑定
url: /api/channelApi/bindPlatform
请求参数:
{
"platform_id":"10000", //平台渠道ID
"channel_id":10000, //渠道id
"platform_channel_id":10000 //默认写死 10000
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": 10002,
"requestid": "26d5cee56dd54d938b46c759a6885a0f"
}
{
"status": -1,
"msg": "platform_id不能为空",
"data": null,
"bizmsg": "empty"
}
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