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
a9df38d1
Commit
a9df38d1
authored
Feb 27, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gjj
parent
a992ea2b
Pipeline
#3934
passed with stage
in 8 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
25 deletions
+30
-25
order.js
app/controller/order.js
+3
-2
taskStatus.js
app/model/taskStatus.js
+11
-5
router.js
app/router.js
+1
-1
order.js
app/service/order.js
+2
-2
partner.js
app/service/partner.js
+4
-4
config.default.js
config/config.default.js
+0
-2
config.local.js
config/config.local.js
+2
-1
config.prod.js
config/config.prod.js
+7
-8
No files found.
app/controller/order.js
View file @
a9df38d1
...
@@ -28,14 +28,15 @@ class OrderController extends Controller {
...
@@ -28,14 +28,15 @@ class OrderController extends Controller {
const
{
ctx
,
service
}
=
this
;
const
{
ctx
,
service
}
=
this
;
const
uuid
=
require
(
'node-uuid'
);
const
uuid
=
require
(
'node-uuid'
);
ctx
.
validate
(
this
.
createRule
);
ctx
.
validate
(
this
.
createRule
);
const
{
appKey
,
userId
,
notifyUrl
}
=
ctx
.
request
.
body
;
const
{
appKey
,
userId
,
notifyUrl
,
backUrl
}
=
ctx
.
request
.
body
;
const
orderId
=
uuid
.
v1
();
const
orderId
=
uuid
.
v1
();
await
service
.
order
.
create
({
await
service
.
order
.
create
({
orderId
,
orderId
,
taskId
:
''
,
taskId
:
''
,
userId
:
userId
,
userId
:
userId
,
cityId
:
''
,
cityId
:
''
,
callbackUrl
:
notifyUrl
||
''
,
notifyUrl
:
notifyUrl
||
''
,
backUrl
:
backUrl
||
''
,
appKey
:
appKey
,
appKey
:
appKey
,
status
:
'init'
,
status
:
'init'
,
});
});
...
...
app/model/taskStatus.js
View file @
a9df38d1
...
@@ -19,7 +19,7 @@ module.exports = app => {
...
@@ -19,7 +19,7 @@ module.exports = app => {
},
},
taskId
:
{
taskId
:
{
type
:
DataTypes
.
STRING
(
255
),
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
fals
e
,
allowNull
:
tru
e
,
defaultValue
:
''
,
defaultValue
:
''
,
field
:
'taskId'
,
field
:
'taskId'
,
},
},
...
@@ -40,11 +40,17 @@ module.exports = app => {
...
@@ -40,11 +40,17 @@ module.exports = app => {
allowNull
:
false
,
allowNull
:
false
,
field
:
'appKey'
,
field
:
'appKey'
,
},
},
callbackUrl
:
{
notifyUrl
:
{
type
:
DataTypes
.
STRING
(
255
),
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
false
,
allowNull
:
true
,
defaultValue
:
''
,
field
:
'notifyUrl'
,
},
backUrl
:
{
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
true
,
defaultValue
:
''
,
defaultValue
:
''
,
field
:
'
call
backUrl'
,
field
:
'backUrl'
,
},
},
status
:
{
status
:
{
type
:
DataTypes
.
STRING
(
255
),
type
:
DataTypes
.
STRING
(
255
),
...
...
app/router.js
View file @
a9df38d1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
module
.
exports
=
app
=>
{
module
.
exports
=
app
=>
{
const
{
router
,
controller
}
=
app
;
const
{
router
,
controller
}
=
app
;
const
gjjRouter
=
app
.
router
.
namespace
(
app
.
config
.
path
);
const
gjjRouter
=
app
.
router
.
namespace
(
app
.
config
.
p
rojectRootP
ath
);
gjjRouter
.
post
(
'/tasks'
,
controller
.
task
.
create
);
// 创建任务
gjjRouter
.
post
(
'/tasks'
,
controller
.
task
.
create
);
// 创建任务
gjjRouter
.
get
(
'/tasks/:taskId'
,
controller
.
task
.
show
);
// 获取任务状态
gjjRouter
.
get
(
'/tasks/:taskId'
,
controller
.
task
.
show
);
// 获取任务状态
gjjRouter
.
post
(
'/tasks/:taskId/submit'
,
controller
.
task
.
submit
);
// 提交任务参数
gjjRouter
.
post
(
'/tasks/:taskId/submit'
,
controller
.
task
.
submit
);
// 提交任务参数
...
...
app/service/order.js
View file @
a9df38d1
...
@@ -38,9 +38,9 @@ class OrderService extends Service {
...
@@ -38,9 +38,9 @@ class OrderService extends Service {
if
(
!
order
)
{
if
(
!
order
)
{
ctx
.
throw
(
400
,
{
message
:
'no order'
});
ctx
.
throw
(
400
,
{
message
:
'no order'
});
}
}
const
{
appKey
,
taskId
}
=
order
;
const
{
appKey
,
taskId
,
notifyUrl
,
backUrl
,
userId
}
=
order
;
if
(
taskId
)
{
if
(
taskId
)
{
await
ctx
.
model
.
TaskStatus
.
create
({
appKey
,
status
:
'init'
,
...
params
})
await
ctx
.
model
.
TaskStatus
.
create
({
appKey
,
status
:
'init'
,
notifyUrl
,
backUrl
,
userId
,
...
params
})
}
else
{
}
else
{
await
order
.
update
(
params
);
await
order
.
update
(
params
);
}
}
...
...
app/service/partner.js
View file @
a9df38d1
...
@@ -89,9 +89,9 @@ class PartnerService extends Service {
...
@@ -89,9 +89,9 @@ class PartnerService extends Service {
async
notice
(
order
)
{
async
notice
(
order
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
{
orderId
,
callback
Url
,
userId
,
notice
}
=
order
;
const
{
orderId
,
notify
Url
,
userId
,
notice
}
=
order
;
if
(
callback
Url
&&
notice
!==
'1'
)
{
if
(
notify
Url
&&
notice
!==
'1'
)
{
const
ret
=
await
ctx
.
curl
(
callback
Url
,
{
const
ret
=
await
ctx
.
curl
(
notify
Url
,
{
charset
:
'utf-8'
,
charset
:
'utf-8'
,
timeout
:
[
'30s'
,
'30s'
],
timeout
:
[
'30s'
,
'30s'
],
contentType
:
'json'
,
contentType
:
'json'
,
...
@@ -103,7 +103,7 @@ class PartnerService extends Service {
...
@@ -103,7 +103,7 @@ class PartnerService extends Service {
},
},
}
}
)
)
ctx
.
logger
.
info
(
`【Partner】 notice
${
callback
Url
}
`
,
'orderId:'
,
orderId
,
'result:'
,
ret
.
status
,
JSON
.
stringify
(
ret
.
data
));
ctx
.
logger
.
info
(
`【Partner】 notice
${
notify
Url
}
`
,
'orderId:'
,
orderId
,
'result:'
,
ret
.
status
,
JSON
.
stringify
(
ret
.
data
));
if
(
ret
.
status
==
200
)
{
if
(
ret
.
status
==
200
)
{
await
order
.
update
({
notice
:
'1'
});
await
order
.
update
({
notice
:
'1'
});
}
}
...
...
config/config.default.js
View file @
a9df38d1
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
module
.
exports
=
appInfo
=>
{
module
.
exports
=
appInfo
=>
{
const
config
=
exports
=
{};
const
config
=
exports
=
{};
config
.
path
=
'/gjjh5'
;
// use for cookie sign key, should change to your own and keep security
// use for cookie sign key, should change to your own and keep security
config
.
keys
=
appInfo
.
name
+
'_1542452126322_5140'
;
config
.
keys
=
appInfo
.
name
+
'_1542452126322_5140'
;
...
...
config/config.local.js
View file @
a9df38d1
...
@@ -4,6 +4,8 @@ module.exports = () => {
...
@@ -4,6 +4,8 @@ module.exports = () => {
const
config
=
exports
=
{};
const
config
=
exports
=
{};
config
.
debug
=
true
;
config
.
debug
=
true
;
config
.
projectRootPath
=
'/gjjh5'
;
// config.redis = {
// config.redis = {
// client: {
// client: {
// port: 6379,
// port: 6379,
...
@@ -74,7 +76,6 @@ module.exports = () => {
...
@@ -74,7 +76,6 @@ module.exports = () => {
fecthParnters
:
'URANUS.PARNTERS.LOCK'
,
fecthParnters
:
'URANUS.PARNTERS.LOCK'
,
taskPrefix
:
'URANUS.TASK'
,
taskPrefix
:
'URANUS.TASK'
,
};
};
config
.
projectRootPath
=
''
;
config
.
sequelize
=
{
config
.
sequelize
=
{
datasources
:
[{
datasources
:
[{
...
...
config/config.prod.js
View file @
a9df38d1
...
@@ -8,7 +8,7 @@ module.exports = () => {
...
@@ -8,7 +8,7 @@ module.exports = () => {
dir
:
'/jianbing/logs/gjjh5'
,
dir
:
'/jianbing/logs/gjjh5'
,
};
};
config
.
projectRootPath
=
'/gjjh5'
;
// config.redis = {
// config.redis = {
// client: {
// client: {
// port: 6379,
// port: 6379,
...
@@ -18,7 +18,7 @@ module.exports = () => {
...
@@ -18,7 +18,7 @@ module.exports = () => {
// },
// },
// };
// };
config
.
taskAPI
=
{
config
.
taskAPI
=
{
host
:
'http://tm.51gjj.com:4821'
,
host
:
process
.
env
.
TASKAPI_HOST
||
'http://tm.51gjj.com:4821'
,
fetchHubsUrl
:
''
,
fetchHubsUrl
:
''
,
createTaskUrl
:
'/gjjServices/createGjjTask'
,
createTaskUrl
:
'/gjjServices/createGjjTask'
,
fetchCodeUrl
:
'/gjjServices/queryGjjCode'
,
fetchCodeUrl
:
'/gjjServices/queryGjjCode'
,
...
@@ -27,7 +27,7 @@ module.exports = () => {
...
@@ -27,7 +27,7 @@ module.exports = () => {
};
};
config
.
scriptsAPI
=
{
config
.
scriptsAPI
=
{
host
:
'https://uat-nginx.jianbing.com/zeus-api/v1'
,
host
:
process
.
env
.
SCRIPTSAPI_HOST
||
'https://uat-nginx.jianbing.com/zeus-api/v1'
,
fetchScriptsUrl
:
'/chaos/hf/two_dimension_array/queries'
,
fetchScriptsUrl
:
'/chaos/hf/two_dimension_array/queries'
,
fetchOneScriptUrl
:
'/chaos/hf/two_dimension_array/info'
,
fetchOneScriptUrl
:
'/chaos/hf/two_dimension_array/info'
,
fetchParamsInfoUrl
:
'/chaos/hf/login_param_map'
,
fetchParamsInfoUrl
:
'/chaos/hf/login_param_map'
,
...
@@ -41,7 +41,7 @@ module.exports = () => {
...
@@ -41,7 +41,7 @@ module.exports = () => {
};
};
config
.
storageAPI
=
{
config
.
storageAPI
=
{
host
:
'http://tv.51gjj.com:11252'
,
host
:
process
.
env
.
STORAGEAPI_HOST
||
'http://tv.51gjj.com:11252'
,
writeUrl
:
'/data'
,
writeUrl
:
'/data'
,
readUrl
:
'/gjj'
,
readUrl
:
'/gjj'
,
writeType
:
'gjj'
,
writeType
:
'gjj'
,
...
@@ -49,12 +49,12 @@ module.exports = () => {
...
@@ -49,12 +49,12 @@ module.exports = () => {
};
};
config
.
washAPI
=
{
config
.
washAPI
=
{
host
:
'http://tt.51gjj.com:11101'
,
host
:
process
.
env
.
WASHAPI_HOST
||
'http://tt.51gjj.com:11101'
,
washUrl
:
'/gjj/analyzeGjj'
,
washUrl
:
'/gjj/analyzeGjj'
,
};
};
config
.
signatureAPI
=
{
config
.
signatureAPI
=
{
host
:
'http://tj3.51gjj.com:5118'
,
host
:
process
.
env
.
SIGNATUREAPI_HOST
||
'http://tj3.51gjj.com:5118'
,
fetchTokenUrl
:
'/Access/GetToken'
,
fetchTokenUrl
:
'/Access/GetToken'
,
fetchOrderIdUrl
:
'/Order/GetOrderSn'
,
fetchOrderIdUrl
:
'/Order/GetOrderSn'
,
signatureUrl
:
'/Access/SignValidityCheck'
,
signatureUrl
:
'/Access/SignValidityCheck'
,
...
@@ -63,7 +63,7 @@ module.exports = () => {
...
@@ -63,7 +63,7 @@ module.exports = () => {
};
};
config
.
partnerAPI
=
{
config
.
partnerAPI
=
{
host
:
'https://uat-nginx.jianbing.com/zeus-api/v1'
,
host
:
process
.
env
.
PARTNERAPI_HOST
||
'https://uat-nginx.jianbing.com/zeus-api/v1'
,
fetchTheme
:
'/chaos/hf/partners'
,
fetchTheme
:
'/chaos/hf/partners'
,
fetchScripts
:
'/chaos/partners/scripts'
,
fetchScripts
:
'/chaos/partners/scripts'
,
fetchAgreements
:
'/chaos/agreements'
,
fetchAgreements
:
'/chaos/agreements'
,
...
@@ -79,7 +79,6 @@ module.exports = () => {
...
@@ -79,7 +79,6 @@ module.exports = () => {
fecthParnters
:
'URANUS.PARNTERS.LOCK'
,
fecthParnters
:
'URANUS.PARNTERS.LOCK'
,
taskPrefix
:
'URANUS.HFH5.TASK'
,
taskPrefix
:
'URANUS.HFH5.TASK'
,
};
};
config
.
projectRootPath
=
''
;
config
.
sequelize
=
{
config
.
sequelize
=
{
datasources
:
[{
datasources
:
[{
...
...
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