Commit 91f66031 by 高宇强

gyq

parent 8b64d42e
var APIBase = require("../../api.base");
var system = require("../../../system");
class EnterpriseQueryAPI extends APIBase {
constructor() {
super();
this.enterSve = system.getObject("service.enterprise.enterpriseSve");
}
/**
* 接口跳转-POST请求
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj.actionType, pobj.actionBody);
return result;
}
async opActionProcess(action_type, action_body) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "gxCountByAuthor"://获取企业高薪信息数量
opResult = await this.enterSve.gxCountByAuthor(action_body);
break;
case "gxListByAuthor"://获取企业高薪信息列表
opResult = await this.enterSve.gxListByAuthor(action_body);
break;
case "gameCountByAuthor"://获取企业游戏出版及运营数量
opResult = await this.enterSve.gameCountByAuthor(action_body);
break;
case "gameListByAuthor"://获取企业游戏出版及运营信息列表
opResult = await this.enterSve.gameListByAuthor(action_body);
break;
case "licenseCountByAuthor"://获取企业证照信息数量
opResult = await this.enterSve.licenseCountByAuthor(action_body);
break;
case "licenseListByAuthor"://获取企业证照信息列表
opResult = await this.enterSve.licenseListByAuthor(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = EnterpriseQueryAPI;
// var tesk = new EnterpriseQueryAPI();
// var parm = {
// actionType:"getLicenses",
// actionBody:{name:"上海盛霄云计算技术有限公司"}
// };
// tesk.springBoard(parm).then(function(result){
// console.log(result);
// //console.log(result.data.data[0]);
// }).catch(function(e){
// console.log(e);
// });
\ No newline at end of file
......@@ -64,18 +64,10 @@ class CopyRightSearchApi extends ApiBase {
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return rtn = {
status: 0,
msg: "操作成功",
data: j.hits.total
};
return System.getResult2(j.hits.total, null);
}
catch (e) {
return rtn = {
status: -1,
msg: "操作失败",
data: null
};
return System.getResult2(null, "获取数据出错");
};
};
......@@ -133,7 +125,9 @@ class CopyRightSearchApi extends ApiBase {
"reg_num",
"cat_num",
"reg_time",
"reg_date",
"publish_time",
"publish_date",
"software_version"
],
"sort": [
......@@ -275,19 +269,12 @@ class CopyRightSearchApi extends ApiBase {
try {
rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
return rtn = {
status: 0,
msg: "操作成功",
data: j.hits.total
};
return System.getResult2(j.hits.total, null);
}
catch (e) {
return rtn = {
status: -1,
msg: "操作失败",
data: null
};
return System.getResult2(null, "获取数据出错");
};
};
/*查询某一个作品著作权人名下作品著作权列表(author:作品著作权人-精确、page_size:每页大小、current_page:当前第几页,从1开始)
......
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