feat: add save

This commit is contained in:
2025-12-16 14:26:31 +08:00
parent 4722eef72c
commit 512859b5c7
6 changed files with 34 additions and 20 deletions

View File

@@ -28,7 +28,7 @@ type Tenant struct {
ExpiredAt time.Time `gorm:"column:expired_at;type:timestamp with time zone" json:"expired_at"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp with time zone;not null;default:now()" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp with time zone;not null;default:now()" json:"updated_at"`
Users []*User `gorm:"many2many:tenant_users" json:"users,omitempty"`
Users []*User `gorm:"joinForeignKey:TenantID;joinReferences:UserID;many2many:tenant_users" json:"users,omitempty"`
}
// Quick operations without importing query package