oms/backend/app/model/expressCompany.js
liufumingren 8597cf5ac9 feat(backend): 用户鉴权、菜单权限、主体与系统基础模块
- 登录/邮箱验证码/密码流程(controller/auth.js、lib/emailCode.js、middleware/jwt_auth.js)
- 主体(principal)隔离与主体用户、对外接口配置模块及 principalCheck 中间件
- 菜单、用户、文件上传、快递公司字典(express_companies)等基础模块
- 通用工具:分页(lib/pagination.js)、缓存(service/cache.js)
- 全量接口契约(contract/index.js)与路由注册(router.js)、config.default.js 配置
- 相关迁移:菜单组件调整与菜单种子、创建 files 表
2026-09-13 02:23:34 +08:00

30 lines
1.3 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';
/**
* 快递公司字典模型,对应 express_companies 表(通用字典,不区分主体)
*
* 供发货单等单据选择物流公司:code 使用行业/WMS 标准编码(SF/YTO/ZTO...),
* 选择后写入单据的 logistics_code / logistics_name。
* @param {Egg.Application} app egg application
* @return {object} expressCompany model
*/
module.exports = app => {
const { BIGINT, STRING, TINYINT, INTEGER, DATE } = app.Sequelize;
const ExpressCompany = app.model.define('express_company', {
id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' },
code: { type: STRING(50), allowNull: false, comment: '快递公司编码(行业/WMS 标准编码,如 SF/YTO/ZTO)' },
name: { type: STRING(100), allowNull: false, comment: '快递公司名称(如 顺丰速运)' },
status: { type: TINYINT, allowNull: false, defaultValue: 1, comment: '状态:1启用 0禁用' },
sort: { type: INTEGER, allowNull: false, defaultValue: 0, comment: '排序(下拉展示顺序,越小越靠前)' },
remark: { type: STRING(255), comment: '备注' },
created_at: { type: DATE, comment: '创建时间' },
updated_at: { type: DATE, comment: '更新时间' },
}, {
tableName: 'express_companies',
comment: '快递公司字典',
});
return ExpressCompany;
};