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
286c267a
Commit
286c267a
authored
Aug 08, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板接口
parent
ab6a9800
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
18 deletions
+43
-18
gsb-marketplat/app/base/db/models/template/templatelink.js
+2
-1
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
+34
-17
gsb-marketplat/app/config/settings.js
+7
-0
No files found.
gsb-marketplat/app/base/db/models/template/templatelink.js
View file @
286c267a
...
@@ -26,7 +26,8 @@ module.exports = (db, DataTypes) => {
...
@@ -26,7 +26,8 @@ module.exports = (db, DataTypes) => {
lauch_type_code
:
DataTypes
.
STRING
,
lauch_type_code
:
DataTypes
.
STRING
,
marketing_subject_code
:
DataTypes
.
STRING
,
marketing_subject_code
:
DataTypes
.
STRING
,
is_enabled
:
DataTypes
.
INTEGER
,
is_enabled
:
DataTypes
.
INTEGER
,
link_url
:
DataTypes
.
STRING
,
link_url_pc
:
DataTypes
.
STRING
,
link_url_mobile
:
DataTypes
.
STRING
,
notes
:
DataTypes
.
STRING
,
notes
:
DataTypes
.
STRING
,
user_id
:
DataTypes
.
STRING
(
100
),
user_id
:
DataTypes
.
STRING
(
100
),
user_name
:
DataTypes
.
STRING
(
100
),
//user_name 用户名称
user_name
:
DataTypes
.
STRING
(
100
),
//user_name 用户名称
...
...
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
View file @
286c267a
...
@@ -4,37 +4,54 @@ const settings = require("../../../../config/settings");
...
@@ -4,37 +4,54 @@ const settings = require("../../../../config/settings");
class
TemplatelinkService
extends
ServiceBase
{
class
TemplatelinkService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"template"
,
ServiceBase
.
getDaoName
(
TemplatelinkService
));
super
(
"template"
,
ServiceBase
.
getDaoName
(
TemplatelinkService
));
this
.
templateLinkUrl
=
settings
.
templateLinkUrl
();
}
}
async
findAndCountAll
(
obj
){
async
findAndCountAll
(
obj
){
var
res
=
await
this
.
dao
.
findAndCountAll
(
obj
);
var
res
=
await
this
.
dao
.
findAndCountAll
(
obj
);
return
system
.
getResultSuccess
(
res
);
return
system
.
getResultSuccess
(
res
);
}
}
/**
* 校验封装参数
* @param {*} ab
* @param {*} xctx
*/
async
checkAndPackageParams
(
ab
,
xctx
){
async
checkAndPackageParams
(
ab
,
xctx
){
if
(
!
ab
.
channel_id
){
if
(
!
ab
.
channel_code
){
return
system
.
getResultFail
(
-
101
,
"渠道主体不能为空"
);
return
system
.
getResultFail
(
-
101
,
"渠道主体编码不能为空"
);
}
if
(
!
ab
.
business_type_code
){
return
system
.
getResultFail
(
-
102
,
"业务类型编码不能为空"
);
}
}
if
(
!
ab
.
business_type_id
){
if
(
!
ab
.
lauch_type_code
){
return
system
.
getResultFail
(
-
10
2
,
"业务类型
不能为空"
);
return
system
.
getResultFail
(
-
10
3
,
"投放方式编码
不能为空"
);
}
}
if
(
!
ab
.
lauch_type_id
){
if
(
!
ab
.
marketing_subject_code
){
return
system
.
getResultFail
(
-
10
3
,
"投放方式
不能为空"
);
return
system
.
getResultFail
(
-
10
4
,
"营销主体编码
不能为空"
);
}
}
if
(
!
ab
.
marketing_subject_id
){
if
(
!
ab
.
channel_name
){
return
system
.
getResultFail
(
-
104
,
"营销主体不能为空"
);
return
system
.
getResultFail
(
-
105
,
"渠道主体名称不能为空"
);
}
if
(
!
ab
.
business_type_name
){
return
system
.
getResultFail
(
-
106
,
"业务类型名称不能为空"
);
}
if
(
!
ab
.
lauch_type_name
){
return
system
.
getResultFail
(
-
107
,
"投放方式名称不能为空"
);
}
if
(
!
ab
.
marketing_subject_name
){
return
system
.
getResultFail
(
-
108
,
"营销主体名称不能为空"
);
}
}
if
(
!
ab
.
delivery_word
){
if
(
!
ab
.
delivery_word
){
return
system
.
getResultFail
(
-
10
5
,
"投放词不能为空"
);
return
system
.
getResultFail
(
-
10
9
,
"投放词不能为空"
);
}
}
if
(
!
ab
.
else_channel_param
){
if
(
!
ab
.
else_channel_param
){
return
system
.
getResultFail
(
-
1
06
,
"其它渠道参数不能为空"
);
return
system
.
getResultFail
(
-
1
10
,
"其它渠道参数不能为空"
);
}
}
if
(
!
ab
.
template_id
){
if
(
!
ab
.
template_id
){
return
system
.
getResultFail
(
-
1
07
,
"模板参数不能为空"
);
return
system
.
getResultFail
(
-
1
11
,
"模板参数不能为空"
);
}
}
if
(
!
ab
.
name
){
if
(
!
ab
.
name
){
return
system
.
getResultFail
(
-
1
07
,
"任务名称不能为空"
);
return
system
.
getResultFail
(
-
1
12
,
"任务名称不能为空"
);
}
}
if
(
!
ab
.
code
){
//新增
if
(
!
ab
.
code
){
//新增
ab
.
code
=
await
this
.
getBusUid
(
"tl"
);
ab
.
code
=
await
this
.
getBusUid
(
"tl"
);
...
@@ -54,6 +71,10 @@ class TemplatelinkService extends ServiceBase {
...
@@ -54,6 +71,10 @@ class TemplatelinkService extends ServiceBase {
}
}
ab
.
id
=
linkinfo
.
id
;
ab
.
id
=
linkinfo
.
id
;
}
}
ab
.
link_url_pc
=
this
.
templateLinkUrl
+
"?id="
+
ab
.
template_id
+
"&source="
+
ab
.
channel_code
+
"&device=pc&event="
+
ab
.
else_channel_param
+
"&business="
+
ab
.
business_type_code
+
"&type="
+
ab
.
lauch_type_name
+
"for="
+
ab
.
marketing_subject_code
;
ab
.
link_url_mobile
=
this
.
templateLinkUrl
+
"?id="
+
ab
.
template_id
+
"&source="
+
ab
.
channel_code
+
"&device=mobile&event="
+
ab
.
else_channel_param
+
"&business="
+
ab
.
business_type_code
+
"&type="
+
ab
.
lauch_type_name
+
"for="
+
ab
.
marketing_subject_code
;
return
ab
;
return
ab
;
}
}
...
@@ -170,8 +191,5 @@ class TemplatelinkService extends ServiceBase {
...
@@ -170,8 +191,5 @@ class TemplatelinkService extends ServiceBase {
await
this
.
dao
.
delete
({
id
:
linkinfo
.
id
});
await
this
.
dao
.
delete
({
id
:
linkinfo
.
id
});
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
}
}
module
.
exports
=
TemplatelinkService
;
module
.
exports
=
TemplatelinkService
;
\ No newline at end of file
gsb-marketplat/app/config/settings.js
View file @
286c267a
...
@@ -31,6 +31,13 @@ var settings = {
...
@@ -31,6 +31,13 @@ var settings = {
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
}
},
},
templateLinkUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.200.162:8081"
;
}
else
{
return
"http://marketplat.gongsibao.com"
;
}
},
requrl
:
function
()
{
requrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.1.128:4018"
;
return
"http://192.168.1.128:4018"
;
...
...
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