Commit 18b23285 authored by 姜登's avatar 姜登

gjjapi

parent 448b7b07
Pipeline #11008 passed with stage
in 10 seconds
'use strict';
module.exports = app => {
const { DataTypes } = app.Sequelize;
const cusDatas = app.nodemodel.define('cusDatas', {
id: {
type: DataTypes.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true,
field: 'id',
},
orderSn: {
type: DataTypes.STRING(255),
allowNull: false,
field: 'orderSn',
},
appkey: {
type: DataTypes.STRING(255),
allowNull: false,
field: 'appkey',
},
type: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: 'gjjAPI',
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,
// field: 'date1',
// },
// date2: {
// type: DataTypes.DATE,
// allowNull: true,
// field: 'date2',
// },
},
{
tableName: 'cus_data',
timestamps: false,
});
return cusDatas;
};
'use strict';
module.exports = app => {
const { DataTypes } = app.Sequelize;
const gjjStatus = app.nodemodel.define('gjjStatus', {
orderId: {
type: DataTypes.STRING(255),
allowNull: false,
primaryKey: true,
field: 'orderId',
},
taskId: {
type: DataTypes.STRING(255),
allowNull: false,
defaultValue: '',
field: 'taskId',
},
cityId: {
type: DataTypes.STRING(10),
allowNull: true,
defaultValue: '',
field: 'text1',
},
appkey: {
type: DataTypes.STRING(50),
allowNull: false,
field: 'appkey',
},
notifyUrl: {
type: DataTypes.STRING(500),
allowNull: true,
defaultValue: '',
field: 'callbackUrl',
},
status: {
type: DataTypes.STRING(20),
allowNull: true,
defaultValue: '',
field: 'status',
},
note: {
type: DataTypes.STRING(8000),
allowNull: true,
defaultValue: '',
field: 'note',
get() {
const note = this.getDataValue('note');
if (note) {
try {
return JSON.parse(note);
} catch (error) {
return {};
}
}
return {};
},
set(val) {
this.setDataValue('note', JSON.stringify(val));
},
},
created_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'createDate',
},
updated_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'updateDate',
},
},
{
tableName: 'gjj_status',
});
return gjjStatus;
};
......@@ -21,6 +21,7 @@ class OrderService extends Service {
async create(params) {
const { ctx } = this;
await ctx.model.TaskStatus.create(params);
await ctx.nodemodel.GjjStatus.create(params);
return;
}
......
......@@ -85,6 +85,17 @@ module.exports = () => {
datasources: [{
// 东八时区
timezone: '+08:00',
delegate: 'nodemodel',
baseDir: 'model/nodegjj',
dialect: 'mysql',
host: 'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com',
database: 'nodetest',
username: 'hexin',
password: 'gYUHszn9#q',
port: 3306,
}, {
// 东八时区
timezone: '+08:00',
delegate: 'model',
baseDir: 'model',
dialect: 'mysql',
......
......@@ -90,11 +90,22 @@ module.exports = () => {
datasources: [{
// 东八时区
timezone: '+08:00',
delegate: 'nodemodel',
baseDir: 'model/nodegjj',
dialect: 'mysql',
host: process.env.MYSQL_PACHONG_HOST || 'rm-bp1272001633qc0x9.mysql.rds.aliyuncs.com',
database: process.env.MYSQL_NODE_SERVER_DB_NAME || 'node_gjj',
username: process.env.MYSQL_USER || 'hexin',
password: process.env.MYSQL_PWD || 'gYUHszn9#q',
port: process.env.MYSQL_PORT || 3306,
}, {
// 东八时区
timezone: '+08:00',
delegate: 'model',
baseDir: 'model',
dialect: 'mysql',
host: process.env.MYSQL_PACHONG_HOST || 'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com',
database: process.env.MYSQL_DATA_SERVER_DB_NAME || 'data_service_dev',
host: process.env.MYSQL_PACHONG_HOST || 'rm-bp1272001633qc0x9.mysql.rds.aliyuncs.com',
database: process.env.MYSQL_DATA_SERVER_DB_NAME || 'data_service_pro',
username: process.env.MYSQL_USER || 'hexin',
password: process.env.MYSQL_PWD || 'gYUHszn9#q',
port: process.env.MYSQL_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