1
This commit is contained in:
parent
b68db27bdb
commit
5592c7ac73
@ -1,8 +1,8 @@
|
||||
const utils = require('j7/utils');
|
||||
const basewrap = require('./basewrap');
|
||||
|
||||
class BlockChainDb extends basewrap.BaseWrap {
|
||||
class BcEventDb extends basewrap.BaseWrap {
|
||||
|
||||
}
|
||||
|
||||
module.exports = BlockChainDb;
|
||||
module.exports = BcEventDb;
|
||||
|
@ -18,7 +18,7 @@ class Log extends BaseModel {
|
||||
fields.push([key, params[key]]);
|
||||
}
|
||||
}
|
||||
await this.getSession().blockChainConn
|
||||
await this.getSession().bcEventConn
|
||||
(
|
||||
'insert',
|
||||
't_log',
|
||||
|
@ -9,7 +9,7 @@ class Transaction extends BaseModel {
|
||||
seqId: 0
|
||||
};
|
||||
const nowTime = utils.getUtcTime();
|
||||
const lastId = await this.getSession().blockChainConn
|
||||
const lastId = await this.getSession().bcEventConn
|
||||
(
|
||||
'insertEx',
|
||||
't_transaction',
|
||||
@ -26,7 +26,7 @@ class Transaction extends BaseModel {
|
||||
}
|
||||
|
||||
async update(idx, fields) {
|
||||
const err = await this.getSession().blockChainConn
|
||||
const err = await this.getSession().bcEventConn
|
||||
(
|
||||
'update',
|
||||
't_transaction',
|
||||
|
@ -14,7 +14,7 @@ class UsedTokenId extends BaseModel {
|
||||
['createtime', nowTime],
|
||||
['modifytime', nowTime],
|
||||
];
|
||||
await this.getSession().blockChainConn
|
||||
await this.getSession().bcEventConn
|
||||
(
|
||||
'insert',
|
||||
't_used_token_id',
|
||||
@ -23,7 +23,7 @@ class UsedTokenId extends BaseModel {
|
||||
}
|
||||
|
||||
async find(tokenId) {
|
||||
const {err, row} = await this.getSession().blockChainConn
|
||||
const {err, row} = await this.getSession().bcEventConn
|
||||
(
|
||||
'ormSelectOne',
|
||||
't_used_token_id',
|
||||
|
@ -65,9 +65,9 @@ class Session {
|
||||
return utils.jsonEncode(this.req.query);
|
||||
}
|
||||
|
||||
async getBlockChainDb() {
|
||||
async getBcEventDb() {
|
||||
const idx = 0;
|
||||
const dbKey = 'BlockChainDb' + idx;
|
||||
const dbKey = 'BcEventDb' + idx;
|
||||
if (this.useConns[dbKey]) {
|
||||
return this.useConns[dbKey];
|
||||
}
|
||||
@ -106,8 +106,8 @@ class Session {
|
||||
return metaFactory[name](this, ...args);
|
||||
}
|
||||
|
||||
async blockChainConn(method, ...args) {
|
||||
const conn = await this.getBlockChainDb();
|
||||
async bcEventConn(method, ...args) {
|
||||
const conn = await this.getBcEventDb();
|
||||
const ret = await conn[method](...args);
|
||||
if (ret.err){
|
||||
this.throwError(500, 'internal error');
|
||||
|
Loading…
x
Reference in New Issue
Block a user