Documentation ¶
Index ¶
- Constants
- type Member
- type MemberDao
- func (m *MemberDao) Create(member *Member) *public.BusinessException
- func (m *MemberDao) SavePassword(ctx context.Context, updatePass *dto.UpdatePass) *public.BusinessException
- func (m *MemberDao) SelectByProperty(member *[]*Member, property string, val interface{}) *public.BusinessException
- func (m *MemberDao) UpdateEmail(ctx context.Context, in *dto.UpdateEmail) *public.BusinessException
- type Resource
- type ResourceDao
- func (r *ResourceDao) Delete(ctx context.Context, ids []int32) *public.BusinessException
- func (r *ResourceDao) FindUserResources(ctx context.Context, userId string) ([]*dto.ResourceDto, *public.BusinessException)
- func (r *ResourceDao) GetByParent(ctx context.Context, pid int32) ([]*dto.ResourceDto, *public.BusinessException)
- func (r *ResourceDao) GetChildMenus(ctx context.Context, ids []int32, resourceSet *public.HashSet) *public.BusinessException
- func (r *ResourceDao) GetSuperior(ctx context.Context, ids []int32) ([]*dto.ResourceDto, *public.BusinessException)
- func (r *ResourceDao) List(ctx context.Context, in *dto.ResourcePageDto) (int64, []*dto.ResourceDto, *public.BusinessException)
- func (r *ResourceDao) Save(ctx context.Context, in *dto.ResourceDto) *public.BusinessException
- func (r *ResourceDao) SelectByProperty(ctx context.Context, property string, value interface{}) (*dto.ResourceDto, *public.BusinessException)
- func (r *ResourceDao) SelectPermissionByUserId(ctx context.Context, userId string) ([]string, *public.BusinessException)
- type Role
- type RoleDao
- func (r *RoleDao) All(ctx context.Context) ([]*dto.RoleDto, *public.BusinessException)
- func (r *RoleDao) Delete(ctx context.Context, ids []string) *public.BusinessException
- func (r *RoleDao) List(ctx context.Context, in *dto.RolePageDto) (int64, []*dto.RoleDto, *public.BusinessException)
- func (r *RoleDao) ListRoleResource(ctx context.Context, roleId string) ([]int32, *public.BusinessException)
- func (r *RoleDao) ListRoleUser(ctx context.Context, roleId string) ([]string, *public.BusinessException)
- func (r *RoleDao) Save(ctx context.Context, rr *dto.RoleDto) (*dto.RoleDto, *public.BusinessException)
- func (r *RoleDao) SaveRoleResource(ctx context.Context, rt *dto.RoleDto) *public.BusinessException
- func (r *RoleDao) SaveRoleUser(ctx context.Context, rt *dto.RoleDto) *public.BusinessException
- func (r *RoleDao) SelectById(ctx context.Context, id string) (*dto.RoleDto, *public.BusinessException)
- func (r *RoleDao) SelectByUserId(userId string) ([]Role, *public.BusinessException)
- type RoleResource
- type RoleResourceDao
- func (r *RoleResourceDao) DeleteByResources(ctx context.Context, ids []int32) *public.BusinessException
- func (r *RoleResourceDao) DeleteByRoleId(ctx context.Context, roleIds []string) *public.BusinessException
- func (r *RoleResourceDao) Save(ctx context.Context, rt RoleResource) *public.BusinessException
- func (r *RoleResourceDao) SelectByRoleId(ctx context.Context, roleId string) ([]int32, *public.BusinessException)
- type RoleUser
- type RoleUserDao
- func (r *RoleUserDao) BatchInsert(ctx context.Context, rts []RoleUser) *public.BusinessException
- func (r *RoleUserDao) DeleteByRoleId(ctx context.Context, roleId string) *public.BusinessException
- func (r *RoleUserDao) DeleteByUserId(ctx context.Context, userId string) *public.BusinessException
- func (r *RoleUserDao) Save(ctx context.Context, rt RoleUser) *public.BusinessException
- func (r *RoleUserDao) SelectByRoleId(ctx context.Context, roleId string) ([]string, *public.BusinessException)
- type User
- type UserDao
- func (u *UserDao) CountByRoles(ctx context.Context, roles []string) int64
- func (u *UserDao) Create(ctx context.Context, userDto *User) (*User, *public.BusinessException)
- func (u *UserDao) Delete(ctx context.Context, ids []string) *public.BusinessException
- func (u *UserDao) List(ctx context.Context, in *dto.PageDto) (int64, []*dto.UserDto, *public.BusinessException)
- func (u *UserDao) Login(ctx context.Context, user *dto.LoginUserDto) (*dto.LoginUserDto, *public.BusinessException)
- func (u *UserDao) SavePassword(ctx context.Context, updatePass *dto.UpdatePass) *public.BusinessException
- func (u *UserDao) SelectByEmail(ctx context.Context, email string) *dto.UserDto
- func (u *UserDao) SelectById(ctx context.Context, id string) *User
- func (u *UserDao) SelectByLoginName(ctx context.Context, loginName string) *User
- func (u *UserDao) SelectByPhone(ctx context.Context, phone string) *dto.UserDto
- func (u *UserDao) Update(ctx context.Context, userDto *User) (*User, *public.BusinessException)
- func (u *UserDao) UpdateEmail(ctx context.Context, in *dto.UpdateEmail) *public.BusinessException
Constants ¶
const EntityName = "权限"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Member ¶
type Member struct { Id string // id Email string // 邮箱 Name string // 昵称 LoginName string // 用户名 Password string // 密码 Sex string // 性别 Photo string // 用户头像 Integral uint32 // 积分 LearningTime uint32 // 学习时长 RegisterTime time.Time // 注册时间 CreateTime time.Time // 创建时间 UpdateTime time.Time // 更新时间 Creator string // 创建者 Updater string // 更新者 }
type MemberDao ¶
type MemberDao struct { }
func (*MemberDao) SavePassword ¶
func (m *MemberDao) SavePassword(ctx context.Context, updatePass *dto.UpdatePass) *public.BusinessException
SavePassword : reset password
func (*MemberDao) SelectByProperty ¶
func (m *MemberDao) SelectByProperty(member *[]*Member, property string, val interface{}) *public.BusinessException
func (*MemberDao) UpdateEmail ¶
func (m *MemberDao) UpdateEmail(ctx context.Context, in *dto.UpdateEmail) *public.BusinessException
UpdateEmail: 更新邮箱
type Resource ¶
type ResourceDao ¶
type ResourceDao struct { }
func (*ResourceDao) Delete ¶
func (r *ResourceDao) Delete(ctx context.Context, ids []int32) *public.BusinessException
Delete : 删除权限
func (*ResourceDao) FindUserResources ¶
func (r *ResourceDao) FindUserResources(ctx context.Context, userId string) ([]*dto.ResourceDto, *public.BusinessException)
FindUserResources 获取用户的权限
func (*ResourceDao) GetByParent ¶
func (r *ResourceDao) GetByParent(ctx context.Context, pid int32) ([]*dto.ResourceDto, *public.BusinessException)
GetByParent : 通过父ID parent查询权限
func (*ResourceDao) GetChildMenus ¶
func (r *ResourceDao) GetChildMenus(ctx context.Context, ids []int32, resourceSet *public.HashSet) *public.BusinessException
GetChildMenus: 获取传入父 ID 的所有子权限
func (*ResourceDao) GetSuperior ¶
func (r *ResourceDao) GetSuperior(ctx context.Context, ids []int32) ([]*dto.ResourceDto, *public.BusinessException)
GetSuperior: 获取同级和父级的权限
func (*ResourceDao) List ¶
func (r *ResourceDao) List(ctx context.Context, in *dto.ResourcePageDto) (int64, []*dto.ResourceDto, *public.BusinessException)
List: 分页数据
func (*ResourceDao) Save ¶
func (r *ResourceDao) Save(ctx context.Context, in *dto.ResourceDto) *public.BusinessException
Save: 保存/更新资源
func (*ResourceDao) SelectByProperty ¶
func (r *ResourceDao) SelectByProperty(ctx context.Context, property string, value interface{}) (*dto.ResourceDto, *public.BusinessException)
SelectByProperty: 通过 一个属性 获取权限
func (*ResourceDao) SelectPermissionByUserId ¶
func (r *ResourceDao) SelectPermissionByUserId(ctx context.Context, userId string) ([]string, *public.BusinessException)
SelectPermissionByUserId: 获取permission字段
type RoleDao ¶
type RoleDao struct { }
func (*RoleDao) List ¶
func (r *RoleDao) List(ctx context.Context, in *dto.RolePageDto) (int64, []*dto.RoleDto, *public.BusinessException)
List: 获取角色列表
func (*RoleDao) ListRoleResource ¶
func (r *RoleDao) ListRoleResource(ctx context.Context, roleId string) ([]int32, *public.BusinessException)
ListRoleResource: 获取角色所有权限
func (*RoleDao) ListRoleUser ¶
func (r *RoleDao) ListRoleUser(ctx context.Context, roleId string) ([]string, *public.BusinessException)
ListRoleUser: 获取角色所有用户
func (*RoleDao) Save ¶
func (r *RoleDao) Save(ctx context.Context, rr *dto.RoleDto) (*dto.RoleDto, *public.BusinessException)
Save : update when rr.id exists, insert otherwise
func (*RoleDao) SaveRoleResource ¶
SaveRoleResource: 保存角色资源关联记录
func (*RoleDao) SaveRoleUser ¶
SaveRoleUser: 保存角色的所有用户
func (*RoleDao) SelectById ¶
func (r *RoleDao) SelectById(ctx context.Context, id string) (*dto.RoleDto, *public.BusinessException)
SelectById: 获取传入 ID 角色
func (*RoleDao) SelectByUserId ¶
func (r *RoleDao) SelectByUserId(userId string) ([]Role, *public.BusinessException)
SelectByUserId: 获取用户角色
type RoleResource ¶
func (RoleResource) TableName ¶
func (RoleResource) TableName() string
type RoleResourceDao ¶
type RoleResourceDao struct { }
func (*RoleResourceDao) DeleteByResources ¶
func (r *RoleResourceDao) DeleteByResources(ctx context.Context, ids []int32) *public.BusinessException
DeleteByResources: 通过权限 id 删除记录
func (*RoleResourceDao) DeleteByRoleId ¶
func (r *RoleResourceDao) DeleteByRoleId(ctx context.Context, roleIds []string) *public.BusinessException
DeleteByRoleId: 删除角色关联的所有记录
func (*RoleResourceDao) Save ¶
func (r *RoleResourceDao) Save(ctx context.Context, rt RoleResource) *public.BusinessException
Save: 创建角色-资源关联记录
func (*RoleResourceDao) SelectByRoleId ¶
func (r *RoleResourceDao) SelectByRoleId(ctx context.Context, roleId string) ([]int32, *public.BusinessException)
SelectByRoleId: 查询角色关联的所有记录
type RoleUserDao ¶
type RoleUserDao struct { }
func (*RoleUserDao) BatchInsert ¶
func (r *RoleUserDao) BatchInsert(ctx context.Context, rts []RoleUser) *public.BusinessException
BatchInsert: 创建角色-用户关联记录 批量
func (*RoleUserDao) DeleteByRoleId ¶
func (r *RoleUserDao) DeleteByRoleId(ctx context.Context, roleId string) *public.BusinessException
DeleteByRoleId: 删除角色关联的所有记录
func (*RoleUserDao) DeleteByUserId ¶
func (r *RoleUserDao) DeleteByUserId(ctx context.Context, userId string) *public.BusinessException
DeleteByUserId: 删除用户角色记录
func (*RoleUserDao) Save ¶
func (r *RoleUserDao) Save(ctx context.Context, rt RoleUser) *public.BusinessException
Save: 创建角色-用户关联记录
func (*RoleUserDao) SelectByRoleId ¶
func (r *RoleUserDao) SelectByRoleId(ctx context.Context, roleId string) ([]string, *public.BusinessException)
SelectByRoleId: 查询角色关联的所有记录
type User ¶
type UserDao ¶
type UserDao struct { }
func (*UserDao) CountByRoles ¶
CountByRoles: 查询角色是否关联了用户
func (*UserDao) List ¶
func (u *UserDao) List(ctx context.Context, in *dto.PageDto) (int64, []*dto.UserDto, *public.BusinessException)
List : get user page
func (*UserDao) Login ¶
func (u *UserDao) Login(ctx context.Context, user *dto.LoginUserDto) (*dto.LoginUserDto, *public.BusinessException)
Login : login
func (*UserDao) SavePassword ¶
func (u *UserDao) SavePassword(ctx context.Context, updatePass *dto.UpdatePass) *public.BusinessException
SavePassword : reset password
func (*UserDao) SelectByEmail ¶
func (*UserDao) SelectById ¶
SelectById : get user by id
func (*UserDao) SelectByLoginName ¶
SelectByLoginName : get user by login name
func (*UserDao) SelectByPhone ¶
func (*UserDao) UpdateEmail ¶
func (u *UserDao) UpdateEmail(ctx context.Context, in *dto.UpdateEmail) *public.BusinessException
UpdateEmail: 更新邮箱