Commit 11c5db8e authored by 姜登's avatar 姜登

notify

parent 45b5c8a8
Pipeline #3901 passed with stage
in 3 seconds
......@@ -28,13 +28,14 @@ class OrderController extends Controller {
const { ctx, service } = this;
const uuid = require('node-uuid');
ctx.validate(this.createRule);
const { appKey,userId } = ctx.request.body;
const { appKey, userId, notifyUrl } = ctx.request.body;
const orderId = uuid.v1();
await service.order.create({
orderId,
taskId: '',
userId: userId,
cityId: '',
callbackUrl: notifyUrl || '',
appKey: appKey,
status: 'init',
});
......@@ -84,7 +85,7 @@ class OrderController extends Controller {
};
} catch (err) {
ctx.status = 200;
if(err.code == 'invalid_param'){
if (err.code == 'invalid_param') {
return ctx.body = { code: -1, message: err.message || '' };
}
return ctx.body = { code: err.code || -1, message: err.message || '' };
......
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