Commit 39cf4ce2 by 高宇强

gyq

parent 1ba33bf1
......@@ -12,25 +12,26 @@ class LicenseQueryAPI extends APIBase {
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj.actionType, pobj.actionBody);
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(action_type, action_body) {
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "getLicenses"://根据公司得到推荐要办的证书
opResult = await this.liecseSve.getLicenses(action_body);
//opResult = await this.liecseSve.getLicenses(action_body);
opResult = await this.liecseSve.opReqResult(pobj, req);
break;
// case "getLicenfgfg"://根据公司得到推荐要办的证书
// opResult = await this.liecseSve.getLicenfgfg(action_body);
// break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
const System = require("../../../system");
var settings = require("../../../../config/settings");
const querystring = require('querystring');
class LicenseService {
const AppServiceBase = require("../../app.base");
class LicenseService extends AppServiceBase {
constructor() {
super();
this.zcApiUrl = settings.reqZcApi();
this.execClient = System.getObject("util.execClient");
};
async opReqResult(reqUrl, queryobj, req) {
var rtn = await this.execClient.execPushDataPost(queryobj, reqUrl, req.headers["token"], req.headers["request-id"]);
var data = JSON.parse(rtn.stdout);
return data;
async opReqResult(pobj, req) {
var url = this.zcApiUrl + "action/licenseQuery/springBoard";
var result = await this.restPostUrl(pobj, url);
return result;
};
//得到公司推荐的证照信息
async getLicenses(queryobj, req) {
var url = this.zcApiUrl + "api/action/licenseQuery/getLicenses";
return await this.opReqResult(url, queryobj, req);
};
//根据登记号ggg获取著作权详情
// async getLicenses(queryobj, req) {
// var url = this.zcApiUrl + "api/action/licenseQuery/getLicenfgfg";
// return await this.opReqResult(url, queryobj, req);
// };
}
module.exports = LicenseService;
\ No newline at end of file
......@@ -9,7 +9,6 @@ class PatentycService extends AppServiceBase {
};
async opReqResult(pobj, req) {
var url = this.zcApiUrl + "action/patentQuery/springBoard";
var result = await this.restPostUrl(pobj, url);
return result;
}
......
......@@ -24,3 +24,6 @@
## 5. 专利检索接口
  1 [专利检索](doc/api/patentDesc/patent.md)
## 6. 证书推荐接口
  1 [证书推荐](doc/api/licensesDesc/license.md)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment