75 lines
1.6 KiB
JavaScript
75 lines
1.6 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = app => {
|
|
const { INTEGER, STRING } = app.Sequelize;
|
|
|
|
const ExpressPlatform = app.model.define('express_platform', {
|
|
id: {
|
|
type: INTEGER(10),
|
|
primaryKey: true,
|
|
autoIncrement: true,
|
|
allowNull: false,
|
|
comment: '接口ID',
|
|
},
|
|
interface_url: {
|
|
type: STRING(500),
|
|
allowNull: false,
|
|
comment: '外部接口URL',
|
|
},
|
|
platform_code: {
|
|
type: STRING(50),
|
|
allowNull: false,
|
|
comment: '平台代码,用于应用分流',
|
|
},
|
|
interface_name: {
|
|
type: STRING(200),
|
|
allowNull: false,
|
|
comment: '接口名称',
|
|
},
|
|
interface_url_jd: {
|
|
type: STRING(500),
|
|
allowNull: true,
|
|
comment: '京东接口URL',
|
|
},
|
|
appkey: {
|
|
type: STRING(100),
|
|
allowNull: true,
|
|
comment: '应用Key',
|
|
},
|
|
app_secret: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
field: 'AppSecret',
|
|
comment: '应用密钥',
|
|
},
|
|
token: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '访问令牌',
|
|
},
|
|
version: {
|
|
type: STRING(20),
|
|
allowNull: true,
|
|
comment: '接口版本',
|
|
},
|
|
}, {
|
|
tableName: 'wms_express_interface',
|
|
freezeTableName: true,
|
|
underscored: true,
|
|
timestamps: false,
|
|
paranoid: false,
|
|
comment: '快递外部接口配置表',
|
|
indexes: [
|
|
{
|
|
name: 'idx_platform_code',
|
|
fields: [ 'platform_code' ],
|
|
},
|
|
{
|
|
name: 'idx_interface_name',
|
|
fields: [ 'interface_name' ],
|
|
},
|
|
],
|
|
});
|
|
|
|
return ExpressPlatform;
|
|
}; |