Skip to content

Commit

Permalink
fix: remove extra char in redis key
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 committed Jul 10, 2024
1 parent d13571c commit a7b940e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions orm/ent/entctx/datapermctx/data_perm_ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ func GetSubDeptDataPermRedisKey(departmentId uint64) string {

// GetTenantRoleCustomDeptDataPermRedisKey returns the key to store tenant's role custom department data into redis
func GetTenantRoleCustomDeptDataPermRedisKey(roleCodes []string, tenantId uint64) string {
return fmt.Sprintf("%s:%d:ROLE:%s:CustomDept", config.RedisDataPermissionPrefix, tenantId, strings.Join(roleCodes, ","))
return fmt.Sprintf("%s%d:ROLE:%s:CustomDept", config.RedisDataPermissionPrefix, tenantId, strings.Join(roleCodes, ","))
}

// GetTenantRoleScopeDataPermRedisKey returns the key to store tenant's role data scope into redis
func GetTenantRoleScopeDataPermRedisKey(roleCodes []string, tenantId uint64) string {
return fmt.Sprintf("%s:%d:ROLE:%s:Scope", config.RedisDataPermissionPrefix, tenantId, strings.Join(roleCodes, ","))
return fmt.Sprintf("%s%d:ROLE:%s:Scope", config.RedisDataPermissionPrefix, tenantId, strings.Join(roleCodes, ","))
}

// GetTenantSubDeptDataPermRedisKey returns the key to store tenant's sub department data into redis
func GetTenantSubDeptDataPermRedisKey(departmentId uint64, tenantId uint64) string {
return fmt.Sprintf("%s:%d:DEPT:%d:SubDept", config.RedisDataPermissionPrefix, tenantId, departmentId)
return fmt.Sprintf("%s%d:DEPT:%d:SubDept", config.RedisDataPermissionPrefix, tenantId, departmentId)
}

0 comments on commit a7b940e

Please sign in to comment.