2bbf42b741
Remove Agent Desk users, roles, login sessions, tokens, and local permission persistence. Expose the backend as an embeddable ai-agent module with host-provided subject lookup and operation authorization callbacks, and complete the frontend/backend repository split.
60 lines
1.0 KiB
Go
60 lines
1.0 KiB
Go
package enums
|
|
|
|
type Status int
|
|
|
|
const (
|
|
StatusOk Status = 0
|
|
StatusDisabled Status = 1
|
|
StatusDeleted Status = 2
|
|
)
|
|
|
|
var StatusValues = []Status{StatusOk, StatusDisabled, StatusDeleted}
|
|
|
|
var statusLabelMap = map[Status]string{
|
|
StatusOk: "启用",
|
|
StatusDisabled: "禁用",
|
|
StatusDeleted: "已删除",
|
|
}
|
|
|
|
func GetStatusLabel(status Status) string {
|
|
return statusLabelMap[status]
|
|
}
|
|
|
|
func IsValidStatus(status int) bool {
|
|
for _, s := range StatusValues {
|
|
if int(s) == status {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
type Gender int
|
|
|
|
const (
|
|
GenderUnknown Gender = 0
|
|
GenderMale Gender = 1
|
|
GenderFemale Gender = 2
|
|
)
|
|
|
|
var GenderValues = []Gender{GenderUnknown, GenderMale, GenderFemale}
|
|
|
|
var genderLabelMap = map[Gender]string{
|
|
GenderUnknown: "未知",
|
|
GenderMale: "男",
|
|
GenderFemale: "女",
|
|
}
|
|
|
|
func GetGenderLabel(gender Gender) string {
|
|
return genderLabelMap[gender]
|
|
}
|
|
|
|
func IsValidGender(gender int) bool {
|
|
for _, g := range GenderValues {
|
|
if int(g) == gender {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|