Files
opencatd-open/team/consts/consts.go
Sakurasan bc223d6530 team api
2025-02-01 23:52:55 +08:00

45 lines
551 B
Go

package consts
import "gorm.io/gorm"
type UserRole int
const (
RoleUser UserRole = iota * 10
RoleAdmin
RoleSuperAdmin
)
const (
StatusDisabled = iota
StatusEnabled
StatusExpired // 过期
StatusExhausted // 耗尽
StatusDeleted = -1
)
const (
Limited = iota
Unlimited
UnlimitedQuota = 999999
)
var (
ErrUserNotFound = gorm.ErrRecordNotFound
)
func OpenOrClose(status bool) int {
if status {
return StatusEnabled
}
return StatusDisabled
}
type DBType int
const (
DBTypeMySQL DBType = iota
DBTypePostgreSQL
DBTypeSQLite
)