增加租户储存容量
This commit is contained in:
@@ -14,11 +14,13 @@ type Tenant struct {
|
||||
Owner string `orm:"size(50)" json:"owner"`
|
||||
Phone string `orm:"size(20);null" json:"phone"`
|
||||
Email string `orm:"size(100);null" json:"email"`
|
||||
Status string `orm:"size(20);default(enabled)" json:"status"` // enabled, disabled
|
||||
AuditStatus string `orm:"size(20);default(pending)" json:"audit_status"` // pending, approved, rejected
|
||||
Status string `orm:"size(20);default(enabled)" json:"status"`
|
||||
AuditStatus string `orm:"size(20);default(pending)" json:"audit_status"`
|
||||
AuditComment string `orm:"type(text);null" json:"audit_comment"`
|
||||
AuditBy string `orm:"size(50);null" json:"audit_by"`
|
||||
AuditTime *time.Time `orm:"null;type(datetime)" json:"audit_time"`
|
||||
Capacity int `orm:"default(0)" json:"capacity"`
|
||||
CapacityUsed int `orm:"default(0)" json:"capacity_used"`
|
||||
Remark string `orm:"type(text);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"auto_now;type(datetime)" json:"update_time"`
|
||||
@@ -69,7 +71,7 @@ func UpdateTenant(id int, data map[string]interface{}) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteTenant 软删除租户(设置 delete_time)
|
||||
// DeleteTenant 软删除租户
|
||||
func DeleteTenant(id int) error {
|
||||
o := orm.NewOrm()
|
||||
deleteTime := time.Now()
|
||||
@@ -77,7 +79,7 @@ func DeleteTenant(id int) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// AuditTenant 审核租户(只能审核未删除的)
|
||||
// AuditTenant 审核租户
|
||||
func AuditTenant(id int, auditStatus, auditComment, auditBy string) error {
|
||||
o := orm.NewOrm()
|
||||
tenant := Tenant{}
|
||||
@@ -99,7 +101,7 @@ func AuditTenant(id int, auditStatus, auditComment, auditBy string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// GetTenantById 根据ID获取租户详情(只返回未删除的)
|
||||
// GetTenantById 根据ID获取租户详情
|
||||
func GetTenantById(id int) (*Tenant, error) {
|
||||
o := orm.NewOrm()
|
||||
tenant := Tenant{}
|
||||
@@ -111,7 +113,7 @@ func GetTenantById(id int) (*Tenant, error) {
|
||||
return &tenant, err
|
||||
}
|
||||
|
||||
// GetTenantByName 根据名称获取租户详情(只返回未删除的)
|
||||
// GetTenantByName 根据名称获取租户详情
|
||||
func GetTenantByName(name string) (*Tenant, error) {
|
||||
o := orm.NewOrm()
|
||||
tenant := Tenant{}
|
||||
|
||||
Reference in New Issue
Block a user