im_mysql_model

package
v0.0.0-...-4702bed Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(userID string, phoneNumber string, name string, email string, gender int32, faceURL string, birth string) error

func AddUserRegisterAddFriendIDList

func AddUserRegisterAddFriendIDList(userIDList ...string) error

func BatchCreateInvitationCodes

func BatchCreateInvitationCodes(CodeNums int, CodeLen int) ([]string, error)

*

  • 批量生成邀请码

func BatchInsertIntoGroupMember

func BatchInsertIntoGroupMember(toInsertInfoList []*db.GroupMember) error

func BlockUser

func BlockUser(userID, endDisableTime string) error

func CheckBlack

func CheckBlack(ownerUserID, blockUserID string) error

func CheckInvitationCode

func CheckInvitationCode(code string) error

*

  • 检查邀请码

func CreateDepartment

func CreateDepartment(department *db.Department) error

func CreateDepartmentMember

func CreateDepartmentMember(departmentMember *db.DepartmentMember) error

func CreateOrganizationUser

func CreateOrganizationUser(organizationUser *db.OrganizationUser) error

func CreateRandomString

func CreateRandomString(strlen int) string

func DelGroupRequestByGroupIDAndUserID

func DelGroupRequestByGroupIDAndUserID(groupID, userID string) error

func DeleteAllRegisterAddFriendIDList

func DeleteAllRegisterAddFriendIDList() error

func DeleteDepartment

func DeleteDepartment(departmentID string) error

func DeleteGroupMemberByGroupID

func DeleteGroupMemberByGroupID(groupID string) error

func DeleteGroupMemberByGroupIDAndUserID

func DeleteGroupMemberByGroupIDAndUserID(groupID, userID string) error

func DeleteOneFromIpLimits

func DeleteOneFromIpLimits(ip string) error

func DeleteOrganizationUser

func DeleteOrganizationUser(OrganizationUserID string) error

func DeleteSingleFriendInfo

func DeleteSingleFriendInfo(OwnerUserID, FriendUserID string) error

func DeleteUserInAllDepartment

func DeleteUserInAllDepartment(userID string) error

func DeleteUserInDepartment

func DeleteUserInDepartment(departmentID, userID string) error

func DeleteUserIpLimitsLogin

func DeleteUserIpLimitsLogin(userID, ip string) error

func FinishInvitationCode

func FinishInvitationCode(Code string, UserId string) bool

*

  • 完成邀请码的状态

func GetActiveGroups

func GetActiveGroups(from, to time.Time, limit int) ([]*activeGroup, error)

func GetActiveUserNum

func GetActiveUserNum(from, to time.Time) (int32, error)

func GetActiveUsers

func GetActiveUsers(from, to time.Time, limit int) ([]*activeUser, error)

func GetAllOrganizationUserID

func GetAllOrganizationUserID() (error, []string)

func GetAllUser

func GetAllUser() ([]db.User, error)

func GetBlackIDListByUserID

func GetBlackIDListByUserID(ownerUserID string) ([]string, error)

func GetBlackListByUserID

func GetBlackListByUserID(ownerUserID string) ([]db.Black, error)

func GetBlockUsersNumCount

func GetBlockUsersNumCount() (int32, error)

func GetChatLog

func GetChatLog(chatLog *db.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []db.ChatLog, error)

func GetClientInitConfig

func GetClientInitConfig() (db.ClientInitConfig, error)

func GetConversation

func GetConversation(OwnerUserID, conversationID string) (db.Conversation, error)

func GetConversationIDListByUserID

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

func GetConversations

func GetConversations(OwnerUserID string, conversationIDs []string) ([]db.Conversation, error)

func GetConversationsByConversationIDMultipleOwner

func GetConversationsByConversationIDMultipleOwner(OwnerUserIDList []string, conversationID string) ([]db.Conversation, error)

func GetDepartment

func GetDepartment(departmentID string) (*db.Department, error)

func GetDepartmentMemberList

func GetDepartmentMemberList(departmentID string) ([]db.DepartmentMember, error)

func GetDepartmentMemberNum

func GetDepartmentMemberNum(departmentID string) (error, uint32)

func GetDepartmentMemberUserIDList

func GetDepartmentMemberUserIDList(departmentID string) (error, []string)

func GetDepartmentParent

func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]string) error

func GetDepartmentParentIDList

func GetDepartmentParentIDList(departmentID string) ([]string, error)

func GetDepartmentRelatedGroupIDList

func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error)

func GetExistConversationUserIDList

