feat:完善项目信息
This commit is contained in:
37
app/api/admin/controller/base.go
Normal file
37
app/api/admin/controller/base.go
Normal file
@ -0,0 +1,37 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"SciencesServer/app/service"
|
||||
"SciencesServer/config"
|
||||
"SciencesServer/serve/cache"
|
||||
"SciencesServer/utils"
|
||||
)
|
||||
|
||||
// Platform
|
||||
type Platform struct{ *service.Session }
|
||||
|
||||
func (c *Platform) Format() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// ReturnPages 分页数据
|
||||
type ReturnPages struct {
|
||||
Data interface{} `json:"data"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
type Key struct{}
|
||||
|
||||
// Generate 生成秘钥
|
||||
func (*Key) Generate(len int) string {
|
||||
key := utils.GetRandomString(len)
|
||||
for {
|
||||
isExist, _ := cache.Cache.SIsMember(config.RedisKeyForTenantKeys, key)
|
||||
|
||||
if !isExist {
|
||||
_ = cache.Cache.SAdd(config.RedisKeyForTenantKeys, key)
|
||||
return key
|
||||
}
|
||||
key = utils.GetRandomString(len)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user