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
b54ed38c
Commit
b54ed38c
authored
Jun 07, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
0b84ccc5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
142 additions
and
2 deletions
+142
-2
center-manage/app/base/controller/impl/product/pricecatCtl.js
+2
-1
center-manage/app/base/controller/impl/product/pricestrategyCtl.js
+9
-0
center-manage/app/base/db/impl/common/pricecatDao.js
+28
-0
center-manage/app/base/db/models/product/pricecat.js
+9
-1
center-manage/app/base/db/models/product/pricestrategy.js
+62
-0
center-manage/app/base/service/impl/product/pricestrategySve.js
+32
-0
No files found.
center-manage/app/base/controller/impl/product/pricecatCtl.js
View file @
b54ed38c
...
@@ -8,7 +8,8 @@ const CtlBase = require("../../ctl.base");
...
@@ -8,7 +8,8 @@ const CtlBase = require("../../ctl.base");
var
cacheBaseComp
=
null
;
var
cacheBaseComp
=
null
;
class
PricecatCtl
extends
CtlBase
{
class
PricecatCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
super
(
"common"
,
CtlBase
.
getServiceName
(
PricecatCtl
));
super
(
"product"
,
CtlBase
.
getServiceName
(
PricecatCtl
));
this
.
pricestrategyService
=
system
.
getObject
(
"service.product.pricestrategySve"
)
}
}
}
}
module
.
exports
=
PricecatCtl
;
module
.
exports
=
PricecatCtl
;
center-manage/app/base/controller/impl/product/pricestrategyCtl.js
0 → 100644
View file @
b54ed38c
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
class
PricestrategyCtl
extends
CtlBase
{
constructor
()
{
super
(
"product"
,
CtlBase
.
getServiceName
(
PricestrategyCtl
));
}
}
module
.
exports
=
PricestrategyCtl
;
center-manage/app/base/db/impl/common/pricecatDao.js
0 → 100644
View file @
b54ed38c
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
PricecatDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
PricecatDao
));
}
orderBy
(
qobj
)
{
//return {"key":"include","value":{model:this.db.models.app}};
if
(
!
qobj
.
orderInfo
||
qobj
.
orderInfo
.
length
==
0
){
return
[[
"seq"
,
"ASC"
]];
}
else
{
return
qobj
.
orderInfo
;
}
}
}
module
.
exports
=
PricecatDao
;
// var u=new UserDao();
// var roledao=system.getObject("db.roleDao");
// (async ()=>{
// var users=await u.model.findAll({where:{app_id:1}});
// var role=await roledao.model.findOne({where:{code:"guest"}});
// console.log(role);
// for(var i=0;i<users.length;i++){
// await users[i].setRoles([role]);
// console.log(i);
// }
//
// })();
center-manage/app/base/db/models/product/pricecat.js
View file @
b54ed38c
...
@@ -2,8 +2,16 @@ const system = require("../../../system");
...
@@ -2,8 +2,16 @@ const system = require("../../../system");
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
//定价
方式
//定价
类型
return
db
.
define
(
"pricecat"
,
{
return
db
.
define
(
"pricecat"
,
{
seq
:{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
},
code
:{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
name
:
{
name
:
{
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
allowNull
:
false
,
...
...
center-manage/app/base/db/models/product/pricestrategy.js
0 → 100644
View file @
b54ed38c
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
//定价类型
return
db
.
define
(
"pricestrategy"
,
{
codeunion
:{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
nameunion
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
//和user的from相同,在注册user时,去创建
optionunion
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
}
//和user的from相同,在注册user时,去创建
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'p_pricestrategy'
,
validate
:
{
},
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}]
// }
]
});
}
center-manage/app/base/service/impl/product/pricestrategySve.js
0 → 100644
View file @
b54ed38c
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
const
fs
=
require
(
"fs"
)
class
PricestrategyService
extends
ServiceBase
{
constructor
()
{
super
(
"product"
,
ServiceBase
.
getDaoName
(
PricestrategyService
));
}
async
buildPriceStrategy
(){
}
}
module
.
exports
=
PricestrategyService
;
// (async ()=>{
// let u=new AppService();
// // let x=await u.cregister("jiangong")
// // console.log(x)
// // let x=await u.cunregister("jiangong")
// // console.log(x)
// // let t=await u.cmakejwt()
// // console.log(t)
// //let ux=await u.cjsonregister(AppService.newRouteUrl("test-service2"),{name:"test-service2",hosts:["ttest1.com"]})
// //let ux=await u.cjsonregister(AppService.newServiceUrl(),{name:"test-service3",url:"http://zhichan.gongsibao.com"})
// //let ux=await u.cdel(AppService.routeUrl("test-service2"))
// //let ux=await u.cdel(AppService.serviceUrl("test-service2"))
// // let ux=await u.create({name:"test4-service",backend:"zhichan-service",domainName:"domain.com"})
// // console.log(ux);
// // let delrtn=await u.delete({id:2,name:"test4-service"})
// // console.log(delrtn);
// })()
\ No newline at end of file
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