Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjh5
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
gjjh5
Commits
84cae192
Commit
84cae192
authored
Feb 26, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gjj
parent
f8202ade
Pipeline
#3917
passed with stage
in 3 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
8 deletions
+96
-8
order.js
app/controller/order.js
+3
-3
cusdata.js
app/model/cusdata.js
+82
-0
taskStatus.js
app/model/taskStatus.js
+0
-3
router.js
app/router.js
+1
-1
storage.js
app/service/storage.js
+6
-1
config.default.js
config/config.default.js
+4
-0
No files found.
app/controller/order.js
View file @
84cae192
...
...
@@ -16,7 +16,7 @@ class OrderController extends Controller {
type
:
'object'
,
rule
:
{
token
:
'string'
,
order
Sn
:
'string'
,
order
Id
:
'string'
,
appKey
:
'string'
,
timestamp
:
'string'
,
},
...
...
@@ -66,12 +66,12 @@ class OrderController extends Controller {
const
{
ctx
,
service
}
=
this
;
try
{
ctx
.
validate
(
this
.
showRule
);
const
orderId
=
ctx
.
request
.
body
.
params
.
orderSn
;
const
{
appKey
,
orderId
}
=
ctx
.
request
.
body
.
params
;
await
service
.
signature
.
signatureCheck
(
ctx
.
request
.
body
);
const
data
=
await
service
.
order
.
getOneByOrderId
(
orderId
);
if
(
data
)
{
if
(
data
.
status
===
'success'
)
{
const
result
=
await
service
.
storage
.
read
(
orderId
);
const
result
=
await
service
.
storage
.
read
(
orderId
,
appKey
);
ctx
.
body
=
{
code
:
0
,
data
:
result
...
...
app/model/cusdata.js
0 → 100644
View file @
84cae192
'use strict'
;
module
.
exports
=
app
=>
{
const
{
DataTypes
}
=
app
.
Sequelize
;
const
cusDatas
=
app
.
model
.
define
(
'cusDatas'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
autoIncrement
:
true
,
primaryKey
:
true
,
field
:
'id'
,
},
orderId
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
defaultValue
:
''
,
primaryKey
:
true
,
field
:
'orderId'
,
},
appKey
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
field
:
'appKey'
,
},
type
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'type'
,
},
date
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'date'
,
},
text1
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text1'
,
},
text2
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text2'
,
},
text3
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text3'
,
},
text4
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text4'
,
},
date1
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'date1'
,
},
date2
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'date2'
,
},
},
{
tableName
:
'cus_data'
,
timestamps
:
false
,
});
return
cusDatas
;
}
\ No newline at end of file
app/model/taskStatus.js
View file @
84cae192
...
...
@@ -15,7 +15,6 @@ module.exports = app => {
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
defaultValue
:
''
,
primaryKey
:
true
,
field
:
'orderId'
,
},
taskId
:
{
...
...
@@ -76,7 +75,6 @@ module.exports = app => {
createDate
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
primaryKey
:
true
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'createDate'
,
},
...
...
@@ -84,7 +82,6 @@ module.exports = app => {
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
primaryKey
:
true
,
field
:
'updateDate'
,
},
text1
:
{
...
...
app/router.js
View file @
84cae192
...
...
@@ -35,7 +35,7 @@ module.exports = app => {
gjjRouter
.
post
(
'/getToken'
,
controller
.
token
.
partnerCreate
);
// 合作方创建token
gjjRouter
.
post
(
'/get
d
ata'
,
controller
.
order
.
partnerShow
);
// 合作方获取订单数据
gjjRouter
.
post
(
'/get
D
ata'
,
controller
.
order
.
partnerShow
);
// 合作方获取订单数据
gjjRouter
.
post
(
'/getCityConfig'
,
controller
.
task
.
fetchCityConfig
)
//获取城市配置
...
...
app/service/storage.js
View file @
84cae192
...
...
@@ -42,7 +42,7 @@ class StorageService extends Service {
return
;
}
async
read
(
orderId
)
{
async
read
(
orderId
,
appKey
)
{
const
{
readUrl
,
readDataKey
,
ctx
}
=
this
;
const
result
=
await
this
.
_request
(
`
${
readUrl
}
/
${
orderId
}
`
,
{
method
:
'get'
,
...
...
@@ -54,6 +54,11 @@ class StorageService extends Service {
ctx
.
logger
.
error
(
`storageAPI read
${
readUrl
}
/
${
orderId
}
`
,
JSON
.
stringify
(
result
.
data
));
ctx
.
throw
(
400
,
{
message
:
result
.
data
.
msg
});
}
await
ctx
.
model
.
Cusdata
.
create
({
appKey
,
orderId
,
type
:
'gjj'
})
return
result
.
data
.
data
[
readDataKey
];
}
}
...
...
config/config.default.js
View file @
84cae192
...
...
@@ -11,6 +11,10 @@ module.exports = appInfo => {
// add your config here
config
.
middleware
=
[
'requestLog'
,
'errorHandler'
];
config
.
logrotator
=
{
maxDays
:
1
,
}
// config.verifyAppKey = {
// match: '/orders',
// }
...
...
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