78 lines
1.6 KiB
JavaScript
78 lines
1.6 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* 平台表模型定义。
|
|
* @param {import('egg').Application} app Egg 应用实例
|
|
* @return {import('sequelize').ModelCtor<import('sequelize').Model>} 平台模型
|
|
*/
|
|
module.exports = app => {
|
|
const { STRING, BIGINT } = app.Sequelize;
|
|
|
|
const Platform = app.model.define('platform', {
|
|
code: {
|
|
type: STRING(50),
|
|
primaryKey: true,
|
|
allowNull: false,
|
|
comment: '平台代码',
|
|
},
|
|
name: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '平台名称',
|
|
},
|
|
interface_url: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '接口地址',
|
|
},
|
|
appkey: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '应用Key',
|
|
},
|
|
app_secret: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '应用密钥',
|
|
},
|
|
token: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '访问令牌',
|
|
},
|
|
version: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '接口版本',
|
|
},
|
|
shoptype: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '店铺类型',
|
|
},
|
|
ordersource: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '订单来源',
|
|
},
|
|
component: {
|
|
type: STRING(255),
|
|
allowNull: true,
|
|
comment: '打印组件标识',
|
|
},
|
|
print_platform_id: {
|
|
type: BIGINT(20).UNSIGNED,
|
|
allowNull: true,
|
|
comment: '关联打印平台ID',
|
|
},
|
|
}, {
|
|
tableName: 'wms_platform',
|
|
freezeTableName: true,
|
|
timestamps: false,
|
|
underscored: true,
|
|
comment: '平台表',
|
|
});
|
|
|
|
return Platform;
|
|
};
|