29 lines
640 B
JavaScript
29 lines
640 B
JavaScript
'use strict';
|
|
|
|
const Service = require('egg').Service;
|
|
const QimenClient = require('../../lib/qimen_client');
|
|
|
|
class QimenQueryService extends Service {
|
|
get qimenClient() {
|
|
if (!this.app.qimenClient) {
|
|
this.app.qimenClient = new QimenClient(this.app);
|
|
}
|
|
|
|
return this.app.qimenClient;
|
|
}
|
|
|
|
async send(method, customerId, data) {
|
|
return this.qimenClient.send(method, customerId, data, {
|
|
ctx: this.ctx,
|
|
});
|
|
}
|
|
|
|
async sendRequest(url, requestData, logData = {}) {
|
|
return this.qimenClient.sendRequest(url, requestData, logData, {
|
|
ctx: this.ctx,
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = QimenQueryService;
|