代码拉取完成,页面将自动刷新
package cache
/*******************************************************************************
Copyright:cloud
Author:cloudapex@126.com
Version:1.0
Date:2020-07-21
Description: 路由角色模型
*******************************************************************************/
import (
"encoding/json"
"fmt"
"gitee.com/cloudapex/ulern/rds"
)
type HRouteRole struct {
CoId int64 `json:"-"` // 公司Id
Route string `json:"-"` // 路由名称
RIds []int64 `json:"rIds"` // 此路由关联的角色Ids
Scopes []RoleScope `json:"scopes"` // 此路由关联的(不同角色对应的数据权限)
}
func (this *HRouteRole) Key() *rds.Hash {
return &rds.Hash{Key: rds.Key{
"MD_Permit", fmt.Sprintf("PERMIT_ROUTE_ROLES_%d", this.CoId), ""}}
}
func (this *HRouteRole) Load() error {
return this.Key().HGet(this.Route).Unmarshal(this)
}
func (this *HRouteRole) Store() error {
buf, _ := json.Marshal(this)
return this.Key().HSet(this.Route, buf).Error()
}
func (this *HRouteRole) Remove() error {
return this.Key().HDel(this.Route).Error()
}
func (this *HRouteRole) Clear() error {
return this.Key().Del().Error()
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。