This commit is contained in:
aozhiwei 2024-06-11 10:55:23 +08:00
parent 05bdceb14a
commit 059a285aaf
3 changed files with 0 additions and 84 deletions

View File

@ -10,9 +10,7 @@ function add(clsName, modName) {
}
async function init() {
add('Transaction', 'transaction');
add('Log', 'log');
add('UsedTokenId', 'used_tokenid');
}
function create(name, session) {

View File

@ -1,43 +0,0 @@
const utils = require('j7/utils');
const BaseModel = require('./basemodel');
class Transaction extends BaseModel {
async add(account, data, netId) {
const result = {
err: null,
seqId: 0
};
const nowTime = utils.getUtcTime();
const lastId = await this.getSession().bcEventConn
(
'insertEx',
't_transaction',
[
['account', account],
['data', data],
['net_id', netId],
['createtime', nowTime],
['modifytime', nowTime],
]
);
result['seqId'] = lastId;
return result;
}
async update(idx, fields) {
const err = await this.getSession().bcEventConn
(
'update',
't_transaction',
[
['idx', idx]
],
fields
);
return err;
}
}
module.exports = Transaction;

View File

@ -1,39 +0,0 @@
const utils = require('j7/utils');
const BaseModel = require('./basemodel');
class UsedTokenId extends BaseModel {
async add(account, tokenId, transId, netId) {
const nowTime = utils.getUtcTime();
const fields = [
['account', account],
['token_id', tokenId],
['trans_id', transId],
['net_id', netId],
['confirmed', 1],
['createtime', nowTime],
['modifytime', nowTime],
];
await this.getSession().bcEventConn
(
'insert',
't_used_token_id',
fields
);
}
async find(tokenId) {
const {err, row} = await this.getSession().bcEventConn
(
'ormSelectOne',
't_used_token_id',
[
['token_id', tokenId]
]
);
return row;
}
}
module.exports = UsedTokenId;