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
703b12fb
Commit
703b12fb
authored
Aug 07, 2020
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实体类、controller
parent
bead271e
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
285 additions
and
48 deletions
+285
-48
gsb-marketplat/app/base/controller/ctl.base.js
+1
-2
gsb-marketplat/app/base/controller/impl/configmag/forminfoCtl.js
+12
-0
gsb-marketplat/app/base/controller/impl/configmag/formsubrecordCtl.js
+12
-0
gsb-marketplat/app/base/controller/impl/configmag/launchchannelCtl.js
+23
-0
gsb-marketplat/app/base/controller/impl/configmag/launchtypeCtl.js
+12
-0
gsb-marketplat/app/base/db/impl/form/forminfoDao.js
+8
-0
gsb-marketplat/app/base/db/impl/form/formitemDao.js
+8
-0
gsb-marketplat/app/base/db/models/marketconfig/forminfo.js
+3
-46
gsb-marketplat/app/base/db/models/marketconfig/formitem.js
+60
-0
gsb-marketplat/app/base/db/models/marketconfig/formsubmitrecord.js
+28
-0
gsb-marketplat/app/base/db/models/marketconfig/launchchannel.js
+27
-0
gsb-marketplat/app/base/db/models/marketconfig/launchtype.js
+27
-0
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
+19
-0
gsb-marketplat/app/base/service/impl/configmag/launchchannelSve.js
+45
-0
gsb-marketplat/app/front/entry/public/js/chunk-50a3aab5.29321dff.js
+0
-0
gsb-marketplat/app/front/entry/public/js/chunk-vendors.6ea93ac3.js
+0
-0
No files found.
gsb-marketplat/app/base/controller/ctl.base.js
View file @
703b12fb
...
@@ -26,7 +26,7 @@ class CtlBase {
...
@@ -26,7 +26,7 @@ class CtlBase {
}
}
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
//设置查询条件
//设置查询条件
console
.
log
(
pobj
)
pobj
.
search
.
company_id
=
pobj
.
company_id
;
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
return
system
.
getResult
(
rs
);
return
system
.
getResult
(
rs
);
}
}
...
@@ -48,7 +48,6 @@ class CtlBase {
...
@@ -48,7 +48,6 @@ class CtlBase {
password
:
custtags
?
custtags
[
lastindex
].
split
(
"_"
)[
1
]
:
null
,
password
:
custtags
?
custtags
[
lastindex
].
split
(
"_"
)[
1
]
:
null
,
username
:
req
.
headers
[
"x-consumer-username"
],
username
:
req
.
headers
[
"x-consumer-username"
],
userid
:
req
.
headers
[
"x-consumer-custom-id"
],
userid
:
req
.
headers
[
"x-consumer-custom-id"
],
username
:
req
.
headers
[
"x-consumer-username"
],
credid
:
req
.
headers
[
"x-credential-identifier"
],
credid
:
req
.
headers
[
"x-credential-identifier"
],
regrole
:
req
.
headers
[
"xregrole"
],
regrole
:
req
.
headers
[
"xregrole"
],
bizpath
:
req
.
headers
[
"xbizpath"
],
bizpath
:
req
.
headers
[
"xbizpath"
],
...
...
gsb-marketplat/app/base/controller/impl/configmag/forminfoCtl.js
0 → 100644
View file @
703b12fb
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
FormInfoCtl
extends
CtlBase
{
constructor
()
{
super
(
"formmag"
,
CtlBase
.
getServiceName
(
FormInfoCtl
));
}
}
module
.
exports
=
FormInfoCtl
;
gsb-marketplat/app/base/controller/impl/configmag/formsubrecordCtl.js
0 → 100644
View file @
703b12fb
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
FormsubrecordCtl
extends
CtlBase
{
constructor
()
{
super
(
"formsubrecordmag"
,
CtlBase
.
getServiceName
(
FormsubrecordCtl
));
}
}
module
.
exports
=
FormsubrecordCtl
;
gsb-marketplat/app/base/controller/impl/configmag/launchchannelCtl.js
0 → 100644
View file @
703b12fb
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
LaunchchannelCtl
extends
CtlBase
{
constructor
()
{
super
(
"launchchannelmag"
,
CtlBase
.
getServiceName
(
LaunchchannelCtl
));
this
.
launchchannelSve
=
system
.
getObject
(
'service.configmag.launchchannelSve'
);
}
/**
* 重写添加方法
* @param pobj
* @returns {Promise<{msg: string, data: *, bizmsg: string, status: number}>}
*/
async
create
(
pobj
){
const
result
=
await
this
.
launchchannelSve
.
createChannel
(
pobj
);
return
system
.
getResult
(
result
);
}
}
module
.
exports
=
LaunchchannelCtl
;
gsb-marketplat/app/base/controller/impl/configmag/launchtypeCtl.js
0 → 100644
View file @
703b12fb
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
LaunchtypeCtl
extends
CtlBase
{
constructor
()
{
super
(
"launchtypemag"
,
CtlBase
.
getServiceName
(
LaunchtypeCtl
));
}
}
module
.
exports
=
LaunchtypeCtl
;
gsb-marketplat/app/base/db/impl/form/forminfoDao.js
0 → 100644
View file @
703b12fb
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
ForminfoDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
ForminfoDao
));
}
}
module
.
exports
=
ForminfoDao
;
gsb-marketplat/app/base/db/impl/form/formitemDao.js
0 → 100644
View file @
703b12fb
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
FormitemDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
FormitemDao
));
}
}
module
.
exports
=
FormitemDao
;
gsb-marketplat/app/base/db/models/marketconfig/forminfo.js
View file @
703b12fb
...
@@ -26,61 +26,18 @@ module.exports = (db, DataTypes) => {
...
@@ -26,61 +26,18 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
created_at
:
{
allowNull
:
false
,
type
:
DataTypes
.
DATE
},
updated_at
:
{
allowNull
:
true
,
type
:
DataTypes
.
DATE
},
created_at
:
{
allowNull
:
true
,
type
:
DataTypes
.
DATE
},
user_id
:
DataTypes
.
STRING
(
100
),
user_id
:
DataTypes
.
STRING
(
100
),
user_name
:
DataTypes
.
STRING
(
100
),
//user_name 用户名称
user_name
:
DataTypes
.
STRING
(
100
),
//user_name 用户名称
company_id
:
DataTypes
.
INTEGER
(
11
)
//user_name 用户名称
},
{
},
{
paranoid
:
true
,
//假的删除
paranoid
:
true
,
//假的删除
underscored
:
true
,
underscored
:
true
,
version
:
true
,
version
:
true
,
freezeTableName
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'c_form_info'
,
tableName
:
'c_form_info'
,
validate
:
{
validate
:
{},
},
indexes
:
[
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
]
});
});
}
}
...
...
gsb-marketplat/app/base/db/models/marketconfig/formitem.js
0 → 100644
View file @
703b12fb
/**
* 表单信息表
* @param db
* @param DataTypes
* @returns {Model|void|*}
*/
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"formitem"
,
{
form_id
:
{
//表单id
allowNull
:
false
,
type
:
DataTypes
.
INTEGER
},
code
:
{
//表单编码
allowNull
:
false
,
type
:
DataTypes
.
STRING
},
name
:
{
//表单名称
allowNull
:
false
,
type
:
DataTypes
.
STRING
},
item_type
:
{
//表单类型
allowNull
:
false
,
type
:
DataTypes
.
STRING
},
item_type_name
:
{
//表单类型名称
allowNull
:
false
,
type
:
DataTypes
.
STRING
},
config_params
:
{
//表单配置参数
allowNull
:
false
,
type
:
DataTypes
.
JSON
},
is_enableed
:
{
//显示状态
allowNull
:
false
,
type
:
DataTypes
.
INTEGER
},
is_required
:
{
//是否必填
allowNull
:
false
,
type
:
DataTypes
.
INTEGER
},
sequence
:
{
//次序
allowNull
:
false
,
type
:
DataTypes
.
INTEGER
},
notes
:
{
//备注
allowNull
:
false
,
type
:
DataTypes
.
STRING
()
},
company_id
:
DataTypes
.
INTEGER
(
11
)
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
tableName
:
'c_form_item'
,
validate
:
{},
indexes
:
[]
});
}
gsb-marketplat/app/base/db/models/marketconfig/formsubmitrecord.js
0 → 100644
View file @
703b12fb
/**
* 表单提交记录表
* @param db
* @param DataTypes
* @returns {Model|void|*}
*/
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"formsubmitrecord"
,
{
form_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
record_status
:
DataTypes
.
STRING
(
60
),
//记录状态 1未读 2已读 3无效
record_status_name
:
DataTypes
.
STRING
(
60
),
//记录状态名称
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updated_at
:
true
,
tableName
:
'c_form_submit_record'
,
validate
:
{
},
indexes
:
[
]
});
}
gsb-marketplat/app/base/db/models/marketconfig/launchchannel.js
0 → 100644
View file @
703b12fb
/**
* 投放渠道信息表
* @param db
* @param DataTypes
* @returns {Model|void|*}
*/
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"launchchannel"
,
{
code
:
DataTypes
.
STRING
(
100
),
//表单编码
name
:
DataTypes
.
STRING
(
100
),
//表单名称
notes
:
DataTypes
.
STRING
(
255
),
//备注
user_id
:
DataTypes
.
INTEGER
(
11
),
//创建用户id
user_name
:
DataTypes
.
STRING
(
60
),
//创建用户名称
company_id
:
DataTypes
.
INTEGER
(
11
)
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updated_at
:
true
,
tableName
:
'c_launch_channel'
,
validate
:
{},
indexes
:
[]
});
}
gsb-marketplat/app/base/db/models/marketconfig/launchtype.js
0 → 100644
View file @
703b12fb
/**
* 投放渠道信息表
* @param db
* @param DataTypes
* @returns {Model|void|*}
*/
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"launchtype"
,
{
code
:
DataTypes
.
STRING
(
100
),
//表单编码
name
:
DataTypes
.
STRING
(
100
),
//表单名称
notes
:
DataTypes
.
STRING
(
255
),
//备注
user_id
:
DataTypes
.
INTEGER
(
11
),
//创建用户id
user_name
:
DataTypes
.
STRING
(
60
),
//创建用户名称
company_id
:
DataTypes
.
INTEGER
(
11
)
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updated_at
:
true
,
tableName
:
'c_launch_type'
,
validate
:
{},
indexes
:
[]
});
}
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
0 → 100644
View file @
703b12fb
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
ForminfoService
extends
ServiceBase
{
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
ForminfoService
));
}
async
createTemplate
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
code
=
await
this
.
getBusUid
(
"tp"
);
var
name
=
"营销模板"
;
ab
.
code
=
code
;
ab
.
name
=
name
;
return
this
.
create
(
ab
);
}
}
module
.
exports
=
ForminfoService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/configmag/launchchannelSve.js
0 → 100644
View file @
703b12fb
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
LaunchchannelService
extends
ServiceBase
{
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
LaunchchannelService
));
}
/**
* 根据company_id 和 code 去重
* @param pobj
* @returns {Promise<{msg: string, data: *, bizmsg: string, status: number}|{msg: *, data: *, status: *}>}
*/
async
createChannel
(
pobj
){
if
(
!
pobj
.
company_id
){
return
system
.
getResult
(
null
,
'company_id can not be empty'
);
}
if
(
!
pobj
.
name
){
return
system
.
getResult
(
null
,
'name can not be empty'
);
}
if
(
!
pobj
.
code
){
return
system
.
getResult
(
null
,
'code can not be empty'
);
}
let
whereParams
=
{
code
:
pobj
.
code
,
company_id
:
pobj
.
company_id
}
let
searchResult
=
await
this
.
findOne
(
whereParams
,[]);
if
(
searchResult
){
return
system
.
getResultFail
(
-
1
,
'当前渠道已经存在,请勿重复添加'
)
}
let
channelData
=
{
name
:
pobj
.
name
,
code
:
pobj
.
code
,
user_id
:
pobj
.
userid
,
user_name
:
pobj
.
username
,
company_id
:
pobj
.
company_id
}
let
result
=
await
this
.
create
(
channelData
);
return
system
.
getResult
(
result
);
}
}
module
.
exports
=
LaunchchannelService
;
\ No newline at end of file
gsb-marketplat/app/front/entry/public/js/chunk-50a3aab5.29321dff.js
View file @
703b12fb
No preview for this file type
gsb-marketplat/app/front/entry/public/js/chunk-vendors.6ea93ac3.js
View file @
703b12fb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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