func GetExistConversationUserIDList(ownerUserIDList []string, conversationID string) ([]string, error)

func GetFriendApplicationByBothUserID

func GetFriendApplicationByBothUserID(FromUserID, ToUserID string) (*db.FriendRequest, error)

FromUserId apply to add ToUserID

func GetFriendIDListByUserID

func GetFriendIDListByUserID(OwnerUserID string) ([]string, error)

func GetFriendListByUserID

func GetFriendListByUserID(OwnerUserID string) ([]db.Friend, error)

func GetFriendRelationshipFromFriend

func GetFriendRelationshipFromFriend(OwnerUserID, FriendUserID string) (*db.Friend, error)

func GetGroupApplicationList

func GetGroupApplicationList(userID string) ([]db.GroupRequest, error)

received

func GetGroupIDListByGroupType

func GetGroupIDListByGroupType(groupType int) ([]string, error)

func GetGroupInfoByGroupID

func GetGroupInfoByGroupID(groupID string) (*db.Group, error)

func GetGroupInfoByGroupIDList

func GetGroupInfoByGroupIDList(groupIDList []string) ([]*db.Group, error)

func GetGroupMemberByGroupID

func GetGroupMemberByGroupID(groupID string, filter int32, begin int32, maxNumber int32) ([]db.GroupMember, error)

func GetGroupMemberByUserIDList

func GetGroupMemberByUserIDList(groupID string, userIDList []string) ([]*db.GroupMember, error)

func GetGroupMemberIDListByGroupID

func GetGroupMemberIDListByGroupID(groupID string) ([]string, error)

func GetGroupMemberInfoByGroupIDAndUserID

func GetGroupMemberInfoByGroupIDAndUserID(groupID, userID string) (*db.GroupMember, error)

func GetGroupMemberListByGroupID

func GetGroupMemberListByGroupID(groupID string) ([]db.GroupMember, error)

func GetGroupMemberListByGroupIDAndRoleLevel

func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error)

func GetGroupMemberListByUserID

func GetGroupMemberListByUserID(userID string) ([]db.GroupMember, error)

func GetGroupMemberNumByGroupID

func GetGroupMemberNumByGroupID(groupID string) (int64, error)

func GetGroupMembersByGroupIdCMS

func GetGroupMembersByGroupIdCMS(groupId string, userName string, showNumber, pageNumber int32) ([]db.GroupMember, error)

func GetGroupMembersCount

func GetGroupMembersCount(groupID, userName string) (int64, error)

func GetGroupMessageNum

func GetGroupMessageNum(from, to time.Time) (int32, error)

func GetGroupNum

func GetGroupNum(to time.Time) (int32, error)

func GetGroupOwnerInfoByGroupID

func GetGroupOwnerInfoByGroupID(groupID string) (*db.GroupMember, error)

func GetGroupRequestByGroupID

func GetGroupRequestByGroupID(groupID string) ([]db.GroupRequest, error)

func GetGroupRequestByGroupIDAndUserID

func GetGroupRequestByGroupIDAndUserID(groupID, userID string) (*db.GroupRequest, error)

func GetGroupsCountNum

func GetGroupsCountNum(group db.Group) (int32, error)

func GetIncreaseGroupNum

func GetIncreaseGroupNum(from, to time.Time) (int32, error)

func GetIncreaseUserNum

func GetIncreaseUserNum(from, to time.Time) (int32, error)

func GetInvitationCode

func GetInvitationCode(code string) (*db.Invitation, error)

func GetInvitationCodes

func GetInvitationCodes(showNumber, pageNumber, status int32) ([]db.Invitation, int64, error)

func GetIpLimitsLoginByUserID

func GetIpLimitsLoginByUserID(userID string) ([]db.UserIpLimit, error)

func GetJoinedGroupIDListByUserID

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

func GetMultipleUserConversationByConversationID

func GetMultipleUserConversationByConversationID(ownerUserIDList []string, conversationID string) ([]db.Conversation, error)

func GetNewestVersion

func GetNewestVersion(appType int) (*db.AppVersion, error)

func GetOrganizationUser

func GetOrganizationUser(userID string) (error, *db.OrganizationUser)

func GetOrganizationUsers

func GetOrganizationUsers(userIDList []string) ([]*db.OrganizationUser, error)

func GetOwnerManagerByGroupID

func GetOwnerManagerByGroupID(groupID string) ([]db.GroupMember, error)

func GetPrivateMessageNum

