mbum

package
v0.15.108 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HisStatusJoin = iota + 1
	HisStatusLeave
)
View Source
const (
	HisTypeJoin = iota + 1
	HisTypeLeave
	HisTypeUpdateInfo
)

Variables

This section is empty.

Functions

func AgreeJoinTangentApply

func AgreeJoinTangentApply(applyID string, roleIds string) error

func ChangeTangent

func ChangeTangent(userID string, newTangentID string) error

func CreateCmsUser

func CreateCmsUser(orgID int, userID string) error

func CreateInviterUser

func CreateInviterUser(params *CreateInviterUserRequest) error

func CreateJoinTangentApply

func CreateJoinTangentApply(tangentID string, tangentName string, userID string,
	name string, phone string) error

func CreateUserHis added in v0.11.6

func CreateUserHis(params *CreateUserHisPrams) error
func CreateUserLink(params *CreateUserLinkParams) error

func CreateUserProfile

func CreateUserProfile(currentTangentID string, userID string, name string, phone string) error

func DeleteCmsUser

func DeleteCmsUser(orgID int, userID string) error

func DeleteInviterUser

func DeleteInviterUser(userId string) error

func DeleteRoleFromUsers

func DeleteRoleFromUsers(currentTangentID string, roleID string, userIDs []string) error

func DeleteUser

func DeleteUser(tangentID string, userID string) error

func DeleteUserThorough added in v0.15.19

func DeleteUserThorough(params *DeleteUserThoroughRequest) error

func Destroy

func Destroy()

func GetAndUpdateAccessToken added in v0.3.0

func GetAndUpdateAccessToken(uname, pwd string) (string, error)

func GetJoinedTangents

func GetJoinedTangents(userID, name, ignore string, pageNo, pageSize int) ([]string, int64, error)

func GetUserFace

func GetUserFace(userID string) (string, error)

func GetWechatUserCurTangentID

func GetWechatUserCurTangentID(openID string) (string, error)

func GetWechatUserID

func GetWechatUserID(openID string, unionID string) (string, error)

func GetWechatUserMpOpenID added in v0.9.40

func GetWechatUserMpOpenID(userID string) (string, error)

func GetWechatUserOpenID

func GetWechatUserOpenID(userID string) (string, error)

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func JoinAndChangeTangent

func JoinAndChangeTangent(userID string, newTangentID string, roleIds string) error

func LeaveTangent

func LeaveTangent(userID string, changeToTangentID string) error

func LoginCmsUser

func LoginCmsUser(orgID int, userID string) (string, error)

func RegisterUser

func RegisterUser(tangentID string, userName string, password string,
	roleIds string) (string, error)

func RejectJoinTangentApply

func RejectJoinTangentApply(applyID string) error

func UpdateInviterUser

func UpdateInviterUser(params *UpdateInviterUserRequest) error

func UpdateRoleToUsers

func UpdateRoleToUsers(currentTangentID string, roleID string, userIDs []string) error

func UpdateTangentUserProfile added in v0.1.6

func UpdateTangentUserProfile(tangentID, userID, name, phone string, status uint8) error
func UpdateUserLink(params *UpdateUserLinkParams) error

func UpdateUserLinkBatch added in v0.11.14

func UpdateUserLinkBatch(params *UpdateUserLinkBatchParams) error

func UpdateUserPassword

func UpdateUserPassword(tangentID string, userID string, username string, password string) error

func UpdateUserRoles

func UpdateUserRoles(currentTangentID string, userID string, uasRoleIDs []string) error

func UploadUserFace

func UploadUserFace(userID string, face *multipart.FileHeader) (string, string, error)

func UserFollowOfficialAccount added in v0.8.5

func UserFollowOfficialAccount(appID, appSecret, event, openID string) error

func UserFollowedOfficialAccount added in v0.8.5

func UserFollowedOfficialAccount(userID string) (bool, error)

func UserProfileByIDs added in v0.9.4

func UserProfileByIDs(userIds []string) (map[string]SimpleInfo, error)

func UserSimpleProfileByIDs added in v0.9.34

func UserSimpleProfileByIDs(userIds []string) (map[string]SimpleInfo1, error)

func WechatScanQrLogin added in v0.9.6

func WechatScanQrLogin(wxAppID string, appSecret string, code string) (string, error)

func WechatUserLogin

func WechatUserLogin(wxAppID string, appSecret string, jsCode string,
	currentTangentId string, roleIds string) ([]RoleInfo, string, string, *UserProfile, error)

