Commit cd7497c0 authored by 何娜's avatar 何娜

tax_api修改接口

parent 9937b5e6
Pipeline #6518 passed with stage
in 8 seconds
......@@ -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,
......
'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
......@@ -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); // 处理回调结果,不对外
......
......@@ -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,
......
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