redis_model

package
v0.0.0-...-59da782 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserFieldMap = map[string]func(string, string) (*types.User, error){
	"uid":     mysql.GetUserInfoByUid,
	"phone":   mysql.GetUserInfoByPhone,
	"mark_id": mysql.GetUserInfoByMarkId,
	"account": mysql.GetUserInfoByAccount,
}

Functions

func AcceptFriend

func AcceptFriend(userId, friendId, source string, addTime int64) error

同意好友请求

func AcceptFriendApply

func AcceptFriendApply(userId, friendId string) (int64, error)

func AddMember

func AddMember(tx types.Tx, userId, roomId string, memberLevel int, id, createTime int64, source string) error

增加群成员,同时入群申请的第一步 添加user也用这个方法

func AddMutedMember

func AddMutedMember(id int64, roomId, userId string, mutedType int, deadline int64) error

新增成员禁言

func AddPrivateChatLog

func AddPrivateChatLog(log *types.PrivateLog) (int64, error)

TODO 未测试

func AlertRoomRevStateByRevId

func AlertRoomRevStateByRevId(Id string, state int) error

func AppendApplyLog

func AppendApplyLog(targetId, userId, applyReason, source, remark string, state, tp int, datetime int64) (int64, error)

func AppendMemberRevLog

func AppendMemberRevLog(id int64, userId, logId string, state int) error

添加群聊接收日志

func AppendRoomChatLog

func AppendRoomChatLog(logId int64, userId, roomId, msgId string, msgType, isSnap int, content, ext string, time int64) error

添加群聊聊天日志

func ApproveChangeStateStep

func ApproveChangeStateStep(tx types.Tx, logId int64, status int) (bool, error)

func CheckFriendApplyExists

func CheckFriendApplyExists(userId, friendId string) (bool, error)

func CheckIsFriend

func CheckIsFriend(userId, friendId string) (bool, error)

是否是好友

func ClearDeviceToken

func ClearDeviceToken(userId string) error

func ClearMutedList

func ClearMutedList(tx types.Tx, roomId string) error

func CreateNewRoom

func CreateNewRoom(tx types.Tx, roomId int64, creater, roomName, roomAvatar string, encrypt, canAddFriend, joinPermission, recordPermission, adminMuted, masterMuted int, randomRoomId string, createTime int64) error

func DelMemberMuted

func DelMemberMuted(roomId, userId string) error

取消某个成员禁言,其实是更新那个成员禁言状态

func DelPrivateChatLog

func DelPrivateChatLog(logId string) (int, error)

TODO 未测试

func DelRoomChatLogById

func DelRoomChatLogById(logId string) error

根据id删除群聊天信息

func DeleteFriend

func DeleteFriend(userId, friendId string, alterTime int64) error

删除好友

func DeleteRoomInfoById

func DeleteRoomInfoById(roomId string) error

删除群

func DeleteRoomMemberById

func DeleteRoomMemberById(userId, roomId string) (bool, error)

删除群成员

func FindAddFriendConfByUserId

func FindAddFriendConfByUserId(userId string) (*types.AddFriendConf, error)

func FindApplyLogById

func FindApplyLogById(logId int64) (*types.Apply, error)

根据id获取加好友/群请求记录

func FindApplyLogByUserAndTarget

func FindApplyLogByUserAndTarget(applyUser, target string, tp int) (*types.Apply, error)

func FindDeletedFriends

func FindDeletedFriends(userId string) ([]string, error)

func FindFriendById

func FindFriendById(userID, friendID string) (*types.FriendJoinUser, error)

获取好友信息

func FindFriends

func FindFriends(userId string) ([]string, error)

获取好友列表

func FindFriendsAfterTime

func FindFriendsAfterTime(userId string, commonUse int, time int64) ([]*types.FriendJoinUser, error)

根据是否是常用群筛选

func FindFriendsFilterByCommonUse

func FindFriendsFilterByCommonUse(userId string, commonUse int) ([]*types.FriendJoinUser, error)

