1
This commit is contained in:
parent
7256e7850f
commit
e1caaf5f35
@ -96,7 +96,7 @@ function init() {
|
||||
'Contract'
|
||||
);
|
||||
|
||||
registerMetaClass(configDir + 'marketdb_mysql.json',
|
||||
registerMetaClass(configDir + 'blockchaindb_mysql.json',
|
||||
'',
|
||||
'MarketDb'
|
||||
);
|
||||
|
@ -18,7 +18,7 @@ class Log extends BaseModel {
|
||||
fields.push([key, params[key]]);
|
||||
}
|
||||
}
|
||||
await this.getSession().marketConn
|
||||
await this.getSession().blockChainConn
|
||||
(
|
||||
'insert',
|
||||
't_log',
|
||||
|
@ -9,7 +9,7 @@ class Transaction extends BaseModel {
|
||||
seqId: 0
|
||||
};
|
||||
const nowTime = utils.getUtcTime();
|
||||
const lastId = await this.getSession().marketConn
|
||||
const lastId = await this.getSession().blockChainConn
|
||||
(
|
||||
'insertEx',
|
||||
't_transaction',
|
||||
@ -26,7 +26,7 @@ class Transaction extends BaseModel {
|
||||
}
|
||||
|
||||
async update(idx, fields) {
|
||||
const err = await this.getSession().marketConn
|
||||
const err = await this.getSession().blockChainConn
|
||||
(
|
||||
'update',
|
||||
't_transaction',
|
||||
|
@ -14,7 +14,7 @@ class UsedTokenId extends BaseModel {
|
||||
['createtime', nowTime],
|
||||
['modifytime', nowTime],
|
||||
];
|
||||
await this.getSession().marketConn
|
||||
await this.getSession().blockChainConn
|
||||
(
|
||||
'insert',
|
||||
't_used_token_id',
|
||||
@ -23,7 +23,7 @@ class UsedTokenId extends BaseModel {
|
||||
}
|
||||
|
||||
async find(tokenId) {
|
||||
const {err, row} = await this.getSession().marketConn
|
||||
const {err, row} = await this.getSession().blockChainConn
|
||||
(
|
||||
'ormSelectOne',
|
||||
't_used_token_id',
|
||||
|
@ -65,9 +65,9 @@ class Session {
|
||||
return utils.jsonEncode(this.req.query);
|
||||
}
|
||||
|
||||
async getMarketDb() {
|
||||
async getBlockChainDb() {
|
||||
const idx = 0;
|
||||
const dbKey = 'MarketDb' + idx;
|
||||
const dbKey = 'BlockChainDb' + idx;
|
||||
if (this.useConns[dbKey]) {
|
||||
return this.useConns[dbKey];
|
||||
}
|
||||
@ -106,8 +106,8 @@ class Session {
|
||||
return metaFactory[name](this, ...args);
|
||||
}
|
||||
|
||||
async marketConn(method, ...args) {
|
||||
const conn = await this.getMarketDb();
|
||||
async blockChainConn(method, ...args) {
|
||||
const conn = await this.getBlockChainDb();
|
||||
const ret = await conn[method](...args);
|
||||
if (ret.err){
|
||||
this.throwError(500, 'internal error');
|
||||
|
Loading…
x
Reference in New Issue
Block a user