Commit 39cf4ce2 by 高宇强

gyq

parent 1ba33bf1
...@@ -12,25 +12,26 @@ class LicenseQueryAPI extends APIBase { ...@@ -12,25 +12,26 @@ class LicenseQueryAPI extends APIBase {
* action_body 执行的参数 * action_body 执行的参数
*/ */
async springBoard(pobj, qobj, req) { async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "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; return result;
} }
async opActionProcess(action_type, action_body) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "test"://测试 case "test"://测试
opResult = system.getResultSuccess(null, "测试成功"); opResult = system.getResultSuccess(null, "测试成功");
break; break;
case "getLicenses"://根据公司得到推荐要办的证书 case "getLicenses"://根据公司得到推荐要办的证书
opResult = await this.liecseSve.getLicenses(action_body); //opResult = await this.liecseSve.getLicenses(action_body);
opResult = await this.liecseSve.opReqResult(pobj, req);
break; break;
// case "getLicenfgfg"://根据公司得到推荐要办的证书
// opResult = await this.liecseSve.getLicenfgfg(action_body);
// break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
const System = require("../../../system"); const System = require("../../../system");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const querystring = require('querystring'); const querystring = require('querystring');
class LicenseService { const AppServiceBase = require("../../app.base");
class LicenseService extends AppServiceBase {
constructor() { constructor() {
super();
this.zcApiUrl = settings.reqZcApi(); this.zcApiUrl = settings.reqZcApi();
this.execClient = System.getObject("util.execClient");
}; };
async opReqResult(reqUrl, queryobj, req) { async opReqResult(pobj, req) {
var rtn = await this.execClient.execPushDataPost(queryobj, reqUrl, req.headers["token"], req.headers["request-id"]); var url = this.zcApiUrl + "action/licenseQuery/springBoard";
var data = JSON.parse(rtn.stdout); var result = await this.restPostUrl(pobj, url);
return data; 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; module.exports = LicenseService;
\ No newline at end of file
...@@ -9,7 +9,6 @@ class PatentycService extends AppServiceBase { ...@@ -9,7 +9,6 @@ class PatentycService extends AppServiceBase {
}; };
async opReqResult(pobj, req) { async opReqResult(pobj, req) {
var url = this.zcApiUrl + "action/patentQuery/springBoard"; var url = this.zcApiUrl + "action/patentQuery/springBoard";
var result = await this.restPostUrl(pobj, url); var result = await this.restPostUrl(pobj, url);
return result; return result;
} }
......
...@@ -23,4 +23,7 @@ ...@@ -23,4 +23,7 @@
  1 [用户中心](doc/api/user/user.md)   1 [用户中心](doc/api/user/user.md)
## 5. 专利检索接口 ## 5. 专利检索接口
  1 [专利检索](doc/api/patentDesc/patent.md)   1 [专利检索](doc/api/patentDesc/patent.md)
\ No newline at end of file
## 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