Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
de29e016
Commit
de29e016
authored
Mar 17, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
b342d76e
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
326 additions
and
106 deletions
+326
-106
center-channel/app/base/api/api.base.js
+1
-2
center-channel/app/base/api/apidoc.base.js
+0
-36
center-channel/app/base/api/impl/action/enterpriseQuery.js
+2
-2
center-channel/app/base/api/impl/action/icapi.js
+2
-2
center-channel/app/base/api/impl/action/licenseQuery.js
+2
-2
center-channel/app/base/api/impl/action/opLog.js
+2
-2
center-channel/app/base/api/impl/action/patentQuery.js
+2
-2
center-channel/app/base/api/impl/action/policy.js
+2
-2
center-channel/app/base/api/impl/action/product.js
+2
-2
center-channel/app/base/api/impl/action/tmQuery.js
+2
-2
center-channel/app/base/api/impl/action/tmTools.js
+2
-2
center-channel/app/base/api/impl/action/tmTransaction.js
+2
-2
center-channel/app/base/api/impl/action/tradetransfer.js
+2
-2
center-channel/app/base/api/impl/action/zcbusinesschanceApi.js
+4
-3
center-channel/app/base/api/impl/auth/accessAuth.js
+2
-5
center-channel/app/base/api/impl/opaction/icbcOrderNotify.js
+2
-2
center-channel/app/base/api/impl/opaction/opOrder.js
+2
-2
center-channel/app/base/api/impl/opaction/order.js
+2
-2
center-channel/app/base/api/impl/opreceive/ic.js
+41
-0
center-channel/app/base/api/impl/opreceive/need.js
+8
-27
center-channel/app/base/api/impl/payment/paymentApi.js
+2
-2
center-channel/app/base/api/web.base.js
+83
-0
center-channel/app/config/routes/api.js
+62
-3
center-channel/峰擎文档
+95
-0
No files found.
center-channel/app/base/api/api.base.js
View file @
de29e016
const
system
=
require
(
"../system"
);
const
system
=
require
(
"../system"
);
const
settings
=
require
(
"../../config/settings"
);
const
settings
=
require
(
"../../config/settings"
);
const
DocBase
=
require
(
"./doc.base"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
md5
=
require
(
"MD5"
);
const
md5
=
require
(
"MD5"
);
class
APIBase
{
class
APIBase
{
...
@@ -54,7 +53,7 @@ class APIBase {
...
@@ -54,7 +53,7 @@ class APIBase {
}
}
//-----------------------新的模式------------------开始
//-----------------------新的模式------------------开始
async
doexecMetho
d
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
async
doexecMetho
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
req
.
requestId
=
this
.
getUUID
();
try
{
try
{
// //验证accesskey或验签
// //验证accesskey或验签
...
...
center-channel/app/base/api/apidoc.base.js
View file @
de29e016
...
@@ -15,42 +15,6 @@ class APIBase extends DocBase {
...
@@ -15,42 +15,6 @@ class APIBase extends DocBase {
return
u
;
return
u
;
}
}
/**
/**
* 验证签名
* @param {*} params 要验证的参数
* @param {*} app_key 应用的校验key
*/
async
verifySign
(
params
,
app_key
)
{
if
(
!
params
)
{
return
system
.
getResult
(
null
,
"请求参数为空"
);
}
if
(
!
params
.
sign
)
{
return
system
.
getResult
(
null
,
"请求参数sign为空"
);
}
if
(
!
params
.
times_tamp
)
{
return
system
.
getResult
(
null
,
"请求参数times_tamp为空"
);
}
var
signArr
=
[];
var
keys
=
Object
.
keys
(
params
).
sort
();
if
(
keys
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请求参数信息为空"
);
}
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
const
tKey
=
keys
[
k
];
if
(
tKey
!=
"sign"
&&
params
[
tKey
])
{
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
}
}
if
(
signArr
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请求参数组装签名参数信息为空"
);
}
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
app_key
;
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
();
if
(
params
.
sign
!=
resultTmpSign
)
{
return
system
.
getResult
(
null
,
"签名验证失败"
);
}
return
system
.
getResultSuccess
();
}
/**
* 白名单验证
* 白名单验证
* @param {*} gname 组名
* @param {*} gname 组名
* @param {*} methodname 方法名
* @param {*} methodname 方法名
...
...
center-channel/app/base/api/impl/action/enterpriseQuery.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
EnterpriseQueryAPI
extends
API
Base
{
class
EnterpriseQueryAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
enterSve
=
system
.
getObject
(
"service.enterprise.enterpriseSve"
);
this
.
enterSve
=
system
.
getObject
(
"service.enterprise.enterpriseSve"
);
...
...
center-channel/app/base/api/impl/action/icapi.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
IcAPI
extends
API
Base
{
class
IcAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
...
...
center-channel/app/base/api/impl/action/licenseQuery.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
LicenseQueryAPI
extends
API
Base
{
class
LicenseQueryAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
liecseSve
=
system
.
getObject
(
"service.licenses.licenseSve"
);
this
.
liecseSve
=
system
.
getObject
(
"service.licenses.licenseSve"
);
...
...
center-channel/app/base/api/impl/action/opLog.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
class
opLog
extends
API
Base
{
class
opLog
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
}
}
...
...
center-channel/app/base/api/impl/action/patentQuery.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
PatentQueryAPI
extends
API
Base
{
class
PatentQueryAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
patentSve
=
system
.
getObject
(
"service.patent.patentycSve"
);
this
.
patentSve
=
system
.
getObject
(
"service.patent.patentycSve"
);
...
...
center-channel/app/base/api/impl/action/policy.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
PolicyAPI
extends
API
Base
{
class
PolicyAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
policySve
=
system
.
getObject
(
"service.policy.policySve"
);
this
.
policySve
=
system
.
getObject
(
"service.policy.policySve"
);
...
...
center-channel/app/base/api/impl/action/product.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
ProductAPI
extends
API
Base
{
class
ProductAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsProductSve
=
system
.
getObject
(
"service.utilsSve.utilsProductSve"
);
this
.
utilsProductSve
=
system
.
getObject
(
"service.utilsSve.utilsProductSve"
);
...
...
center-channel/app/base/api/impl/action/tmQuery.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
TmQueryAPI
extends
API
Base
{
class
TmQueryAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
// this.tmqueryApi = system.getObject("api.trademark.tmqueryApi");
// this.tmqueryApi = system.getObject("api.trademark.tmqueryApi");
...
...
center-channel/app/base/api/impl/action/tmTools.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
TmToolsAPI
extends
API
Base
{
class
TmToolsAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
toolSve
=
system
.
getObject
(
"service.trademark.toolSve"
);
this
.
toolSve
=
system
.
getObject
(
"service.trademark.toolSve"
);
...
...
center-channel/app/base/api/impl/action/tmTransaction.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
TmTransactionAPI
extends
API
Base
{
class
TmTransactionAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
}
}
...
...
center-channel/app/base/api/impl/action/tradetransfer.js
View file @
de29e016
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
moment
=
require
(
'moment'
)
var
moment
=
require
(
'moment'
)
class
TradetransferAPI
extends
API
Base
{
class
TradetransferAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
...
...
center-channel/app/base/api/impl/action/zcbusinesschanceApi.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
PaymentAPI
extends
API
Base
{
class
PaymentAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
...
@@ -42,6 +42,6 @@ class PaymentAPI extends APIBase {
...
@@ -42,6 +42,6 @@ class PaymentAPI extends APIBase {
return
await
this
.
restPostUrl
(
pobj
,
url
);
return
await
this
.
restPostUrl
(
pobj
,
url
);
// return opResult;
// return opResult;
}
}
}
}
module
.
exports
=
PaymentAPI
;
module
.
exports
=
PaymentAPI
;
\ No newline at end of file
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
class
AccessAuthAPI
extends
API
Base
{
class
AccessAuthAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
...
@@ -96,9 +96,6 @@ class AccessAuthAPI extends APIBase {
...
@@ -96,9 +96,6 @@ class AccessAuthAPI extends APIBase {
* action_process 执行的流程
* action_process 执行的流程
*/
*/
async
getAppTokenByAppKey
(
pobj
,
qobj
,
req
)
{
async
getAppTokenByAppKey
(
pobj
,
qobj
,
req
)
{
console
.
log
(
"=========================测试蜂擎推送数据:"
,
JSON
.
stringify
(
pobj
));
var
token
=
this
.
getUUID
();
var
token
=
this
.
getUUID
();
pobj
.
actionBody
.
reqType
=
"appkey"
;
pobj
.
actionBody
.
reqType
=
"appkey"
;
var
opResult
=
await
this
.
utilsAuthSve
.
getReqTokenByHosts
(
pobj
.
actionBody
,
token
);
var
opResult
=
await
this
.
utilsAuthSve
.
getReqTokenByHosts
(
pobj
.
actionBody
,
token
);
...
...
center-channel/app/base/api/impl/opaction/icbcOrderNotify.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
IcbcOrderNotify
extends
API
Base
{
class
IcbcOrderNotify
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
...
...
center-channel/app/base/api/impl/opaction/opOrder.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
ProductAPI
extends
API
Base
{
class
ProductAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOpOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOpOrderSve"
);
this
.
utilsOpOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOpOrderSve"
);
...
...
center-channel/app/base/api/impl/opaction/order.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
ProductAPI
extends
API
Base
{
class
ProductAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
...
...
center-channel/app/base/api/impl/opreceive/ic.js
0 → 100644
View file @
de29e016
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
Ic
extends
APIBase
{
constructor
()
{
super
();
}
/**
* 接口跳转-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
)
{
case
"deliveryInfo"
:
//办理公司表单数据
break
;
case
"deliveryStatus"
:
//办理公司状态
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
Ic
;
\ No newline at end of file
center-channel/app/base/api/impl/
action/receiveData
.js
→
center-channel/app/base/api/impl/
opreceive/need
.js
View file @
de29e016
var
APIBase
=
require
(
"../../api.base"
);
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
/**
class
Need
extends
APIBase
{
* 接收远程推送的商标数据api
*/
class
ReceiveDataAPI
extends
APIBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
ordertmproductSve
=
system
.
getObject
(
"service.dborder.ordertmproductSve"
);
this
.
customerinfoSve
=
system
.
getObject
(
"service.dborder.customerinfoSve"
);
this
.
customercontactsSve
=
system
.
getObject
(
"service.dborder.customercontactsSve"
);
this
.
trademarkSve
=
system
.
getObject
(
"service.dbtrademark.trademarkSve"
);
this
.
zcApiUrl
=
settings
.
reqZcApi
();
this
.
pushFqbossDataUrl
=
settings
.
pushFqbossDataUrl
();
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
* action_process 执行的流程
* action_process 执行的流程
...
@@ -28,29 +19,19 @@ class ReceiveDataAPI extends APIBase {
...
@@ -28,29 +19,19 @@ class ReceiveDataAPI extends APIBase {
if
(
!
pobj
.
actionType
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
}
var
result
=
await
this
.
opActionProcess
(
pobj
.
actionProcess
,
pobj
.
actionType
,
pobj
.
actionBody
,
pobj
,
req
);
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionProcess
,
pobj
.
actionType
,
pobj
.
actionBody
,
req
);
return
result
;
return
result
;
}
}
async
opActionProcess
(
action_process
,
action_type
,
action_body
,
pobj
,
req
)
{
async
opActionProcess
(
pobj
,
action_process
,
action_type
,
action_body
,
req
)
{
// var logParam = {
// appid: req.app.id,
// appkey: req.app.uappKey,
// requestId: req.requestId || "",
// op: "/igirl-channel/zhichan/igirl-channel/app/base/api/impl/action/receiveData.js/opActionProcess",
// content: "参数信息:" + JSON.stringify(action_body),
// clientIp: pobj.clientIp,
// optitle: "接收推送过来的数据处理=>action_type=" + action_type,
// };
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"close"
:
//关闭需求
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
}
}
logParam
.
resultInfo
=
JSON
.
stringify
(
opResult
);
this
.
logCtl
.
info
(
logParam
);
return
opResult
;
return
opResult
;
}
}
}
}
module
.
exports
=
ReceiveDataAPI
;
module
.
exports
=
Need
;
\ No newline at end of file
\ No newline at end of file
center-channel/app/base/api/impl/payment/paymentApi.js
View file @
de29e016
var
APIBase
=
require
(
"../../api
.base"
);
var
WEBBase
=
require
(
"../../web
.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
PaymentAPI
extends
API
Base
{
class
PaymentAPI
extends
WEB
Base
{
constructor
()
{
constructor
()
{
super
();
super
();
// this.execlient = system.getObject("util.execClient");
// this.execlient = system.getObject("util.execClient");
...
...
center-channel/app/base/api/web.base.js
0 → 100644
View file @
de29e016
const
system
=
require
(
"../system"
);
const
settings
=
require
(
"../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
md5
=
require
(
"MD5"
);
class
WEBBase
{
constructor
()
{
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
toolSve
=
system
.
getObject
(
"service.trademark.toolSve"
);
this
.
exTime
=
6
*
3600
;
//缓存过期时间,6小时
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
//-----------------------新的模式------------------开始
async
doexecMethod
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
try
{
// //验证accesskey或验签
// var isPassResult = await this.checkAcck(gname, methodname, pobj, query, req);
// if (isPassResult.status != 0) {
// isPassResult.requestId = "";
// return isPassResult;
// }
var
rtn
=
await
this
[
methodname
](
pobj
,
query
,
req
);
this
.
logCtl
.
createDb
({
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
rtn
),
clientIp
:
req
.
clientIp
,
agent
:
req
.
uagent
,
opTitle
:
"api服务提供方appKey:"
+
settings
.
appKey
,
});
rtn
.
requestId
=
req
.
requestId
;
return
rtn
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
this
.
logCtl
.
createDb
({
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
e
.
stack
),
clientIp
:
req
.
clientIp
,
agent
:
req
.
uagent
,
opTitle
:
"api调用出现异常,请联系管理员error,appKey:"
+
settings
.
appKey
,
});
this
.
logCtl
.
error
({
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
,
op
:
req
.
classname
+
"/"
+
methodname
,
content
:
e
.
stack
,
clientIp
:
pobj
.
clientIp
,
agent
:
req
.
uagent
,
optitle
:
"api调用出现异常,请联系管理员"
,
});
var
rtnerror
=
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
rtnerror
.
requestId
=
req
.
requestId
;
return
rtnerror
;
}
}
//-----------------------新的模式------------------结束
async
restPostUrl
(
pobj
,
url
)
{
var
rtn
=
await
this
.
restClient
.
execPost
(
pobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"restPost data is empty"
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
}
module
.
exports
=
WEBBase
;
center-channel/app/config/routes/api.js
View file @
de29e016
...
@@ -5,7 +5,8 @@ const logCtl = system.getObject("service.common.oplogSve");
...
@@ -5,7 +5,8 @@ const logCtl = system.getObject("service.common.oplogSve");
const
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
const
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
//-----------------------新的模式------------------开始
//-----------------------新的模式---------web---------开始
app
.
use
(
'/tlpay/notify'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/tlpay/notify'
,
async
function
(
req
,
res
)
{
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
...
@@ -143,7 +144,7 @@ module.exports = function (app) {
...
@@ -143,7 +144,7 @@ module.exports = function (app) {
var
p
=
null
;
var
p
=
null
;
var
invokeObj
=
system
.
getObject
(
"api."
+
classPath
);
var
invokeObj
=
system
.
getObject
(
"api."
+
classPath
);
if
(
invokeObj
[
"doexecMethod"
])
{
if
(
invokeObj
[
"doexecMethod"
])
{
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
req
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
}
}
p
.
then
(
r
=>
{
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
res
.
end
(
JSON
.
stringify
(
r
));
...
@@ -176,5 +177,63 @@ module.exports = function (app) {
...
@@ -176,5 +177,63 @@ module.exports = function (app) {
});
});
});
});
//-----------------------新的模式------------------结束
//-----------------------新的模式---------web---------结束
//-----------------------新的模式---------api---------开始
app
.
get
(
'/api/:gname/:qname/:method'
,
function
(
req
,
res
)
{
var
classPath
=
req
.
params
[
"qname"
];
var
methodName
=
req
.
params
[
"method"
];
var
gname
=
req
.
params
[
"gname"
];
classPath
=
gname
+
"."
+
classPath
;
var
tClientIp
=
system
.
get_client_ip
(
req
);
req
.
clientIp
=
tClientIp
;
req
req
.
uagent
=
req
.
headers
[
"user-agent"
];
req
.
classname
=
classPath
;
var
params
=
[];
params
.
push
(
gname
);
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
params
.
push
(
req
.
query
);
params
.
push
(
req
);
var
p
=
null
;
var
invokeObj
=
system
.
getObject
(
"api."
+
classPath
);
if
(
invokeObj
[
"doexecMethod"
])
{
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
}
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
});
});
app
.
post
(
'/api/:gname/:qname/:method'
,
function
(
req
,
res
)
{
var
classPath
=
req
.
params
[
"qname"
];
var
methodName
=
req
.
params
[
"method"
];
var
gname
=
req
.
params
[
"gname"
];
var
params
=
[];
classPath
=
gname
+
"."
+
classPath
;
var
tClientIp
=
system
.
get_client_ip
(
req
);
req
.
clientIp
=
tClientIp
;
req
.
uagent
=
req
.
headers
[
"user-agent"
];
req
.
classname
=
classPath
;
params
.
push
(
gname
);
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
params
.
push
(
req
.
query
);
params
.
push
(
req
);
var
p
=
null
;
var
invokeObj
=
system
.
getObject
(
"api."
+
classPath
);
if
(
invokeObj
[
"doexecMethod"
])
{
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
}
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
});
});
//-----------------------新的模式---------api---------结束
};
};
center-channel/峰擎文档
0 → 100644
View file @
de29e016
1.获取请求token
1.获取请求token
[/web/auth/accessAuth/getAppTokenByAppKey]
请求方式:POST
参数格式 JSON
HTTP请求方式 POST
{
"actionType":"getAppTokenByAppKey",//固定写法就行
"actionBody":{
"appkey": "2019090811", //Y string appkey
"secret": "f99d413b767f09b5dff0b3610366cc46"//Y string 密钥
}
}
返回结果
{
"status": 0,
"msg": "success",
"data": {
"token": "40d64e586551405c9bcafab87266bc04" //token用于其他接口请求时,放在请求头中
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
2.查看需求方案列表信息
地址:[/#/comapnylist?needNo=XXX&userId=jfklajflsjfs&nickName=松XXX&mobile=15010929368&orgName=汉唐集团]
请求方式:GET
请求头中需要有token(token值从接口1中获取)
参数说明:
参数说明:
needNo//需求号
userId//用户唯一码
nickName//用户名称
mobile//用户手机号
orgName//公司名称
3.推送公司表单材料
地址:[/api/opreceive/ic/springBoard]
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "deliveryInfo", // 办理公司表单数据
"actionBody": {
"serviceNo":"xxxxxxxxx",// Y 你那边订单号
.
.//为你那边的数据
.
}
}
返回结果
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": null,
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
4.推送公司状态
地址:[/api/opreceive/ic/springBoard]
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "deliveryStatus", // 办理公司状态
"actionBody": {
"serviceNo":"xxxxxxxxx",// Y 你那边订单号
.
.//为你那边的数据
.
}
}
返回结果
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": null,
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
4.关闭需求接口
地址:[/api/opreceive/need/springBoard]
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "close", // 关闭需求
"actionBody": {
"needNo":"xxxxxxxxx"//需求号
}
}
返回结果
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": null,
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment