8713-testToMaster #3523
|
@ -1,4 +1,6 @@
|
||||||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||||
VALUES
|
VALUES
|
||||||
('Ticket','itemLack','READ','ALLOW','ROLE','employee'),
|
('Ticket','itemLack','READ','ALLOW','ROLE','employee'),
|
||||||
('Ticket','itemLackDetail','READ','ALLOW','ROLE','employee');
|
('Ticket','itemLackDetail','READ','ALLOW','ROLE','employee'),
|
||||||
|
('Ticket','itemLackOrigin','READ','ALLOW','ROLE','employee'),
|
||||||
|
('Ticket','negativeOrigin','READ','ALLOW','ROLE','employee');
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('negativeOrigin', {
|
||||||
|
description: 'Insert ticket negative into negativeOrigin',
|
||||||
|
accessType: 'READ',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'ctx',
|
||||||
|
type: 'Object',
|
||||||
|
http: {source: 'context'}
|
||||||
|
}],
|
||||||
|
returns: {
|
||||||
|
type: 'object',
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/negativeOrigin`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.negativeOrigin = async(ctx, data, options) => {
|
||||||
|
const myOptions = {};
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
if (!myOptions.transaction) {
|
||||||
|
tx = await Self.beginTransaction({});
|
||||||
|
myOptions.transaction = tx;
|
||||||
|
}
|
||||||
|
const conn = Self.dataSource.connector;
|
||||||
|
const stmts = ['SELECT * FROM vn.negativeOrigin'];
|
||||||
|
const sql = ParameterizedSQL.join(stmts, ';');
|
||||||
|
const result = await conn.executeStmt(sql, myOptions);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
};
|
|
@ -49,4 +49,5 @@ module.exports = function(Self) {
|
||||||
require('../methods/ticket/itemLack')(Self);
|
require('../methods/ticket/itemLack')(Self);
|
||||||
require('../methods/ticket/itemLackDetail')(Self);
|
require('../methods/ticket/itemLackDetail')(Self);
|
||||||
require('../methods/ticket/itemLackOrigin')(Self);
|
require('../methods/ticket/itemLackOrigin')(Self);
|
||||||
|
require('../methods/ticket/negativeOrigin')(Self);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue