first commit

This commit is contained in:
2026-03-31 17:28:07 +08:00
commit 36929736c1
27 changed files with 4630 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
package models
// Init 初始化模型层资源(如:数据库连接、模型注册)。
// 目前仅做占位以支持当前结构编译通过;后续按实际数据库/模型重写。
func Init(_ string) {
// TODO: 初始化数据库连接等
}
+26
View File
@@ -0,0 +1,26 @@
package models
import "time"
// Tenant 租户表 yz_tenant
type Tenant struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"` // 租户唯一标识(主键)
TenantCode string `orm:"column(tenant_code);size(32);unique" json:"tenantCode"` // 租户编码
TenantName string `orm:"column(tenant_name);size(128)" json:"tenantName"` // 租户名称
ContactPerson string `orm:"column(contact_person);size(64);null" json:"contactPerson"` // 联系人
ContactPhone string `orm:"column(contact_phone);size(20);null" json:"contactPhone"` // 联系电话
ContactEmail string `orm:"column(contact_email);size(128);null" json:"contactEmail"` // 联系邮箱
Address string `orm:"column(address);size(255);null" json:"address"` // 租户地址
Worktime string `orm:"column(worktime);size(255);null" json:"worktime"` // 工作时间
Status int8 `orm:"column(status);default(1)" json:"status"` // 租户状态:1-正常,2-停用,0-删除
Remark string `orm:"column(remark);size(512);null" json:"remark"` // 备注信息
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"` // 创建时间
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"` // 更新时间
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"` // 删除时间
}
// TableName 自定义表名
func (t *Tenant) TableName() string {
return "yz_tenant"
}