func GetPrivateMessageNum(from, to time.Time) (int32, error)

func GetRandomDepartmentID

func GetRandomDepartmentID() (string, error)

func GetReceivedFriendsApplicationListByUserID

func GetReceivedFriendsApplicationListByUserID(ToUserID string) ([]db.FriendRequest, error)

who apply to add me

func GetRegister

func GetRegister(account, areaCode, userID string) (*db.Register, error)

func GetRegisterAddFriendList

func GetRegisterAddFriendList(showNumber, pageNumber int32) ([]string, error)

func GetRegisterInfo

func GetRegisterInfo(userID string) (*db.Register, error)

func GetRegisterUserNum

func GetRegisterUserNum(ip string) ([]string, error)

func GetSendFriendApplicationListByUserID

func GetSendFriendApplicationListByUserID(FromUserID string) ([]db.FriendRequest, error)

I apply to add somebody

func GetSubDepartmentList

func GetSubDepartmentList(departmentID string) ([]db.Department, error)

func GetSubDepartmentNum

func GetSubDepartmentNum(departmentID string) (error, uint32)

func GetTotalGroupNum

func GetTotalGroupNum() (int32, error)

func GetTotalUserNum

func GetTotalUserNum() (int32, error)

func GetTotalUserNumByDate

func GetTotalUserNumByDate(to time.Time) (int32, error)

func GetUserAllConversations

func GetUserAllConversations(ownerUserID string) ([]db.Conversation, error)

func GetUserByName

func GetUserByName(userName string, showNumber, pageNumber int32) ([]db.User, error)

func GetUserByUserID

func GetUserByUserID(userID string) (*db.User, error)

func GetUserIDsByEmailAndID

func GetUserIDsByEmailAndID(phoneNumber, email string) ([]string, error)

func GetUserIPLimit

func GetUserIPLimit(userID string) (db.UserIpLimit, error)

func GetUserInDepartment

func GetUserInDepartment(userID string) (error, []db.DepartmentMember)

func GetUserNameByUserID

func GetUserNameByUserID(userID string) (string, error)

func GetUserReqGroupByUserID

func GetUserReqGroupByUserID(userID string) ([]db.GroupRequest, error)

func GetUsers

func GetUsers(showNumber, pageNumber int32) ([]db.User, error)

func GetUsersByNameAndID

func GetUsersByNameAndID(content string, showNumber, pageNumber int32) ([]db.User, int64, error)

func GetUsersByUserIDList

func GetUsersByUserIDList(userIDList []string) ([]*db.User, error)

func GetUsersCount

func GetUsersCount(userName string) (int32, error)

func InsertFriendApplication

func InsertFriendApplication(friendRequest *db.FriendRequest, args map[string]interface{}) error

func InsertInToUserBlackList

func InsertInToUserBlackList(black db.Black) error

func InsertIntoGroup

func InsertIntoGroup(groupInfo db.Group) error

func InsertIntoGroupMember

func InsertIntoGroupMember(toInsertInfo db.GroupMember) error

func InsertIntoGroupRequest

func InsertIntoGroupRequest(toInsertInfo db.GroupRequest) error

func InsertIpRecord

func InsertIpRecord(userID, createIp string) error

func InsertOneIntoIpLimits

func InsertOneIntoIpLimits(ipLimits db.IpLimit) error

func InsertToFriend

func InsertToFriend(toInsertFollow *db.Friend) error

func InsertUserIpLimitsLogin

func InsertUserIpLimitsLogin(userIp *db.UserIpLimit) error

func IsExistGroupMember

func IsExistGroupMember(groupID, userID string) bool

func IsGroupOwnerAdmin

func IsGroupOwnerAdmin(groupID, UserID string) bool

func IsLimitLoginIp

func IsLimitLoginIp(LoginIp string) (bool, error)

func IsLimitRegisterIp

func IsLimitRegisterIp(RegisterIp string) (bool, error)

func IsLimitUserLoginIp

func IsLimitUserLoginIp(userID string, loginIp string) (limit bool, err error)

func OperateGroupStatus

func OperateGroupStatus(groupId string, groupStatus int32) error

func PeerUserSetConversation

func PeerUserSetConversation(conversation db.Conversation) error

func QueryIPLimits

func QueryIPLimits(ip string) (*db.IpLimit, error)

func QueryUserIPLimits

func QueryUserIPLimits(ip string) ([]db.UserIpLimit, error)

func ReduceUserRegisterAddFriendIDList

func ReduceUserRegisterAddFriendIDList(userIDList ...string) error

