Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tax_api
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
tax_api
Commits
cd7497c0
Commit
cd7497c0
authored
Apr 26, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tax_api修改接口
parent
9937b5e6
Pipeline
#6518
passed with stage
in 8 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
order.js
app/controller/order.js
+8
-4
helper.js
app/extend/helper.js
+6
-0
router.js
app/router.js
+3
-3
config.local.js
config/config.local.js
+1
-1
No files found.
app/controller/order.js
View file @
cd7497c0
...
...
@@ -79,10 +79,14 @@ class OrderController extends Controller {
async
fetchOrderId
()
{
const
{
ctx
,
service
}
=
this
;
try
{
ctx
.
validate
(
this
.
fetchRule
);
const
{
appKey
}
=
ctx
.
request
.
body
.
signParams
.
params
;
const
{
cityId
}
=
ctx
.
request
.
body
;
const
orderId
=
await
service
.
signature
.
createOrderId
(
ctx
.
request
.
body
.
signParams
);
const
{
appKey
,
cityId
}
=
ctx
.
params
;
// const appKeyInfo = await service.partner.fetchInfo(appKey);
// ctx.logger.info(appKey, ',appKeyInfo,', appKeyInfo);
// if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableIt === true)) {
// return ctx.fail('未开通此服务');
// }
const
orderId
=
ctx
.
helper
.
getUuid
();
const
taskId
=
await
service
.
task
.
create
({
cityId
});
await
service
.
order
.
create
({
orderId
,
...
...
app/extend/helper.js
View file @
cd7497c0
'use strict'
;
const
querystring
=
require
(
'querystring'
);
const
crypto
=
require
(
'crypto'
);
const
uuid
=
require
(
'uuid/v1'
);
function
process
(
params
)
{
const
keys
=
Object
.
keys
(
params
)
...
...
@@ -56,4 +57,8 @@ module.exports.paramSign = function(appSecret, params) {
.
digest
(
'hex'
)
.
toUpperCase
();
return
signStr
;
};
module
.
exports
.
getUuid
=
function
()
{
return
uuid
();
};
\ No newline at end of file
app/router.js
View file @
cd7497c0
...
...
@@ -8,16 +8,16 @@ module.exports = app => {
const
taxRouter
=
router
.
namespace
(
app
.
config
.
projectRootPath
);
taxRouter
.
post
(
'/getToken'
,
controller
.
token
.
partnerCreate
);
// 合作方创建token
taxRouter
.
get
(
'/getCity'
,
controller
.
task
.
cityConfigs
);
// 获取城市基础配置项
taxRouter
.
post
(
'/getorderSn
'
,
controller
.
order
.
fetchOrderId
);
// 合作方获取订单号
taxRouter
.
get
(
'/getorderSn/:appKey/:cityId
'
,
controller
.
order
.
fetchOrderId
);
// 合作方获取订单号
taxRouter
.
post
(
'/getCode'
,
controller
.
task
.
fetchCapture
);
// 获取验证码
taxRouter
.
post
(
'/query'
,
controller
.
task
.
submit
);
// 提交任务查询参数
taxRouter
.
post
(
'/getToken'
,
controller
.
token
.
partnerCreate
);
// 合作方创建token
taxRouter
.
post
(
'/getData'
,
controller
.
order
.
partnerShow
);
// 合作方获取订单数据
taxRouter
.
post
(
'/callback'
,
controller
.
task
.
handleCallback
);
// 处理回调结果,不对外
...
...
config/config.local.js
View file @
cd7497c0
...
...
@@ -86,7 +86,7 @@ module.exports = () => {
baseDir
:
'model'
,
dialect
:
'mysql'
,
host
:
'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com'
,
database
:
'data_service_
dev
'
,
database
:
'data_service_
uat
'
,
username
:
'hexin'
,
password
:
'gYUHszn9#q'
,
port
:
3306
,
...
...
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