'use strict'; /** * 打印平台元数据模型。 * @param {import('egg').Application} app Egg 应用实例。 * @return {import('sequelize').ModelCtor} 打印平台元数据模型。 */ module.exports = app => { const { BIGINT, STRING, DATE, TINYINT, INTEGER, TEXT } = 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', }, request_platform_code: { type: STRING(50), allowNull: true, comment: '请求平台编码', }, need_callback_url: { type: TINYINT(1), allowNull: false, defaultValue: 1, comment: '是否需要回调地址:0-否,1-是', }, status: { type: STRING(20), allowNull: false, defaultValue: 'ACTIVE', comment: '状态', }, remark: { type: STRING(255), allowNull: true, comment: '备注', }, auth_base_url: { type: TEXT, allowNull: true, comment: '授权基础地址', }, get_auth_platform_name: { type: STRING(100), 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; };