func RemoveBlackList

func RemoveBlackList(ownerUserID, blockUserID string) error

func ResetPassword

func ResetPassword(account, password string) error

func SelectAllUserID

func SelectAllUserID() ([]string, error)

func SelectSomeUserID

func SelectSomeUserID(userIDList []string) ([]string, error)

func SetClientInitConfig

func SetClientInitConfig(m map[string]interface{}) error

func SetConversation

func SetConversation(conversation db.Conversation) (bool, error)

func SetDepartmentRelatedGroupID

func SetDepartmentRelatedGroupID(groupID, departmentID string) error

func SetGroupInfo

func SetGroupInfo(groupInfo db.Group) error

func SetOneConversation

func SetOneConversation(conversation db.Conversation) error

func SetPassword

func SetPassword(account, password, ex, userID, areaCode, ip string) error

func SetRecvMsgOpt

func SetRecvMsgOpt(conversation db.Conversation) (bool, error)

func TryLockInvitationCode

func TryLockInvitationCode(Code string, UserID string) bool

*

  • 尝试加锁模式解决邀请码抢占的问题

func UnBlockUser

func UnBlockUser(userID string) error

func UpdateAppVersion

func UpdateAppVersion(appType int, version string, forceUpdate bool, fileName, yamlName, updateLog string) error

func UpdateColumnsConversations

func UpdateColumnsConversations(ownerUserIDList []string, conversationID string, args map[string]interface{}) error

func UpdateDepartment

func UpdateDepartment(department *db.Department, args map[string]interface{}) error

func UpdateFriendApplication

func UpdateFriendApplication(friendRequest *db.FriendRequest) error

func UpdateFriendComment

func UpdateFriendComment(OwnerUserID, FriendUserID, Remark string) error

func UpdateGroupInfoDefaultZero

func UpdateGroupInfoDefaultZero(groupID string, args map[string]interface{}) error

func UpdateGroupMemberInfo

func UpdateGroupMemberInfo(groupMemberInfo db.GroupMember) error

func UpdateGroupMemberInfoByMap

func UpdateGroupMemberInfoByMap(groupMemberInfo db.GroupMember, m map[string]interface{}) error

func UpdateGroupMemberInfoDefaultZero

func UpdateGroupMemberInfoDefaultZero(groupMemberInfo db.GroupMember, args map[string]interface{}) error

func UpdateGroupRequest

func UpdateGroupRequest(groupRequest db.GroupRequest) error

func UpdateIpReocord

func UpdateIpReocord(userID, ip string) (err error)

func UpdateOrganizationUser

func UpdateOrganizationUser(organizationUser *db.OrganizationUser, args map[string]interface{}) error

func UpdateUserInDepartment

func UpdateUserInDepartment(departmentMember *db.DepartmentMember, args map[string]interface{}) error

func UpdateUserInfo

func UpdateUserInfo(user db.User) error

func UpdateUserInfoByMap

func UpdateUserInfoByMap(user db.User, m map[string]interface{}) error

func UserIsBlock

func UserIsBlock(userId string) (bool, error)

func UserRegister

func UserRegister(user db.User) error

func UsersIsBlock

func UsersIsBlock(userIDList []string) (inBlockUserIDList []string, err error)

Types

type BlockUserInfo

type BlockUserInfo struct {
	User             db.User
	BeginDisableTime time.Time
	EndDisableTime   time.Time
}

func GetBlockUserByID

func GetBlockUserByID(userId string) (BlockUserInfo, error)

func GetBlockUsers

func GetBlockUsers(showNumber, pageNumber int32) ([]BlockUserInfo, error)

type FriendUser

type FriendUser struct {
	db.Friend
	Nickname string `gorm:"column:name;size:255"`
}

func GetFriendByIDCMS

func GetFriendByIDCMS(ownerUserID, friendUserID string) (friendUser *FriendUser, err error)

func GetUserFriendsCMS

func GetUserFriendsCMS(ownerUserID, friendUserName string, pageNumber, showNumber int32) (friendUserList []*FriendUser, count int64, err error)

type GroupWithNum

type GroupWithNum struct {
	db.Group
	MemberCount int `gorm:"column:num"`
}

func GetGroups

func GetGroups(pageNumber, showNumber int) ([]GroupWithNum, error)

func GetGroupsByName

func GetGroupsByName(groupName string, pageNumber, showNumber int32) ([]GroupWithNum, int64, error)

Jump to

Keyboard shortcuts

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