Files
quyun-v2/backend/pkg/consts/tenant_join.go

60 lines
1.7 KiB
Go
Raw Permalink 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.
package consts
import "quyun/v2/app/requests"
// swagger:enum TenantInviteStatus
// ENUM( active, disabled, expired )
type TenantInviteStatus string
// Description 返回枚举值的中文含义,用于前端展示与审计日志输出。
func (t TenantInviteStatus) Description() string {
switch t {
case TenantInviteStatusActive:
return "可用"
case TenantInviteStatusDisabled:
return "已禁用"
case TenantInviteStatusExpired:
return "已过期"
default:
return "未知状态"
}
}
// TenantInviteStatusItems 返回前端下拉选项Key=枚举字符串Value=中文描述)。
func TenantInviteStatusItems() []requests.KV {
values := TenantInviteStatusValues()
items := make([]requests.KV, 0, len(values))
for _, v := range values {
items = append(items, requests.NewKV(string(v), v.Description()))
}
return items
}
// swagger:enum TenantJoinRequestStatus
// ENUM( pending, approved, rejected )
type TenantJoinRequestStatus string
// Description 返回枚举值的中文含义,用于前端展示与审计日志输出。
func (t TenantJoinRequestStatus) Description() string {
switch t {
case TenantJoinRequestStatusPending:
return "待审核"
case TenantJoinRequestStatusApproved:
return "已通过"
case TenantJoinRequestStatusRejected:
return "已拒绝"
default:
return "未知状态"
}
}
// TenantJoinRequestStatusItems 返回前端下拉选项Key=枚举字符串Value=中文描述)。
func TenantJoinRequestStatusItems() []requests.KV {
values := TenantJoinRequestStatusValues()
items := make([]requests.KV, 0, len(values))
for _, v := range values {
items = append(items, requests.NewKV(string(v), v.Description()))
}
return items
}