Commit 9d45dc13 by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents bd8eaaad e39a50a7
var APIBase = require("../../api.base");
var system = require("../../../system");
class PolicyAPI extends APIBase {
constructor() {
super();
this.policySve = system.getObject("service.policy.policySve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* 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,pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
return result;
}
async opActionProcess(pobj,action_process, action_type, action_body, req) {
var opResult = null;
switch (action_type) {
// sy
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "policyQuery"://政策检索
opResult = await this.policySve.policyQuery(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = PolicyAPI;
\ No newline at end of file
const system = require("../../../system");
var settings = require("../../../../config/settings");
class PolicyService{
constructor() {
this.centerOrderUrl = settings.centerOrderUrl();
this.execClient = system.getObject("util.execClient");
};
async policyQuery(pobj) {
var url = this.centerOrderUrl + "action/policy/springBoard";
var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout);
return data;
}
}
module.exports = PolicyService;
......@@ -32,4 +32,6 @@
  1 [产品中心接口](doc/api/platform/product.md)
## 8. 订单中心相关接口
  1 [订单中心接口](doc/api/platform/order.md)
\ No newline at end of file
  1 [订单中心接口](doc/api/platform/order.md)
## 9. 政策相关接口
  1 [政策接口](doc/api/platform/policy.md)
\ No newline at end of file
<a name="menu" href="/doc">返回主目录</a>
1. [政策检索](#policyQuery)
## **<a name="policyQuery"> 政策检索</a>**
[返回到目录](#menu)
##### URL
[/web/action/policy/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:policyQuery
``` javascript
{
"actionType": "policyQuery",
"actionBody": {
"policyName":"北京市",
"policyProvince":"北京市",
"policyCity":"北京市"
}
}
```
#### 返回结果
```javascript
{
"status":0,
"msg":"success",
"data":{
"rlzy":[
{
"policyType":"rlzy",
"policyTypeName":"人力资源",
"policyDate":"2020-02-05T14:14:24.000Z",
"policyContent":null,
"policyCity":"北京市",
"policyProvince":"北京市",
"policyLinkUrl":"http://www.beijing.gov.cn/zhengce/zhengcefagui/202002/t20200206_1625493.html",
"policySource":"京政办发〔2020〕7号",
"policyName":"北京市人民政府办公厅关于应对新型冠状病毒感染的肺炎疫情影响促进中小微企业持续健康发展的若干措施
北京市人民政府办公厅关于应对新型冠状病毒感染的肺炎疫情影响促进中小微企业持续健康发展的若干措施",
"policyNo":"bj001"
}
],
"fzbt":[
],
"jrdk":[
],
"zdfc":[
],
"ssjm":[
]
},
"requestId":"2c1ebf037aed4b30aa8e497c7a151a8e"
}
```
\ 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