根据是否是常用群筛选

func FindNotBurnedLogsAfter

func FindNotBurnedLogsAfter(userId string, isDel int, time int64) ([]*types.PrivateLogJoinUser, error)

func FindNotBurnedLogsBetween

func FindNotBurnedLogsBetween(userId string, isDel int, begin, end int64) ([]*types.PrivateLogJoinUser, error)

func FindPrivateChatLogById

func FindPrivateChatLogById(id string) (*types.PrivateLogJoinUser, error)

func FindPrivateChatLogs

func FindPrivateChatLogs(userId, friendId string, start int64, number int) (int64, []*types.PrivateLogJoinUser, error)

TODO 未测试

func FindReceiveLogById

func FindReceiveLogById(logId, userId string) (*types.RoomMsgReceive, error)

查找recv群消息

func FindRoomChatLogByContentId

func FindRoomChatLogByContentId(logId string) (*types.RoomLogJoinUser, error)

根据logid查群聊天信息

func FindRoomChatLogByMsgId

func FindRoomChatLogByMsgId(senderId, msgId string) (*types.RoomLogJoinUser, error)

根据senderid和msgid查群聊天信息

func FindRoomMemberById

func FindRoomMemberById(roomId, userId string, isDel int) (*types.MemberJoinUser, error)

根据id查询群成员信息

func FindSessionKeyAlert

func FindSessionKeyAlert(userId string, endTime int64) ([]*types.PrivateLogJoinUser, error)

func FindSetNoDisturbingMembers

func FindSetNoDisturbingMembers(roomId string) ([]*types.RoomMember, error)

查找群中消息免打扰的成员

func FindUserIdByDeviceToken

func FindUserIdByDeviceToken(deviceToken string) (string, string, error)

func GetAddFriendApplyLog

func GetAddFriendApplyLog(userId, friendId string) (*types.Apply, error)

func GetCreateRoomsLimit

func GetCreateRoomsLimit(appId string, level int) (int, error)

获取用户创建群个数上限

func GetLoginLog

func GetLoginLog(userId string, devices []string) (*types.LoginLog, error)

func GetMutedListByType

func GetMutedListByType(roomId string, mutedType int) ([]*types.RoomUserMuted, error)

获取某种禁言信息

func GetOrderById

func GetOrderById(serverUrl, orderId string) (*types.Order, error)

交易双方信息

func GetPraiseStatic

func GetPraiseStatic(tp int, startTime, endTime int64) (map[string]*types.RankingItem, error)

获取赞赏榜单

func GetRoomManagerAndMaster

func GetRoomManagerAndMaster(roomId string) ([]*types.MemberJoinUser, error)

获取群中所有管理员

func GetRoomMemberName

func GetRoomMemberName(roomId, userId string) (string, error)

func GetRoomMembersLimit

func GetRoomMembersLimit(appId string, level int) (int, error)

获取群的成员数上限

func GetRoomMutedType

func GetRoomMutedType(roomId string, isDel int) (int, error)

func GetRoomUserLevel

func GetRoomUserLevel(roomId, userId string, isDel int) (int, error)

判断用户是否为管理员或者群主

func GetRoomUserMuted

func GetRoomUserMuted(roomId, userId string) (mutedType int, deadline int64)

func GetToken

func GetToken(appId, token string) (*user_model.Token, error)

通过token获取用户

func GetUserInfoByField

func GetUserInfoByField(appId, field, value string) (*types.User, error)

根据id获取用户信息

func GetUserInfoById

func GetUserInfoById(id string) (*types.User, error)

根据id获取用户信息

func InsertLoginLog

func InsertLoginLog(userID, deviceType, deviceName, loginType, uuid, version string, loginTime int64) (int64, error)

func IsNeedConfirm

func IsNeedConfirm(userId string, state int) error

func RoomInviteConfirm

func RoomInviteConfirm(userId string) (*types.InviteRoomConf, error)

func SavePraiseStatic

func SavePraiseStatic(tp int, items map[string]*types.RankingItem, startTime, endTime int64) error

