Files
smart-go/internal/iam/entity/tenant.go
T
2026-04-23 18:58:13 +08:00

26 lines
944 B
Go

package entity
import (
"time"
"gorm.io/gorm"
)
// PlatformTenantID 平台租户主键(与初始化数据一致;菜单维护等仅平台租户可操作)
const PlatformTenantID = "00000000-0000-0000-0000-000000000001"
// Tenant 租户 iam_tenant
type Tenant struct {
ID string `json:"id" gorm:"primaryKey;type:varchar(36);not null"`
TenantCode string `json:"tenant_code" gorm:"size:64;uniqueIndex;not null"`
TenantName string `json:"tenant_name" gorm:"size:128;not null"`
AdminUserID *string `json:"admin_user_id" gorm:"size:36"`
Status int16 `json:"status" gorm:"default:1"` // 1 正常 0 冻结 -1 删除(逻辑)
ExpireTime *time.Time `json:"expire_time"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
func (Tenant) TableName() string { return "iam_tenant" }