WMS_MAIN/app/model/print_platform.js
liufumingren dc4894cb6d 1
2026-05-25 17:08:56 +08:00

87 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 打印平台元数据模型。
* @param {import('egg').Application} app Egg 应用实例。
* @return {import('sequelize').ModelCtor<import('sequelize').Model>} 打印平台元数据模型。
*/
module.exports = app => {
const { BIGINT, STRING, DATE, TINYINT, INTEGER } = app.Sequelize;
const PrintPlatform = app.model.define('print_platform', {
id: {
type: BIGINT(20).UNSIGNED,
primaryKey: true,
autoIncrement: true,
allowNull: false,
comment: '主键ID',
},
platform_code: {
type: STRING(50),
allowNull: false,
comment: '打印平台编码',
},
platform_name: {
type: STRING(100),
allowNull: false,
comment: '打印平台名称',
},
platid: {
type: INTEGER(11),
allowNull: true,
comment: '平台ID',
},
status: {
type: STRING(20),
allowNull: false,
defaultValue: 'ACTIVE',
comment: '状态',
},
remark: {
type: STRING(255),
allowNull: true,
comment: '备注',
},
auth_base_url: {
type: STRING(255),
allowNull: true,
comment: '授权基础地址',
},
create_at: {
type: DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
comment: '创建时间',
},
update_at: {
type: DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
comment: '更新时间',
},
deleted: {
type: TINYINT,
allowNull: false,
defaultValue: 0,
comment: '软删除标记:0-未删除,1-已删除',
},
}, {
tableName: 'wms_print_platform',
timestamps: false,
comment: '打印平台元数据表',
indexes: [
{
name: 'uk_platform_code',
unique: true,
fields: [ 'platform_code' ],
},
{
name: 'idx_status',
fields: [ 'status' ],
},
],
});
return PrintPlatform;
};