Commit e9260028 by 庄冰

res

parent bf011d7d
...@@ -19,19 +19,20 @@ class Consultation extends APIBase { ...@@ -19,19 +19,20 @@ class Consultation extends APIBase {
} }
getResultSuccess(requestId) { getResultSuccess(requestId) {
return { return {
"requestId": requestId, "status": 0,
"success": true, "msg": "success",
"errorMsg": "", "data":null,
"errorCode": "ok" "requestId": requestId
} };
} }
getResultFail(errmsg) { getResultFail(errmsg) {
var self = this; var self = this;
return { return {
"status":-1,
"msg": errmsg,
"requestId": self.getUUID(), "requestId": self.getUUID(),
"success": false, "data":null,
"errorMsg": errmsg, "bizmsg":"empty"
"errorCode": "ok"
}; };
} }
...@@ -50,6 +51,12 @@ class Consultation extends APIBase { ...@@ -50,6 +51,12 @@ class Consultation extends APIBase {
if (!pobj.consultType) { if (!pobj.consultType) {
return self.getResultFail("consultType不能为空"); return self.getResultFail("consultType不能为空");
} }
if (pobj.consultType=="ICP") {
pobj.consultType="5";
}
if (pobj.consultType=="EDI") {
pobj.consultType="7";
}
pobj.type = pobj.consultType; pobj.type = pobj.consultType;
pobj.mobile = pobj.phone; pobj.mobile = pobj.phone;
pobj.action_type = "submitIcpNeed"; pobj.action_type = "submitIcpNeed";
......
...@@ -19,19 +19,20 @@ class Feedback extends APIBase { ...@@ -19,19 +19,20 @@ class Feedback extends APIBase {
} }
getResultSuccess(requestId) { getResultSuccess(requestId) {
return { return {
"requestId": requestId, "status": 0,
"success": true, "msg": "success",
"errorMsg": "", "data":null,
"errorCode": "ok" "requestId": requestId
} };
} }
getResultFail(errmsg) { getResultFail(errmsg) {
var self = this; var self = this;
return { return {
"status":-1,
"msg": errmsg,
"requestId": self.getUUID(), "requestId": self.getUUID(),
"success": false, "data":null,
"errorMsg": errmsg, "bizmsg":"empty"
"errorCode": "ok"
}; };
} }
......
...@@ -19,19 +19,20 @@ class Order extends APIBase { ...@@ -19,19 +19,20 @@ class Order extends APIBase {
} }
getResultSuccess(requestId) { getResultSuccess(requestId) {
return { return {
"requestId": requestId, "status": 0,
"success": true, "msg": "success",
"errorMsg": "", "data":null,
"errorCode": "ok" "requestId": requestId
} };
} }
getResultFail(errmsg) { getResultFail(errmsg) {
var self = this; var self = this;
return { return {
"status":-1,
"msg": errmsg,
"requestId": self.getUUID(), "requestId": self.getUUID(),
"success": false, "data":null,
"errorMsg": errmsg, "bizmsg":"empty"
"errorCode": "ok"
}; };
} }
...@@ -57,6 +58,13 @@ class Order extends APIBase { ...@@ -57,6 +58,13 @@ class Order extends APIBase {
} }
if (pobj.isDirectBuy==1 && !pobj.consultType) { if (pobj.isDirectBuy==1 && !pobj.consultType) {
return self.getResultFail("直接下单consultType不能为空"); return self.getResultFail("直接下单consultType不能为空");
}else{
if (pobj.consultType=="ICP") {
pobj.consultType="5";
}
if (pobj.consultType=="EDI") {
pobj.consultType="7";
}
} }
pobj.action_type = "icpOrderStatus"; pobj.action_type = "icpOrderStatus";
var param = { var param = {
......
...@@ -103,11 +103,13 @@ class SignService{ ...@@ -103,11 +103,13 @@ class SignService{
module.exports = SignService; module.exports = SignService;
// var task = new SignService(); // var task = new SignService();
// var obj = { // var obj = {
// "bizId":"ICP202010221032hhvcUV2", // "intentionBizId": "TRE-nmnHtEoTjeEtest",
// "isDirectBuy":"0", // "phone": "13126673246",
// "orderNo":"ICPO20201022103hhvcUV2" // "userName": "",
// ,"sign": "4F598C56E565628107B5A9A851D4B6A4" // "description": "111111",
// }; // "area": "BEIJING",
// "consultType": "EDI"
// };
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(d=>{ // task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!"); // console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!");
// }); // });
...@@ -67,4 +67,6 @@ ...@@ -67,4 +67,6 @@
  1 [需求相关接口](doc/api/platform/opNeed.md)   1 [需求相关接口](doc/api/platform/opNeed.md)
## 21. 诊断运营端相关接口 ## 21. 诊断运营端相关接口
  1 [诊断运营端相关接口](doc/api/appDesc/diagnosisneedbusDesc.md)   1 [诊断运营端相关接口](doc/api/appDesc/diagnosisneedbusDesc.md)
\ No newline at end of file ## 22. 百度ICP对接相关接口
  1 [ICP订单接口](doc/api/platform/baiduIcp.md)
\ No newline at end of file
<a name="menu" href="/doc">返回主目录</a>
1. [接口调用说明](#interfaceDesc)
1. [同步需求给服务商](#consultationsubmit)
## **<a name="interfaceDesc"> 接口调用说明</a>**
[返回到目录](#menu)
##### 接口描述
统一的接口调用,调用其他接口参考此示例
#### sign签名规则
所有请求参数(去除sign参数)首字符进行ASCII正序排序,对排序后的参数值进行签名,如:area=1&consultType=5&description=需求测试_001&intentionBizIdI=20200320201737000001&phone=13800138000&userName=李四
其中参数值拼接后最后在加上key,key为获取的密钥信息,拼接后字符串:
area=1&consultType=5&description=需求测试_001&intentionBizIdI=20200320201737000001&phone=13800138000&userName=李四&key=7cbb892450174167b5c7e01we4716t51
之后对拼接的字符串进行md5加密就得到sign值
## **<a name="consultationsubmit"> 同步需求给服务商</a>**
[返回到目录](#menu)
##### 接⼝描述
合作方⽤户提交服务咨询后(需求订单),调⽤服务商接⼝提交服务咨询信息
##### URL
[/api/icp/consultation/submit]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加appkey的值
#### 请求参数
#### 参数示例
``` javascript
{
"intentionBizId": "zhuangbingceshi008",
"phone": "13075556693",
"userName": "庄冰",
"description": "1111111111111222",
"area": "1",
"consultType": 5,
"sign": "2713C75F75B0713E525EEB39BB7D5BD3"
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "a277fb799d9f4dda9053fb8830f9d252"
}
```
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