Documentation ¶
Index ¶
- Constants
- Variables
- func GetGroupRouteById(str string) string
- func GetRoomRouteById(str string) string
- func NewackChatLogs() ackChatLogs
- func NewchatLogs() chatLogs
- type ActiveUsersView
- type AddFriendConf
- type Admin
- type AdminOptLog
- type AdminOptLogView
- type Advertisement
- type App
- type Apply
- type ApplyInfo
- type ApplyList
- type BatchConfig
- type CacheType
- type ChatLog
- type Clist
- type Coin
- type CoinInfoParams
- type Config
- type Env
- type ExtRemark
- type FileStore
- type Friend
- type FriendInfoApi
- type FriendJoinUser
- type InfoParams
- type InviteRoomConf
- type LastLoginInfo
- type Limit
- type Log
- type LoginLog
- type Member
- type MemberJoinRoom
- type MemberJoinUser
- type Module
- type Mysql
- type NotConfirmAppId
- type Order
- type OssAddress
- type Praise
- type PraiseBoardHistory
- type PraiseRecord
- type PraiseUser
- type PrivateLog
- type PrivateLogJoinUser
- type RPReceiveInfo
- type RPStatisticInfo
- type RankingItem
- type RankingItemWrapper
- type Rate
- type ReceiveDetailParams
- type ReceiveParams
- type Record
- type RedPacket
- type RedPacketInfo
- type RedPacketLog
- type Redis
- type ReqBase
- type Room
- type RoomCid
- type RoomConfig
- type RoomJoinUser
- type RoomLog
- type RoomLogJoinUser
- type RoomMember
- type RoomMemberInfo
- type RoomMsgReceive
- type RoomUserMued
- type RoomUserMuted
- type SMS
- type SendParams
- type Sender
- type Server
- type Service
- type StatisticParams
- type Tx
- type UPushType
- type User
- type UserConfig
- type VerifyApply
- type VerifyApplyJoinRoomAndUser
- type VerifyApplyJoinUser
- type VerifyFee
- type Version
Constants ¶
View Source
const ( CountNew = 0 CountActive = 1 CountOpen = 2 CountAll = 3 BanUser = 1 BanRoom = 2 BanUserCancel = 3 BanRoomCancel = 4 QueryUsersAll = 99 QueryUsersUnClose = 0 QueryUsersClosed = 1 QueryRoomsAll = 99 QueryRoomsUnClose = 0 QueryRoomsClosed = 1 QueryRoomsRecommend = 2 QueryAdminOptLogAll = 99 QueryAdminOptLogBanUser = 0 QueryAdminOptLogBanRoom = 1 QueryAdminOptLogCancleBanUser = 2 QueryAdminOptLogCancleBanRoom = 3 AdIsNotDelete = 0 AdIsDelete = 1 MaxAdNumbers = 5 AdIsActive = 1 AdIsNotActive = 0 )
View Source
const ( IsInnerAccount = 1 IsNotInnerAccount = 0 IsOtc = 1 )
View Source
const ( DbMsgLength = 7168 // AppIdZhaobi = "1001" //找币 AppIdPWalelt = "1002" //敢么 AppIdYuanScraper = "1003" // AppIdFunnyChat = "1004" //趣信 AppIdTwitter = "1005" //推特链 AppIdTSC = "1006" //TS钱包 DeviceWeb = "Web" DeviceAndroid = "Android" DeviceIOS = "iOS" DevicePC = "PC" //用户登录身份 LevelVisitor = 0 LevelMember = 1 LevelCs = 2 LevelAdmin = 3 //登录时的验证方式 LoginTypeSms = 1 LoginTypePwd = 2 LoginTypeEmail = 3 LoginTypeEmailPwd = 4 // 获取聊天历史记录条数上限 ChatHistoryLimit = 1000 //分页搜索 SearchAll = -1 )
View Source
const ( IsRoom = 1 IsFriend = 2 )
View Source
const ( // channelType ToGroup = 1 ToRoom = 2 ToUser = 3 IsSnap = 1 //阅后即焚 IsNotSnap = 2 //message state HadRead = 1 //已读 NotRead = 2 //未读 HadBurnt = 3 //已经被焚毁 )
message about
View Source
const ( //event type EventCommonMsg = 0 //普通消息 EventOtherDeviceLogin = 9 EventUserClosed = 10 EventRoomClosed = 11 EventJoinRoom = 20 EventLogOutRoom = 21 EventRemoveRoom = 22 EventJoinApply = 23 EventRoomOnlineNumber = 24 EventRoomMuted = 25 //更新加密群会话秘钥 EventUpdateSKey = 26 //同步群会话秘钥 EventStartGetAllSKey = 27 EventGetAllSKey = 28 EventGetAllSKeySuccess = 29 EventAddFriend = 31 //C->S 用户更新公钥 EventUpdatePublicKey = 33 //S->C 广播用户更新的公钥 EventBroadcastPubKey = 34 EventBatchPush = 40 EventBatchPushUnread = 41 EventSyncMsg = 42 EventSyncMsgRlt = 43 //批量推送 EventBatchCustomize = 44 //开始消息确认 EventStartAck = 45 EventBatchAck = 46 EventAckSuccess = 47 // msgType System = 0 Text = 1 Audio = 2 Photo = 3 RedPack = 4 Video = 5 Alert = 6 Forward = 8 File = 9 Transfer = 10 //转账 Receipt = 11 //收款 RoomInvite = 12 //入群邀请 //alert type //ws消息通知类型 AlertRevokeMsg = 1 AlertCreateRoom = 2 AlertLoginOutRoom = 3 AlertKickOutRoom = 4 AlertJoinInRoom = 5 AlertRemoveRoom = 6 AlertAddFriendInRoom = 7 AlertDeleteFriend = 8 AlertSetAsMaster = 9 AlertSetAsManager = 10 AlertRenameRoom = 11 AlertReceiveRedpackage = 12 AlertAddFriend = 13 AlertRoomMuted = 14 AlertHadBurntMsg = 15 AlertPrintScreen = 16 AlertInviteJoinRoom = 17 //收款成功 AlertPayment = 18 //更新群秘钥 AlertUpdateSKey = 19 //拒绝加入群聊 AlertRoomInviteReject = 20 //赞赏通知 AlertPraise = 22 )
View Source
const ( //是否消息免打扰 1免打扰 2关闭 NoDisturbingOn = 1 NoDisturbingOff = 2 //是否是常用类型 1 普通 2 常用 UncommonUse = 1 CommonUse = 2 CommonUseFindAll = 3 //是否置顶 1置顶 2不置顶 OnTop = 1 NotOnTop = 2 //是否可查看入群之前历史记录 CanVisitLog = 1 CanNotVisitLog = 2 IsEncrypt = 1 IsNotEncrypt = 2 )
Personal set
View Source
const ( SingleForward = 1 MergeForward = 2 )
forward
View Source
const ( //http request 参数 AcceptRequest = 1 RejectRequest = 2 //apply ack AwaitState = 1 RejectState = 2 AcceptState = 3 )
Apply
View Source
const ( //红包toid 1群 0好友 RPToUser = 0 RPToRoom = 1 PacketTypeLucky = 1 //拼手气红包 PacketTypeAdv = 2 //推广红包 RecvForOldCustomer = 1 //老用户领取 RecvForNewCustomer = 2 //未注册用户领取 PageNo = 1 PageLimit = 15 )
red packet
View Source
const ( //消息是否同步推送 RecentUnpush = 1 RecentPushed = 2 )
View Source
const ( DevAndroid = 1 DevIOS = 2 )
个推安卓ios
View Source
const ( //加群/好友来源 Search = 1 Scan = 2 Group = 4 //通过群 // Invite = 4 Unknow = 5 )
View Source
const ( //认证对象 VerifyForUser = 1 VerifyForRoom = 2 //认证状态 //1:待审核;2已认证;3未通过 VerifyStateWait = 1 VerifyStateAccept = 2 VerifyStateReject = 3 //认证处理请求参数 VerifyApproveReject = 0 VerifyApproveAccept = 1 VerifyApproveFeeBack = 2 //认证费用去向 VerifyRecordCost = 1 VerifyRecordRefund = 2 //认证费用到账状态 VerifyFeeStateCosting = 0 VerifyFeeStateSuccess = 1 VerifyFeeStateFailed = 2 VerifyFeeStateBacking = 3 VerifyFeeStateBackSuccess = 4 VerifyFeeStateBackFailed = 5 //群和用户状态 是否认证 Unverified = 0 Verified = 1 //群 认证人数限制 VerifiedLimitMembers = 5000 //加v申请时间间隔 单位分钟 //7天 VerifyApplyInterval = 10080 )
View Source
const ( //是否删除 1 未删除 2 已删除 FriendIsNotDelete = 1 FriendIsDelete = 2 )
好友表里的字段
View Source
const ( //PS praise state PS_Like = 1 << iota PS_Reward )
View Source
const ( Like = 1 Reward = 2 )
View Source
const ( PraiseIsDelete = 1 PraiseIsNotDelete = 0 )
View Source
const ( RoomLevelNotExist = 0 RoomLevelNomal = 1 RoomLevelManager = 2 RoomLevelMaster = 3 CanAddFriend = 1 CanNotAddFriend = 2 ShouldApproval = 1 ShouldNotApproval = 2 CanNotJoinRoom = 3 CanReadAllLog = 1 CanNotReadAllLog = 2 RoomUserNotDeleted = 1 RoomUserDeleted = 2 RoomUserDeletedOrNot = 99 RoomMsgNotDelete = 1 RoomMsgDeleted = 2 RoomNotDeleted = 1 RoomDeleted = 2 RoomDeletedOrNot = 99 RoomRecommend = 1 RoomNotRecommend = 0 )
View Source
const ( AdminMuted = 2 AdminNotMuted = 1 MasterMuted = 2 MasterNotMuted = 1 AllSpeak = 1 Blacklist = 2 Whitelist = 3 AllMuted = 4 MutedEnable = 1 MutedDisable = 2 MutedForvevr = 7258089600000 )
Room Muted
View Source
const AddSuccess = 3 //添加成功
View Source
const AnswerFalse = 1 //答案错误
View Source
const (
AuthType = "Bearer"
)
View Source
const FriendMsgIsDelete = 1
View Source
const FriendMsgIsNotDelete = 2
View Source
const IsBlocked = 1
View Source
const IsDelete = 2
View Source
const IsNotBlocked = 0
View Source
const IsNotDelete = 1
是否删除 1 未删除 2 已删除
View Source
const NeedAnswer = 1
1 需要回答问题 2 不需要回答
View Source
const NeedConfirm = 1
加好友设置 1需要验证 2 不需要验证
View Source
const NotNeedAnswer = 2
View Source
const NotNeedConfirm = 2
View Source
const RemarkLengthLimit = 20
View Source
const RoomInviteNeedConfirm = 1
邀请入群 1需要验证 0 不需要验证
View Source
const RoomInviteNotNeedConfirm = 2
View Source
const SendSuccess = 2 //请求发送成功
Variables ¶
View Source
var CustomServiceInfo = map[string]string{
AppIdZhaobi: "微信号zhaobikefu",
AppIdFunnyChat: "QQ号762389302",
AppIdTSC: "微信号17621543259",
}
chat appId --> red packet Platform
View Source
var DefaultInviteConfig = map[string]int{ "1001": RoomInviteNotNeedConfirm, "1006": RoomInviteNeedConfirm, }
View Source
var ERR_APPNOTFIND = errors.New("app未认证")
View Source
var ERR_LOGIN_EXPIRED = errors.New("登录过期")
View Source
var ERR_NOTSUPPORT = errors.New("暂不支持该功能")
View Source
var ERR_REPEAT_MSG = errors.New("重复发送的消息")
View Source
var ERR_SYS_RESULT = errors.New("该功能无法使用")
View Source
var ExcelAddr = ""
View Source
var QueryAdminOptDbToParam = map[int]int{ BanUser: QueryAdminOptLogBanUser, BanRoom: QueryAdminOptLogBanRoom, BanUserCancel: QueryAdminOptLogCancleBanUser, BanRoomCancel: QueryAdminOptLogCancleBanRoom, }
request param --> db tag
View Source
var QueryAdminOptParamToDb = map[int]int{ QueryAdminOptLogBanUser: BanUser, QueryAdminOptLogBanRoom: BanRoom, QueryAdminOptLogCancleBanUser: BanUserCancel, QueryAdminOptLogCancleBanRoom: BanRoomCancel, }
request param --> db tag
View Source
var VerifyApproveToState = map[int]int{ VerifyApproveReject: VerifyStateReject, VerifyApproveAccept: VerifyStateAccept, }
View Source
var VerifyFeeRecord = map[int]int{ VerifyFeeStateCosting: VerifyRecordCost, VerifyFeeStateBacking: VerifyRecordRefund, }
Functions ¶
func GetGroupRouteById ¶
func GetRoomRouteById ¶
func NewackChatLogs ¶
func NewackChatLogs() ackChatLogs
func NewchatLogs ¶
func NewchatLogs() chatLogs
Types ¶
type ActiveUsersView ¶
type AddFriendConf ¶
type AdminOptLog ¶
type AdminOptLogView ¶
type Advertisement ¶
type App ¶
type App struct { AppId string `json:"app_id"` AccountServer string `json:"user_info_url"` RPPid string RPServer string RPUrl string IsInner int MainCoin string AppKey string //`json:"-"` AppSecret string //`json:"-"` //推送相关 PushAppKey UPushType PushAppMasterSecret UPushType PushMiActive UPushType //走系统推送时打开的active //模块启用状态 Modules []*Module //otc IsOtc int OtcServer string //oss OssConfig *OssAddress }
type ApplyList ¶
type ApplyList struct { SenderInfo *ApplyInfo `json:"senderInfo"` ReceiveInfo *ApplyInfo `json:"receiveInfo"` Id string `json:"id"` Type int `json:"type"` ApplyReason string `json:"applyReason"` Status int `json:"status"` Datetime int64 `json:"datetime"` Source string `json:"source"` Source2 interface{} `json:"source2"` }
type BatchConfig ¶
type ChatLog ¶
type ChatLog struct { LogId string `json:"logId"` MsgId string `json:"msgId"` ChannelType int `json:"channelType"` IsSnap int `json:"isSnap"` FromId string `json:"fromId"` TargetId string `json:"targetId"` MsgType int `json:"msgType"` Msg interface{} `json:"msg"` Datetime int64 `json:"datetime"` SenderInfo interface{} `json:"senderInfo"` Ext interface{} `json:"ext"` Praise interface{} `json:"praise",omitempty` // contains filtered or unexported fields }
聊天记录
type Clist ¶
type Clist struct { Enterprise struct { Name string `json:"name"` } `json:"enterprise"` Members []*Member }
公司-员工列表
type CoinInfoParams ¶
type CoinInfoParams struct {
PlatformId string `json:"platform_id"`
}
type Friend ¶
type Friend struct { UserId string FriendId string Remark string AddTime int64 DND int Top int Type int IsDelete int Source string ExtRemark string IsBlocked int }
--------------friend-------------//
type FriendInfoApi ¶
type FriendInfoApi struct { Uid string `json:"uid"` Id string `json:"id"` Name string `json:"name"` Avatar string `json:"avatar"` Remark string `json:"remark"` PublicKey string `json:"publicKey"` NoDisturbing int `json:"noDisturbing"` CommonlyUsed int `json:"commonlyUsed"` OnTop int `json:"onTop"` IsDelete int `json:"isDelete"` AddTime int64 `json:"addTime"` DepositAddress string `json:"depositAddress"` Identification int `json:"identification"` IdentificationInfo string `json:"identificationInfo"` IsBlocked int `json:"isBlocked"` }
type FriendJoinUser ¶
type InfoParams ¶
type InfoParams struct {
PacketId string `json:"packet_id"`
}
type InviteRoomConf ¶
type LastLoginInfo ¶
type MemberJoinRoom ¶
type MemberJoinRoom struct { *Room *RoomMember }
type MemberJoinUser ¶
type MemberJoinUser struct { *RoomMember *User }
type NotConfirmAppId ¶
type NotConfirmAppId struct {
AppIds string `json:"appIds"`
}
type OssAddress ¶
type Praise ¶
type Praise struct { Id string ChannelType int TargetId string LogId string SenderId string OptId string Type int RecordId string CoinId string CoinName string Amount float64 CreateTime int64 IsDelete int }
--------------Parise------------------------//
type PraiseBoardHistory ¶
type PraiseRecord ¶
type PraiseRecord struct { RecordId string `json:"recordId"` LogId string `json:"logId"` ChannelType int `json:"channelType"` CreateTime int64 `json:"createTime"` User struct { Id string `json:"id"` Name string `json:"name"` Avatar string `json:"avatar"` } `json:"user"` Type int `json:"type"` CoinName string `json:"coinName"` Amount float64 `json:"amount"` }
praise record api
type PraiseUser ¶
type PrivateLog ¶
type PrivateLogJoinUser ¶
type PrivateLogJoinUser struct { *PrivateLog *User Remark string //用于解决,私聊历史记录 返回的好友信息 remark字段 }
type RPReceiveInfo ¶
type RPReceiveInfo struct { UserId string `json:"userId"` UserName string `json:"userName"` UserAvatar string `json:"userAvatar"` CoinId int `json:"coinId"` CoinName string `json:"coinName"` Amount float64 `json:"amount"` CreatedAt int64 `json:"createdAt"` Status int `json:"status"` FailMessage string `json:"failMessage"` }
-----api result---------//
type RPStatisticInfo ¶
type RPStatisticInfo struct { Count int `json:"count"` Sum float64 `json:"sum"` CoinId int `json:"coinId"` CoinName string `json:"coinName"` RedPackets []*RedPacketInfo `json:"redPackets"` }
type RankingItem ¶
赞赏榜单 redis使用
type RankingItemWrapper ¶
type RankingItemWrapper struct { Items []*RankingItem By func(p, q *RankingItem) bool }
排序
func (RankingItemWrapper) Len ¶
func (pw RankingItemWrapper) Len() int
func (RankingItemWrapper) Less ¶
func (pw RankingItemWrapper) Less(i, j int) bool
func (RankingItemWrapper) Swap ¶
func (pw RankingItemWrapper) Swap(i, j int)
type ReceiveDetailParams ¶
type ReceiveDetailParams struct {
PacketId string `json:"packet_id"`
}
type ReceiveParams ¶
type ReceiveParams struct {
PacketId string `json:"packet_id"`
}
type Record ¶
type Record struct { Ranking int `json:"ranking"` User struct { Id string `json:"id"` Name string `json:"name"` Avatar string `json:"avatar"` } `json:"user"` Number int `json:"number"` Price float64 `json:"price"` }
赞赏榜单
type RedPacketInfo ¶
type RedPacketInfo struct { SenderId string `json:"senderId"` SenderUid string `json:"senderUid"` SenderAvatar string `json:"senderAvatar"` SenderName string `json:"senderName"` Identification int `json:"identification"` IdentificationInfo string `json:"identificationInfo"` Type int `json:"type"` CoinId int `json:"coinId"` CoinName string `json:"coinName"` Amount float64 `json:"amount"` Size int `json:"size"` ToUsers string `json:"toUsers"` Remain int `json:"remain"` Status int `json:"status"` Remark string `json:"remark"` CreatedAt int64 `json:"createdAt"` PacketId string `json:"packetId"` PacketUrl string `json:"packetUrl"` RevInfo *RPReceiveInfo `json:"revInfo"` }
type RedPacketLog ¶
type Redis ¶
type Redis struct { Url string `json:"url"` Password string `json:"password"` MaxIdle int `json:"maxIdle"` MaxActive int `json:"maxActive"` IdleTimeout int `json:"idleTimeout"` }
redis的一些配置
type ReqBase ¶
type ReqBase struct { Method string `json:"method"` Params interface{} `json:"params"` }
type Room ¶
type Room struct { Id string `json:"id"` MarkId string `json:"markId"` Name string `json:"name"` Avatar string `json:"avatar"` MasterId string `json:"masterId"` CreateTime int64 `json:"-"` CanAddFriend int `json:"canAddFriend"` JoinPermission int `json:"joinPermission"` RecordPermision int `json:"recordPermission"` AdminMuted int `json:"-"` MasterMuted int `json:"-"` Encrypt int `json:"encrypt"` IsDelete int `json:"-"` RoomLevel int `json:"-"` CloseUntil int64 `json:"-"` Recommend int `json:"recommend"` Identification int `json:"identification"` IdentificationInfo string `json:"identificationInfo"` }
db room table
type RoomConfig ¶
type RoomJoinUser ¶
type RoomLogJoinUser ¶
type RoomMember ¶
type RoomMsgReceive ¶
type RoomUserMuted ¶
type SendParams ¶
type StatisticParams ¶
type User ¶
type User struct { UserId string MarkId string Uid string AppId string Username string Account string UserLevel int Verified int //是否实名制 Avatar string CompanyId string Position string Area string Phone string Sex int Email string InviteCode string DeviceToken string DepositAddress string PublicKey string PrivateKey string Device string CreateTime int64 RegVersion string NowVersion string CloseUntil int64 SuperUserLevel int Identification int IdentificationInfo string // IsSetPayPwd int //是否上链 IsChain int }
---------user----------//
type UserConfig ¶
type VerifyApply ¶
type VerifyApply struct { Id string AppId string Type int TargetId string Description string Amount float64 Currency string State int RecordId string UpdateTime int64 FeeState int }
--------认证申请-------------------//
type VerifyApplyJoinRoomAndUser ¶
type VerifyApplyJoinRoomAndUser struct { *VerifyApply *Room *User }
type VerifyApplyJoinUser ¶
type VerifyApplyJoinUser struct { *VerifyApply *User }
type VerifyFee ¶
type VerifyFee struct { AppId string `json:"-"` Type int `json:"type"` Currency string `json:"currency"` Amount float64 `json:"amount,string"` }
----------认证手续费表--------------//
type Version ¶
type Version struct { AppId string Name string Compatible bool `json:"compatible"` MinVersionCode int `json:"minVersionCode"` VersionCode int `json:"versionCode"` VersionName string `json:"versionName"` Description string `json:"description"` Url string `json:"url"` Size int64 `json:"size"` Md5 string `json:"md5"` ForceList string `json:"forceList"` }
--------------version----------------//
Click to show internal directories.
Click to hide internal directories.