1
This commit is contained in:
parent
1401e5bd94
commit
aea511335b
@ -10,6 +10,8 @@ function add(clsName, modName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
add('Transaction', 'transaction');
|
||||||
|
add('Log', 'log');
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(name, session) {
|
function create(name, session) {
|
||||||
|
35
server/web3service/models/log.js
Normal file
35
server/web3service/models/log.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
const utils = require('j7/utils');
|
||||||
|
const BaseModel = require('./basemodel');
|
||||||
|
|
||||||
|
class Log extends BaseModel {
|
||||||
|
|
||||||
|
async add(params) {
|
||||||
|
const result = {
|
||||||
|
err: null,
|
||||||
|
seqId: 0
|
||||||
|
};
|
||||||
|
const nowTime = utils.getUtcTime();
|
||||||
|
const fields = [
|
||||||
|
['type', params['type']],
|
||||||
|
['subType', params['sub_type']],
|
||||||
|
['net_id', params['net_id']],
|
||||||
|
['createtime', nowTime],
|
||||||
|
['modifytime', nowTime],
|
||||||
|
];
|
||||||
|
for (i = 1; i <= 4; ++i) {
|
||||||
|
const key = 'param' + i;
|
||||||
|
if (utils.hasKey(params, key)) {
|
||||||
|
fields.push([key, params[key]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await this.getSession().marketConn
|
||||||
|
(
|
||||||
|
'insert',
|
||||||
|
't_log',
|
||||||
|
fields
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Log;
|
Loading…
x
Reference in New Issue
Block a user