mbum

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

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, userID string,
	name string, phone string) 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 Destroy

func Destroy()

func GetJoinedTangents

func GetJoinedTangents(userID string) ([]string, error)

func GetUserFace

func GetUserFace(userID string) (string, error)

func GetWechatUserCurTangentID

func GetWechatUserCurTangentID(openID string) (string, error)

func GetWechatUserID

func GetWechatUserID(openID 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 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 WechatUserLogin

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

Types

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 DeleteInviterUserResponse

type DeleteInviterUserResponse struct {
	// 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 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 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"`
}

func GetJoinTangentApplies

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

type LoginCmsResponse

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

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 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 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"`
}

func GetJoinedTangentUsers

func GetJoinedTangentUsers(tangentID string, name string, phone string, 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)

Jump to

Keyboard shortcuts

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