Documentation ¶
Overview ¶
Package member 成员操作封装
Index ¶
- type Member
- func (m *Member) CheckInviteCode(inviteCode, orgID string) (string, error)
- func (m *Member) CheckPermission(userID string, scopeType apistructs.ScopeType, scopeID int64) error
- func (m *Member) CreateOrUpdate(userID string, req apistructs.MemberAddRequest) error
- func (m *Member) Delete(userID string, req apistructs.MemberRemoveRequest) error
- func (m *Member) GetAllOrganizational() (*apistructs.GetAllOrganizationalData, error)
- func (m *Member) GetByToken(token string) (*model.Member, error)
- func (m *Member) GetByUserAndScope(userID string, scopeType apistructs.ScopeType, scopeID int64) ([]model.MemberJoin, error)
- func (m *Member) GetScopeManagersByScopeID(scopeType apistructs.ScopeType, scopeID int64) ([]apistructs.Member, error)
- func (m *Member) IsAdmin(userID string) bool
- func (m *Member) List(param *apistructs.MemberListRequest) (int, []model.Member, error)
- func (m *Member) ListByOrgAndUser(orgID int64, userID string) ([]model.MemberJoin, error)
- func (m *Member) ListByScopeTypeAndUser(scopeType apistructs.ScopeType, userID string) ([]model.Member, error)
- func (m *Member) ListMemberLabel(userID string, scopeID int64) ([]string, error)
- func (m *Member) ListMemberRolesByUser(l *locale.LocaleResource, identityInfo apistructs.IdentityInfo, ...) (int, []apistructs.UserScopeRole, error)
- func (m *Member) ListOrgByUserIDs(userIDs []string) ([]model.Member, error)
- func (m *Member) UpdateMemberUserInfo(req apistructs.MemberUserInfoUpdateRequest) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Member ¶
type Member struct {
// contains filtered or unexported fields
}
Member 成员操作封装
func (*Member) CheckInviteCode ¶
CheckInviteCode 校验邀请码
func (*Member) CheckPermission ¶
func (m *Member) CheckPermission(userID string, scopeType apistructs.ScopeType, scopeID int64) error
CheckPermission 成员相关API鉴权, userID: 当前操作用户
func (*Member) CreateOrUpdate ¶
func (m *Member) CreateOrUpdate(userID string, req apistructs.MemberAddRequest) error
CreateOrUpdate 创建/更新成员
func (*Member) Delete ¶
func (m *Member) Delete(userID string, req apistructs.MemberRemoveRequest) error
Delete 删除成员
func (*Member) GetAllOrganizational ¶
func (m *Member) GetAllOrganizational() (*apistructs.GetAllOrganizationalData, error)
GetAllOrganizational 获取所有组织架构
func (*Member) GetByToken ¶
GetByToken 根据用户token获取成员
func (*Member) GetByUserAndScope ¶
func (m *Member) GetByUserAndScope(userID string, scopeType apistructs.ScopeType, scopeID int64) ([]model.MemberJoin, error)
GetByUserAndScope 根据用户 & scope获取成员
func (*Member) GetScopeManagersByScopeID ¶
func (m *Member) GetScopeManagersByScopeID(scopeType apistructs.ScopeType, scopeID int64) ([]apistructs.Member, error)
GetScopeManagersByScopeID 根据 scopeID 获取 scope 对应的管理员列表
func (*Member) List ¶
func (m *Member) List(param *apistructs.MemberListRequest) (int, []model.Member, error)
List 成员列表/查询
func (*Member) ListByOrgAndUser ¶
ListByOrgAndUser 根据用户获取成员列表
func (*Member) ListByScopeTypeAndUser ¶
func (m *Member) ListByScopeTypeAndUser(scopeType apistructs.ScopeType, userID string) ([]model.Member, error)
ListByScopeTypeAndUser 根据scopeType & user 获取成员
func (*Member) ListMemberLabel ¶
ListMemberLabel 查看一个成员的label
func (*Member) ListMemberRolesByUser ¶
func (m *Member) ListMemberRolesByUser(l *locale.LocaleResource, identityInfo apistructs.IdentityInfo, pageReq apistructs.ListMemberRolesByUserRequest) (int, []apistructs.UserScopeRole, error)
ListMemberRolesByUser 根据用户查看角色
func (*Member) ListOrgByUserIDs ¶
ListOrgByUserIDs 获取userid对应的企业关系
func (*Member) UpdateMemberUserInfo ¶
func (m *Member) UpdateMemberUserInfo(req apistructs.MemberUserInfoUpdateRequest) error
UpdateMemberUserInfo 更新成员的user info 和 uc 同步
type Option ¶
type Option func(*Member)
Option 定义 Member 对象配置选项
func WithRedisClient ¶
WithRedisClient 配置 redis client
func WithTokenSvc ¶
func WithTokenSvc(tokenService tokenpb.TokenServiceServer) Option
func WithTranslator ¶
func WithTranslator(tran i18n.Translator) Option
Click to show internal directories.
Click to hide internal directories.