Types

type AddressBookSearchQuery added in v0.15.46

type AddressBookSearchQuery struct {
	TangentID string `form:"tangentId" binding:"required"`
	Key       string `form:"key"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type CountUserInfo

type CountUserInfo struct {
	InviterID    string `json:"InviterId"`
	InviterCount int    `json:"inviterCount"`
}

func GetUserInviterCount

func GetUserInviterCount(params *GetUserInviterCountQuery) ([]CountUserInfo, error)

type CreateInviterUserRequest

type CreateInviterUserRequest struct {
	UserID      string `json:"userId"`
	InviterID   string `json:"inviterId"`
	InviterType uint8  `json:"inviterType"`
}

type CreateInviterUserResponse

type CreateInviterUserResponse struct {
	// contains filtered or unexported fields
}

type CreateUserHisPrams added in v0.11.6

type CreateUserHisPrams struct {
	TangentID  string `json:"tangentId"`
	UserID     string `json:"userId"`
	Name       string `json:"name"`
	Phone      string `json:"phone"`
	Status     uint8  `json:"status"`
	DeptID     string `json:"deptId"`
	PositionID string `json:"positionId"`
	HisType    uint8  `json:"hisType"`
}

type CreateUserHisResponse added in v0.11.6

type CreateUserHisResponse struct {
	// contains filtered or unexported fields
}

type CreateUserLinkParams added in v0.11.14

type CreateUserLinkParams struct {
	TangentID    string `json:"tangentId"`
	UserID       string `json:"userId"`
	Name         string `json:"name"`
	Phone        string `json:"phone"`
	Status       uint8  `json:"status"`
	DeptID       string `json:"deptId"`
	DeptName     string `json:"deptName"`
	PositionID   string `json:"positionId"`
	PositionName string `json:"positionName"`
	Date         string `json:"date"`
}

type CreateUserLinkResponse added in v0.11.14

type CreateUserLinkResponse struct {
	// contains filtered or unexported fields
}

type DeleteInviterUserResponse

type DeleteInviterUserResponse struct {
	// contains filtered or unexported fields
}

type DeleteUserThoroughRequest added in v0.15.19

type DeleteUserThoroughRequest struct {
	UserID string `form:"userId" binding:"required"`
}

type DeleteUserThoroughResponse added in v0.15.19

type DeleteUserThoroughResponse struct {
	// contains filtered or unexported fields
}

type GetAndUpdateAccessTokenRequest added in v0.3.0

type GetAndUpdateAccessTokenRequest struct {
	UserName string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type GetAndUpdateAccessTokenResponse added in v0.3.0

type GetAndUpdateAccessTokenResponse struct {
	Token string `json:"token" binding:"required"`
	// contains filtered or unexported fields
}

type GetInviterUsersQuery

type GetInviterUsersQuery struct {
	UserID      string `form:"userId"`
	InviterID   string `form:"inviterId"`
	InviterType uint8  `form:"inviterType"`
	PageNo      int    `form:"pageNo"`
	PageSize    int    `form:"pageSize"`
}

type GetInviterUsersResponse

type GetInviterUsersResponse struct {
	PageNo     int               `json:"pageNo"`
	TotalCount int64             `json:"totalCount"`
	Infos      []InviterUserInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetJoinedTangentsInfo added in v0.15.17

type GetJoinedTangentsInfo struct {
	Ids        []string `json:"ids"`
	TotalCount int64    `json:"totalCount"`
	PageNo     int      `json:"pageNo"`
}

type GetTangentUserProfilesQuery added in v0.1.6

type GetTangentUserProfilesQuery struct {
	TangentID string `form:"tangentId"`
	UserID    string `form:"userId"`
	Name      string `form:"name"`
	Mobile    string `form:"mobile"`
	Status    uint8  `form:"status"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type GetTangentUserProfilesResponse added in v0.1.6

type GetTangentUserProfilesResponse struct {
	PageNo     int                      `json:"pageNo" binding:"required"`
	TotalCount int64                    `json:"totalCount" binding:"required"`
	Infos      []TangentUserProfileInfo `json:"infos" binding:"required"`
	// contains filtered or unexported fields
}

type GetUserHisPageParams added in v0.11.6

type GetUserHisPageParams struct {
	TangentID string `form:"tangentId"`
	UserID    string `form:"userId"`
	StartTime string `form:"startTime"`
	EndTime   string `form:"endTime"`
	HisType   uint8  `form:"hisType"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type GetUserHisPageResponse added in v0.11.6

type GetUserHisPageResponse struct {
	Infos      []UserHis `json:"infos"`
	TotalCount int64     `json:"totalCount"`
	PageNo     int       `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetUserInviterCountQuery

type GetUserInviterCountQuery struct {
	InviterID string `form:"inviterId"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type GetUserInviterCountResponse

type GetUserInviterCountResponse struct {
	Infos []CountUserInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetUserWithoutRoleResponse added in v0.8.13

type GetUserWithoutRoleResponse struct {
	PageNo     int                   `json:"pageNo" binding:"required"`
	TotalCount int64                 `json:"totalCount" binding:"required"`
	Infos      []UserWithoutRoleInfo `json:"infos" binding:"required"`
	// contains filtered or unexported fields
}

type InviterUserInfo

type InviterUserInfo struct {
	UserID      string `json:"userId"`
	InviterID   string `json:"inviterId"`
	CreateTime  string `json:"createTime"`
	InviterType uint8  `json:"inviterType"`
}

func GetInviterUsers

func GetInviterUsers(params *GetInviterUsersQuery) ([]InviterUserInfo, int64, error)

type JoinTangentApplyInfo

type JoinTangentApplyInfo struct {
	ID              string `json:"id" binding:"required"`
	UserID          string `json:"userId" binding:"required"`
	UserProfileName string `json:"userProfileName" binding:"required"`
	UserPhone       string `json:"userPhone" binding:"required"`
	TangentID       string `json:"tangentId" binding:"required"`
	TangentName     string `json:"tangentName" binding:"required"`
	SubmitTime      string `json:"submitTime" binding:"required"`
	CompleteTime    string `json:"completeTime" binding:"required"`
	Status          string `json:"status" binding:"required"`
	IsSecond        uint8  `json:"isSecond"`
}

func GetJoinTangentApplies

func GetJoinTangentApplies(tangentID string, userID string, applyID string, name string, status uint8, pageNo int, pageSize int) ([]JoinTangentApplyInfo, int64, error)

type LoginCmsResponse

type LoginCmsResponse struct {
	Token string `json:"token"`
	// contains filtered or unexported fields
}

type RangeSnapShotUsersQuery added in v0.11.19

type RangeSnapShotUsersQuery struct {
	TangentID    string `form:"tangentId"`
	UserID       string `form:"userId"`
	Name         string `form:"name"`
	DeptName     string `form:"deptName"`
	PositionName string `form:"positionName"`
	Status       uint8  `form:"status"`
	StartDate    string `form:"startDate"`
	EndDate      string `form:"endDate"`
	PageNo       int    `form:"pageNo"`
	PageSize     int    `form:"pageSize"`
}

type RegisterUserRequest

type RegisterUserRequest struct {
	AppID               string               `json:"appId" binding:"required"`
	AppSecret           string               `json:"appSecret" binding:"required"`
	CurrentTangentID    string               `json:"currentTangentId" binding:"required"`
	RolesAndPermissions []RoleAndPermissions `json:"rolesAndPermissions" binding:"required"`
	OpenID              string               `json:"openId" binding:"required"`
	PhoneCode           string               `json:"phoneCode" binding:"required"`
}

type RoleAndPermissions

type RoleAndPermissions struct {
	RoleName    string           `json:"roleName"`
	Permissions []rolePermission `json:"permissions"`
}

type RoleInfo

type RoleInfo struct {
	ID   string `json:"id" binding:"required"`
	Name string `json:"name" binding:"required"`
}

func GetUserRoles

func GetUserRoles(tangentId string, userId string) ([]RoleInfo, error)

type SimpleInfo added in v0.9.4

type SimpleInfo struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Phone  string `json:"phone"`
	Avatar string `json:"avatar"`
	Sex    uint8  `json:"sex"`
}

type SimpleInfo1 added in v0.9.34

type SimpleInfo1 struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Phone string `json:"phone"`
	Sex   uint8  `json:"sex"`
}

type SnapShotUserQuery added in v0.11.14

type SnapShotUserQuery struct {
	TangentID    string `form:"tangentId"`
	UserID       string `form:"userId"`
	SnapShotDate string `form:"snapShotDate"`
}

type SnapShotUserResponse added in v0.11.14

type SnapShotUserResponse struct {
	Info *TangentUserLink `json:"info"`
	// contains filtered or unexported fields
}

type SnapShotUsersQuery added in v0.11.14

type SnapShotUsersQuery struct {
	TangentID    string `form:"tangentId"`
	UserID       string `form:"userId"`
	Name         string `form:"name"`
	DeptName     string `form:"deptName"`
	PositionName string `form:"positionName"`
	Status       uint8  `form:"status"`
	SnapShotDate string `form:"snapShotDate"`
	PageNo       int    `form:"pageNo"`
	PageSize     int    `form:"pageSize"`
}

type SnapShotUsersResponse added in v0.11.14

type SnapShotUsersResponse struct {
	Infos      []TangentUserLink `json:"infos"`
	TotalCount int64
	// contains filtered or unexported fields
}
type TangentUserLink struct {
	ID           string     `json:"id"`
	TangentID    string     `json:"tangentId"`
	UserID       string     `json:"userId"`
	Name         string     `json:"name"`
	Phone        string     `json:"phone"`
	Status       uint8      `json:"status"`
	DeptID       string     `json:"deptId"`
	DeptName     string     `json:"deptName"`
	PositionID   string     `json:"positionId"`
	PositionName string     `json:"positionName"`
	StartDate    *time.Time `json:"startDate"`
	EndDate      *time.Time `json:"endDate"`
}

func GetRangeSnapShotUsers added in v0.11.19

func GetRangeSnapShotUsers(params *RangeSnapShotUsersQuery) ([]TangentUserLink, int64, error)

func GetSnapShotUser added in v0.11.14

func GetSnapShotUser(params *SnapShotUserQuery) (*TangentUserLink, error)

func GetSnapShotUsers added in v0.11.14

func GetSnapShotUsers(params *SnapShotUsersQuery) ([]TangentUserLink, int64, error)

type TangentUserProfileInfo added in v0.1.6

type TangentUserProfileInfo struct {
	TangentID string `json:"tangentId" binding:"required"`
	ID        string `json:"id" binding:"required"`
	Name      string `json:"name" binding:"required"`
	Phone     string `json:"phone" binding:"required"`
	Thumbnail string `json:"thumbnail"`
	Status    uint8  `json:"status"`
	FirstName string `json:"firstName"`
}

func GetTangentUserProfile added in v0.1.6

func GetTangentUserProfile(params *GetTangentUserProfilesQuery) ([]TangentUserProfileInfo, int64, error)

func GetTangentUserProfileByIDs added in v0.9.8

func GetTangentUserProfileByIDs(tangentID string, userIDs []string) ([]TangentUserProfileInfo, error)

func GetTangentUserProfileByNames added in v0.15.0

func GetTangentUserProfileByNames(tangentID string, names []string) ([]TangentUserProfileInfo, error)

type UpdateInviterUserRequest

type UpdateInviterUserRequest struct {
	UserID      string `json:"userId"`
	InviterID   string `json:"inviterId"`
	InviterType uint8  `json:"inviterType"`
}

type UpdateInviterUserResponse

type UpdateInviterUserResponse struct {
	// contains filtered or unexported fields
}

type UpdateTangentUserProfileRequest added in v0.1.6

type UpdateTangentUserProfileRequest struct {
	TangentID string `json:"tangentId" binding:"required"`
	UserID    string `json:"userId" binding:"required"`
	Name      string `json:"name" `
	Phone     string `json:"phone"`
	Status    uint8  `json:"status"`
}

type UpdateTangentUserProfileResponse added in v0.1.6

type UpdateTangentUserProfileResponse struct {
	Info *TangentUserProfileInfo `json:"info" binding:"required"`
	// contains filtered or unexported fields
}

type UpdateUserLinkBatchParams added in v0.11.14

type UpdateUserLinkBatchParams struct {
	Links []UpdateUserLinkParams `json:"links"`
}

type UpdateUserLinkBatchResponse added in v0.11.14

type UpdateUserLinkBatchResponse struct {
	// contains filtered or unexported fields
}

type UpdateUserLinkParams added in v0.11.14

type UpdateUserLinkParams struct {
	ID           string     `json:"id"`
	TangentID    string     `json:"tangentId"`
	UserID       string     `json:"userId"`
	Name         string     `json:"name"`
	Phone        string     `json:"phone"`
	Status       uint8      `json:"status"`
	DeptID       string     `json:"deptId"`
	DeptName     string     `json:"deptName"`
	PositionID   string     `json:"positionId"`
	PositionName string     `json:"positionName"`
	StartDate    *time.Time `json:"startDate"`
	EndDate      *time.Time `json:"endDate"`
}

type UpdateUserLinkResponse added in v0.11.14

type UpdateUserLinkResponse struct {
	// contains filtered or unexported fields
}

type UserFollowOfficialAccountRequest added in v0.8.5

type UserFollowOfficialAccountRequest struct {
	AppID     string `json:"appId"`
	AppSecret string `json:"appSecret"`
	Event     string `json:"event"`
	OpenID    string `json:"openId" binding:"required"`
}

type UserFollowedOfficialAccountResponse added in v0.8.5

type UserFollowedOfficialAccountResponse struct {
	Followed bool `json:"followed"`
	// contains filtered or unexported fields
}

type UserHis added in v0.11.6

type UserHis struct {
	TangentID  string     `json:"tangentId"`
	UserID     string     `json:"userId"`
	Name       string     `json:"name"`
	Phone      string     `json:"phone"`
	Status     uint8      `json:"status"`
	DeptID     string     `json:"deptId"`
	PositionID string     `json:"positionId"`
	HisType    uint8      `json:"hisType"`
	CreatedAt  *time.Time `json:"createdAt"`
}

func GetUserHisPage added in v0.11.6

func GetUserHisPage(params *GetUserHisPageParams) ([]UserHis, int64, error)

type UserInfo

type UserInfo struct {
	ID              string       `json:"id" binding:"required"`
	UserName        string       `json:"username" binding:"required,excludes= "`
	RoleNames       []string     `json:"roleNames" binding:"required"`
	UserProfileInfo *UserProfile `json:"userProfileInfo"`
	UptUsernameFlag bool         `json:"uptUsernameFlag" binding:"required"`
}

func GetUserInfos

func GetUserInfos(currentTangentID string, userID string, userName string,
	pageNo int, pageSize int) ([]UserInfo, int64, error)

type UserProfile

type UserProfile struct {
	ID        string `json:"id" binding:"required"`
	Name      string `json:"name" binding:"required"`
	Sex       uint8  `json:"sex" binding:"required"`
	Phone     string `json:"phone" binding:"required"`
	Photo     string `json:"photo" binding:"required"`
	Thumbnail string `json:"thumbnail" binding:"required"`
	IDCard    string `json:"id_card"`
	FirstName string `json:"firstName"`
}

func AddressBookSearch added in v0.15.46

func AddressBookSearch(tangentID string, key string, pageNo int, pageSize int) ([]UserProfile, int64, error)

func GetJoinedTangentUsers

func GetJoinedTangentUsers(tangentID string, name string, phone string, status uint8, pageNo int, pageSize int) ([]UserProfile, int64, error)

func GetUserProfiles

func GetUserProfiles(userId string, name string, phone string, pageNo int, pageSize int) ([]UserProfile, int64, error)

func GetUsersByRole

func GetUsersByRole(tangentID string, roleID string) ([]UserProfile, error)

func UpdateUserProfile

func UpdateUserProfile(currentTangentID string, userID string, name string, phone string,
	photo string, sex uint8, idCard string) (*UserProfile, error)

type UserProfileByIDsRequest added in v0.9.5

type UserProfileByIDsRequest struct {
	UserIDs []string `json:"userIds" binding:"required"`
}

type UserProfileByIDsResponse added in v0.9.4

type UserProfileByIDsResponse struct {
	Infos map[string]SimpleInfo `json:"mapInfo"`
	// contains filtered or unexported fields
}

type UserSimpleProfileByIDsResponse added in v0.9.34

type UserSimpleProfileByIDsResponse struct {
	Infos map[string]SimpleInfo1 `json:"mapInfo"`
	// contains filtered or unexported fields
}

type UserWithoutRoleInfo added in v0.8.13

type UserWithoutRoleInfo struct {
	ID        string `json:"id"`
	UserName  string `json:"userName"`
	CreatedAt string `json:"createdAt"`
}

func GetUserWithoutRole added in v0.8.13

func GetUserWithoutRole(userID, userName, start, end string, pageNo, pageSize int) ([]UserWithoutRoleInfo, int64, error)

type WechatScanQrLoginRequest added in v0.9.6

type WechatScanQrLoginRequest struct {
	AppID     string `json:"appId" binding:"required"`
	AppSecret string `json:"appSecret" binding:"required"`
	Code      string `json:"code" binding:"required"`
}

type WechatScanQrLoginResponse added in v0.9.6

type WechatScanQrLoginResponse struct {
	Token string `json:"token" binding:"required"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL