team api
This commit is contained in:
@@ -1,17 +1,44 @@
|
||||
package consts
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type UserRole int
|
||||
|
||||
const (
|
||||
RoleGuest = iota * 10
|
||||
RoleUser
|
||||
RoleUser UserRole = iota * 10
|
||||
RoleAdmin
|
||||
RoleSuperAdmin
|
||||
)
|
||||
|
||||
const (
|
||||
StatusEnabled = iota
|
||||
StatusDisabled
|
||||
StatusDisabled = iota
|
||||
StatusEnabled
|
||||
StatusExpired // 过期
|
||||
StatusExhausted // 耗尽
|
||||
StatusDeleted
|
||||
|
||||
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
|
||||
)
|
||||
const UnlimitedQuota = -1
|
||||
|
||||
Reference in New Issue
Block a user