1
This commit is contained in:
31
internal/app/system/consts/cache.go
Normal file
31
internal/app/system/consts/cache.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* @desc:缓存键
|
||||
* @company:云南奇讯科技有限公司
|
||||
* @Author: yixiaohu
|
||||
* @Date: 2022/3/9 12:06
|
||||
*/
|
||||
|
||||
package consts
|
||||
|
||||
import commonConsts "github.com/tiger1103/gfast/v3/internal/app/common/consts"
|
||||
|
||||
const (
|
||||
// CacheSysAuthMenu 缓存菜单key
|
||||
CacheSysAuthMenu = commonConsts.CachePrefix + "sysAuthMenu"
|
||||
// CacheSysDept 缓存部门key
|
||||
CacheSysDept = commonConsts.CachePrefix + "sysDept"
|
||||
|
||||
// CacheSysRole 角色缓存key
|
||||
CacheSysRole = commonConsts.CachePrefix + "sysRole"
|
||||
// CacheSysWebSet 站点配置缓存key
|
||||
CacheSysWebSet = commonConsts.CachePrefix + "sysWebSet"
|
||||
// CacheSysCmsMenu cms缓存key
|
||||
CacheSysCmsMenu = commonConsts.CachePrefix + "sysCmsMenu"
|
||||
|
||||
// CacheSysAuthTag 权限缓存TAG标签
|
||||
CacheSysAuthTag = commonConsts.CachePrefix + "sysAuthTag"
|
||||
// CacheSysModelTag 模型缓存标签
|
||||
CacheSysModelTag = commonConsts.CachePrefix + "sysModelTag"
|
||||
// CacheSysCmsTag cms缓存标签
|
||||
CacheSysCmsTag = commonConsts.CachePrefix + "sysCmsTag"
|
||||
)
|
||||
5
internal/app/system/consts/consts.go
Normal file
5
internal/app/system/consts/consts.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package consts
|
||||
|
||||
const (
|
||||
PageSize = 10 //分页长度
|
||||
)
|
||||
13
internal/app/system/consts/context.go
Normal file
13
internal/app/system/consts/context.go
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* @desc:context 相关常量
|
||||
* @company:云南奇讯科技有限公司
|
||||
* @Author: yixiaohu<yxh669@qq.com>
|
||||
* @Date: 2022/3/16 14:52
|
||||
*/
|
||||
|
||||
package consts
|
||||
|
||||
const (
|
||||
// CtxKey 上下文变量存储键名,前后端系统共享
|
||||
CtxKey = "GFastContext"
|
||||
)
|
||||
7
internal/app/system/consts/role.go
Normal file
7
internal/app/system/consts/role.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package consts
|
||||
|
||||
const (
|
||||
SuperAdminId = 1 // 超级管理员
|
||||
SalesAgentId = 9 // 销售代理
|
||||
SiteAdminId = 10 // 站点管理员
|
||||
)
|
||||
45
internal/app/system/consts/tenant.go
Normal file
45
internal/app/system/consts/tenant.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package consts
|
||||
|
||||
type TenantType int
|
||||
|
||||
const (
|
||||
TenantTypeSite TenantType = 1 // 站点
|
||||
TenantTypeAgent TenantType = 2 // 代理
|
||||
)
|
||||
|
||||
type CertificationStatus int
|
||||
|
||||
const (
|
||||
CertificationStatusPending CertificationStatus = 1 // 待审核
|
||||
CertificationStatusPass CertificationStatus = 2 // 审核通过
|
||||
CertificationStatusFail CertificationStatus = 3 // 审核失败
|
||||
CertificationStatusUnverified CertificationStatus = 4 // 未认证
|
||||
)
|
||||
|
||||
type CertificationStatusKeyValue struct {
|
||||
Key CertificationStatus // 对应原有常量值
|
||||
Value string // 对应描述信息
|
||||
}
|
||||
|
||||
// 定义枚举实例(Key-Value 绑定),相当于改造后的常量
|
||||
var (
|
||||
CertificationStatusPendingKeyValue = CertificationStatusKeyValue{Key: CertificationStatusPending, Value: "待审核"}
|
||||
CertificationStatusPassKeyValue = CertificationStatusKeyValue{Key: CertificationStatusPass, Value: "审核通过"}
|
||||
CertificationStatusFailKeyValue = CertificationStatusKeyValue{Key: CertificationStatusFail, Value: "审核失败"}
|
||||
CertificationStatusUnverifiedKeyValue = CertificationStatusKeyValue{Key: CertificationStatusUnverified, Value: "未认证"}
|
||||
)
|
||||
|
||||
var certificationStatusMap = map[CertificationStatus]CertificationStatusKeyValue{
|
||||
CertificationStatusPending: CertificationStatusPendingKeyValue,
|
||||
CertificationStatusPass: CertificationStatusPassKeyValue,
|
||||
CertificationStatusFail: CertificationStatusFailKeyValue,
|
||||
CertificationStatusUnverified: CertificationStatusUnverifiedKeyValue,
|
||||
}
|
||||
|
||||
// GetCertificationStatusKeyValue 根据 CertificationStatus 指针获取对应的 KeyValue
|
||||
func GetCertificationStatusKeyValue(status CertificationStatus) CertificationStatusKeyValue {
|
||||
if kv, ok := certificationStatusMap[status]; ok {
|
||||
return kv
|
||||
}
|
||||
return CertificationStatusUnverifiedKeyValue
|
||||
}
|
||||
Reference in New Issue
Block a user