存储赞赏榜单

func SaveToken

func SaveToken(tokenInfo *user_model.Token) error

通过token获取用户

func SearchRoomInfo

func SearchRoomInfo(roomid string, isDel int) (*types.Room, error)

根据room id获取群信息

func SetAvatar

func SetAvatar(roomId, avatar string, isDel int) (bool, error)

func SetCreateRoomsLimit

func SetCreateRoomsLimit(appId string, level, limit int) error

设置用户创建群个数上限

func SetFriendDND

func SetFriendDND(userId, friendId string, DND int) error

func SetFriendExtRemark

func SetFriendExtRemark(userId, friendId, remark string) error

func SetFriendIsBlock

func SetFriendIsBlock(userId, friendId string, state int, alterTime int64) error

设置黑名单

func SetFriendIsTop

func SetFriendIsTop(userId, friendId string, isTop int) error

func SetFriendRemark

func SetFriendRemark(userId, friendId, remark string) error

func SetMemberLevel

func SetMemberLevel(userId, roomId string, level, isDel int) error

设置成员等级

func SetMemberNickname

func SetMemberNickname(userId, roomId string, nickname string, isDel int) error

func SetNeedAnswer

func SetNeedAnswer(userId, question, answer string) error

func SetNewMaster

func SetNewMaster(master, userId, roomId string, level int) error

转让群主 master原群主id userid新群主id

func SetNoDisturbing

func SetNoDisturbing(userId, roomId string, permission, isDel int) error

func SetNotNeedAnswer

func SetNotNeedAnswer(userId string) error

func SetOnTop

func SetOnTop(userId, roomId string, permission, isDel int) error

func SetPermission

func SetPermission(roomId string, canAddFriend, joinPermission, recordPermission, isDel int) error

set三种permission,写在一起

func SetQuestionandAnswer

func SetQuestionandAnswer(userId, question, answer string) error

func SetRoomInviteConfirm

func SetRoomInviteConfirm(userId string, needConfirm int) error

func SetRoomMembersLimit

func SetRoomMembersLimit(appId string, level, limit int) error

设置群的成员数上限

func SetRoomMutedType

func SetRoomMutedType(roomId string, mutedType, isDel int) error

func SetRoomName

func SetRoomName(roomId, name string, isDel int) (bool, error)

设置群名

func SetRoomVerifyed

func SetRoomVerifyed(roomId, vInfo string) error

设置为加v认证群

func UpdateApply

func UpdateApply(applyUser, target string, tp int, reason, remark, source string, state int) (int64, error)

func UpdateDepositAddress

func UpdateDepositAddress(userId, address string) error

更新账户地址

func UpdateDeviceToken

func UpdateDeviceToken(userId, deviceToken, deviceType string) error

func UpdateEmail

func UpdateEmail(userId, email string) error

更新用户邮箱

func UpdateInviteCode

func UpdateInviteCode(userId, code string) error

func UpdateNowVersion

func UpdateNowVersion(userId, version string) error

func UpdatePhone

func UpdatePhone(userId, phone string) error

更新用户手机号

func UpdatePrivateLogContentById

func UpdatePrivateLogContentById(logId, content string) error

func UpdatePrivateLogStateById

func UpdatePrivateLogStateById(logId string, state int) error

func UpdatePublicKey

func UpdatePublicKey(userId, publicKey, privateKey string) error

func UpdateUid

func UpdateUid(markId, userId, uid string) error

func UpdateUserAvatar

func UpdateUserAvatar(userId, avatar string) error

更新用户头像

func UpdateUsername

func UpdateUsername(userId, username string) error

更新用户名

Types

type By

type By func(p1, p2 *types.PrivateLogJoinUser) bool

By is the type of a "less" function that defines the ordering of its Planet arguments.

func (By) Sort

func (by By) Sort(logs []*types.PrivateLogJoinUser)

Sort is a method on the function type, By, that sorts the argument slice according to the function.

Jump to

Keyboard shortcuts

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