mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-28 04:48:44 +08:00
Error code standardization
This commit is contained in:
parent
839af18f49
commit
39463e68e3
@ -1,14 +1,5 @@
|
||||
package api_struct
|
||||
|
||||
//UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"`
|
||||
// Nickname string `protobuf:"bytes,2,opt,name=Nickname" json:"Nickname,omitempty"`
|
||||
// FaceUrl string `protobuf:"bytes,3,opt,name=FaceUrl" json:"FaceUrl,omitempty"`
|
||||
// Gender int32 `protobuf:"varint,4,opt,name=Gender" json:"Gender,omitempty"`
|
||||
// PhoneNumber string `protobuf:"bytes,5,opt,name=PhoneNumber" json:"PhoneNumber,omitempty"`
|
||||
// Birth string `protobuf:"bytes,6,opt,name=Birth" json:"Birth,omitempty"`
|
||||
// Email string `protobuf:"bytes,7,opt,name=Email" json:"Email,omitempty"`
|
||||
// Ex string `protobuf:"bytes,8,opt,name=Ex" json:"Ex,omitempty"`
|
||||
|
||||
type UserRegisterReq struct {
|
||||
Secret string `json:"secret" binding:"required,max=32"`
|
||||
Platform int32 `json:"platform" binding:"required,min=1,max=12"`
|
@ -1,20 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
type AwsStorageCredentialReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
|
||||
type AwsStorageCredentialRespData struct {
|
||||
AccessKeyId string `json:"accessKeyID"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
SessionToken string `json:"sessionToken"`
|
||||
RegionID string `json:"regionId"`
|
||||
Bucket string `json:"bucket"`
|
||||
FinalHost string `json:"FinalHost"`
|
||||
}
|
||||
|
||||
type AwsStorageCredentialResp struct {
|
||||
CommResp
|
||||
CosData AwsStorageCredentialRespData
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
type OptResult struct {
|
||||
ConversationID string `json:"conversationID"`
|
||||
Result *int32 `json:"result"`
|
||||
}
|
||||
type GetAllConversationMessageOptReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetAllConversationMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
type GetReceiveMessageOptReq struct {
|
||||
ConversationIDList []string `json:"conversationIDList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetReceiveMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
type SetReceiveMessageOptReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
Opt *int32 `json:"opt" binding:"required"`
|
||||
ConversationIDList []string `json:"conversationIDList" binding:"required"`
|
||||
}
|
||||
type SetReceiveMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
|
||||
type Conversation struct {
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
ConversationID string `json:"conversationID" binding:"required"`
|
||||
ConversationType int32 `json:"conversationType" binding:"required"`
|
||||
UserID string `json:"userID"`
|
||||
GroupID string `json:"groupID"`
|
||||
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||
UnreadCount int32 `json:"unreadCount" binding:"omitempty"`
|
||||
DraftTextTime int64 `json:"draftTextTime"`
|
||||
IsPinned bool `json:"isPinned" binding:"omitempty"`
|
||||
IsPrivateChat bool `json:"isPrivateChat"`
|
||||
BurnDuration int32 `json:"burnDuration"`
|
||||
GroupAtType int32 `json:"groupAtType"`
|
||||
IsNotInGroup bool `json:"isNotInGroup"`
|
||||
UpdateUnreadCountTime int64 `json:"updateUnreadCountTime"`
|
||||
AttachedInfo string `json:"attachedInfo"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type SetConversationReq struct {
|
||||
Conversation
|
||||
NotificationType int32 `json:"notificationType"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type SetConversationResp struct {
|
||||
CommResp
|
||||
}
|
||||
type ModifyConversationFieldReq struct {
|
||||
Conversation
|
||||
FieldType int32 `json:"fieldType" binding:"required"`
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type ModifyConversationFieldResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type BatchSetConversationsReq struct {
|
||||
Conversations []Conversation `json:"conversations" binding:"required"`
|
||||
NotificationType int32 `json:"notificationType"`
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type BatchSetConversationsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
Success []string `json:"success"`
|
||||
Failed []string `json:"failed"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type GetConversationReq struct {
|
||||
ConversationID string `json:"conversationID" binding:"required"`
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetConversationResp struct {
|
||||
CommResp
|
||||
Conversation Conversation `json:"data"`
|
||||
}
|
||||
|
||||
type GetAllConversationsReq struct {
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetAllConversationsResp struct {
|
||||
CommResp
|
||||
Conversations []Conversation `json:"data"`
|
||||
}
|
||||
|
||||
type GetConversationsReq struct {
|
||||
ConversationIDs []string `json:"conversationIDs" binding:"required"`
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetConversationsResp struct {
|
||||
CommResp
|
||||
Conversations []Conversation `json:"data"`
|
||||
}
|
||||
|
||||
type SetRecvMsgOptReq struct {
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
ConversationID string `json:"conversationID"`
|
||||
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
NotificationType int32 `json:"notificationType"`
|
||||
}
|
||||
|
||||
type SetRecvMsgOptResp struct {
|
||||
CommResp
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import sts "github.com/tencentyun/qcloud-cos-sts-sdk/go"
|
||||
|
||||
type TencentCloudStorageCredentialReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
|
||||
type TencentCloudStorageCredentialRespData struct {
|
||||
*sts.CredentialResult
|
||||
Region string `json:"region"`
|
||||
Bucket string `json:"bucket"`
|
||||
}
|
||||
|
||||
type TencentCloudStorageCredentialResp struct {
|
||||
CommResp
|
||||
CosData TencentCloudStorageCredentialRespData `json:"-"`
|
||||
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
@ -1,273 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
//type ParamsCommFriend struct {
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// ToUserID string `json:"toUserID" binding:"required"`
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//
|
||||
//type AddBlacklistReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type AddBlacklistResp struct {
|
||||
// CommResp
|
||||
//}
|
||||
//
|
||||
//type ImportFriendReq struct {
|
||||
// FriendUserIDList []string `json:"friendUserIDList" binding:"required"`
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type UserIDResult struct {
|
||||
// UserID string `json:"userID"`
|
||||
// Result int32 `json:"result"`
|
||||
//}
|
||||
//type ImportFriendResp struct {
|
||||
// CommResp
|
||||
// UserIDResultList []UserIDResult `json:"data"`
|
||||
//}
|
||||
//
|
||||
//type AddFriendReq struct {
|
||||
// ParamsCommFriend
|
||||
// ReqMsg string `json:"reqMsg"`
|
||||
//}
|
||||
//type AddFriendResp struct {
|
||||
// CommResp
|
||||
//}
|
||||
//
|
||||
//type AddFriendResponseReq struct {
|
||||
// ParamsCommFriend
|
||||
// Flag int32 `json:"flag" binding:"required,oneof=-1 0 1"`
|
||||
// HandleMsg string `json:"handleMsg"`
|
||||
//}
|
||||
//type AddFriendResponseResp struct {
|
||||
// CommResp
|
||||
//}
|
||||
//
|
||||
//type DeleteFriendReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type DeleteFriendResp struct {
|
||||
// CommResp
|
||||
//}
|
||||
//
|
||||
//type GetBlackListReq struct {
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetBlackListResp struct {
|
||||
// CommResp
|
||||
// BlackUserInfoList []*open_im_sdk.PublicUserInfo `json:"-"`
|
||||
// Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
//
|
||||
////type PublicUserInfo struct {
|
||||
//// UserID string `json:"userID"`
|
||||
//// Nickname string `json:"nickname"`
|
||||
//// FaceUrl string `json:"faceUrl"`
|
||||
//// Gender int32 `json:"gender"`
|
||||
////}
|
||||
//
|
||||
//type SetFriendRemarkReq struct {
|
||||
// ParamsCommFriend
|
||||
// Remark string `json:"remark"`
|
||||
//}
|
||||
//type SetFriendRemarkResp struct {
|
||||
// CommResp
|
||||
//}
|
||||
//
|
||||
//type RemoveBlacklistReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type RemoveBlacklistResp struct {
|
||||
// CommResp
|
||||
//}
|
||||
//
|
||||
//type IsFriendReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type Response struct {
|
||||
// Friend bool `json:"isFriend"`
|
||||
//}
|
||||
//type IsFriendResp struct {
|
||||
// CommResp
|
||||
// Response Response `json:"data"`
|
||||
//}
|
||||
//
|
||||
//type GetFriendsInfoReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type GetFriendsInfoResp struct {
|
||||
// CommResp
|
||||
// FriendInfoList []*open_im_sdk.FriendInfo `json:"-"`
|
||||
// Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
//
|
||||
//type GetFriendListReq struct {
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetFriendListResp struct {
|
||||
// CommResp
|
||||
// FriendInfoList []*open_im_sdk.FriendInfo `json:"-"`
|
||||
// Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
//
|
||||
//type GetFriendApplyListReq struct {
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetFriendApplyListResp struct {
|
||||
// CommResp
|
||||
// FriendRequestList []*open_im_sdk.FriendRequest `json:"-"`
|
||||
// Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
//
|
||||
//type GetSelfApplyListReq struct {
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetSelfApplyListResp struct {
|
||||
// CommResp
|
||||
// FriendRequestList []*open_im_sdk.FriendRequest `json:"-"`
|
||||
// Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
|
||||
type FriendInfo struct {
|
||||
UserID string `json:"userID"`
|
||||
Nickname string `json:"nickname"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Gender int32 `json:"gender"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type PublicUserInfo struct {
|
||||
UserID string `json:"userID"`
|
||||
Nickname string `json:"nickname"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Gender int32 `json:"gender"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type FriendRequest struct {
|
||||
FromUserID string `json:"fromUserID"`
|
||||
FromNickname string `json:"fromNickname"`
|
||||
FromFaceURL string `json:"fromFaceURL"`
|
||||
FromGender int32 `json:"fromGender"`
|
||||
ToUserID string `json:"toUserID"`
|
||||
ToNickname string `json:"toNickname"`
|
||||
ToFaceURL string `json:"toFaceURL"`
|
||||
ToGender int32 `json:"toGender"`
|
||||
HandleResult int32 `json:"handleResult"`
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
CreateTime uint32 `json:"createTime"`
|
||||
HandlerUserID string `json:"handlerUserID"`
|
||||
HandleMsg string `json:"handleMsg"`
|
||||
HandleTime uint32 `json:"handleTime"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type AddBlacklistReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type AddBlacklistResp struct {
|
||||
}
|
||||
|
||||
type ImportFriendReq struct {
|
||||
FriendUserIDList []string `json:"friendUserIDList" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
|
||||
type ImportFriendResp struct {
|
||||
//CommResp
|
||||
}
|
||||
|
||||
type AddFriendReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
}
|
||||
type AddFriendResp struct {
|
||||
//CommResp
|
||||
}
|
||||
|
||||
type AddFriendResponseReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
HandleResult int32 `json:"flag" binding:"required,oneof=-1 0 1"`
|
||||
HandleMsg string `json:"handleMsg"`
|
||||
}
|
||||
type AddFriendResponseResp struct {
|
||||
}
|
||||
|
||||
type DeleteFriendReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type DeleteFriendResp struct {
|
||||
}
|
||||
|
||||
type GetBlackListReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetBlackListResp struct {
|
||||
BlackUserInfoList []PublicUserInfo `json:"blackUserInfoList"`
|
||||
}
|
||||
|
||||
type SetFriendRemarkReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
type SetFriendRemarkResp struct {
|
||||
}
|
||||
|
||||
type RemoveBlacklistReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type RemoveBlacklistResp struct {
|
||||
}
|
||||
|
||||
type IsFriendReq struct {
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type Response struct {
|
||||
Friend bool `json:"isFriend"`
|
||||
}
|
||||
type IsFriendResp struct {
|
||||
Response Response `json:"data"`
|
||||
}
|
||||
|
||||
type GetFriendListReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetFriendListResp struct {
|
||||
OwnerUserID string `json:"ownerUserID"`
|
||||
Remark string `json:"remark"`
|
||||
CreateTime uint32 `json:"createTime"`
|
||||
AddSource int32 `json:"addSource"`
|
||||
OperatorUserID string `json:"operatorUserID"`
|
||||
Ex string `json:"ex"`
|
||||
//FriendUser *UserInfo // TODO
|
||||
}
|
||||
|
||||
type GetFriendApplyListReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetFriendApplyListResp struct {
|
||||
FriendRequestList []FriendRequest `json:"friendRequestList"`
|
||||
}
|
||||
|
||||
type GetSelfApplyListReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetSelfApplyListResp struct {
|
||||
FriendRequestList []FriendRequest `json:"friendRequestList"`
|
||||
}
|
@ -1,301 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import (
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
type CommResp struct {
|
||||
ErrCode int32 `json:"errCode"`
|
||||
ErrMsg string `json:"errMsg"`
|
||||
}
|
||||
|
||||
type CommDataResp struct {
|
||||
CommResp
|
||||
Data []map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
||||
type KickGroupMemberReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
KickedUserIDList []string `json:"kickedUserIDList" binding:"required"`
|
||||
Reason string `json:"reason"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type KickGroupMemberResp struct {
|
||||
CommResp
|
||||
UserIDResultList []*UserIDResult `json:"data"`
|
||||
}
|
||||
|
||||
type GetGroupMembersInfoReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
MemberList []string `json:"memberList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetGroupMembersInfoResp struct {
|
||||
CommResp
|
||||
MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type InviteUserToGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
InvitedUserIDList []string `json:"invitedUserIDList" binding:"required"`
|
||||
Reason string `json:"reason"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type InviteUserToGroupResp struct {
|
||||
CommResp
|
||||
UserIDResultList []*UserIDResult `json:"data"`
|
||||
}
|
||||
|
||||
type GetJoinedGroupListReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetJoinedGroupListResp struct {
|
||||
CommResp
|
||||
GroupInfoList []*open_im_sdk.GroupInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type GetGroupMemberListReq struct {
|
||||
GroupID string `json:"groupID"`
|
||||
Filter int32 `json:"filter"`
|
||||
NextSeq int32 `json:"nextSeq"`
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
type GetGroupMemberListResp struct {
|
||||
CommResp
|
||||
NextSeq int32 `json:"nextSeq"`
|
||||
MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type GetGroupAllMemberReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
Offset int32 `json:"offset"`
|
||||
Count int32 `json:"count"`
|
||||
}
|
||||
type GetGroupAllMemberResp struct {
|
||||
CommResp
|
||||
MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
//
|
||||
//type GetGroupAllMemberListBySplitReq struct {
|
||||
// GroupID string `json:"groupID" binding:"required"`
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// Offset int32 `json:"offset" binding:"required"`
|
||||
// Count int32 `json:"count" binding:"required"`
|
||||
//}
|
||||
//type GetGroupAllMemberListBySplitResp struct {
|
||||
// CommResp
|
||||
// MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
|
||||
// Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
|
||||
type CreateGroupReq struct {
|
||||
MemberList []*GroupAddMemberInfo `json:"memberList"`
|
||||
OwnerUserID string `json:"ownerUserID"`
|
||||
GroupType int32 `json:"groupType"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex string `json:"ex"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID"`
|
||||
}
|
||||
type CreateGroupResp struct {
|
||||
CommResp
|
||||
GroupInfo open_im_sdk.GroupInfo `json:"-"`
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type GetGroupApplicationListReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //作为管理员或群主收到的 进群申请
|
||||
}
|
||||
type GetGroupApplicationListResp struct {
|
||||
CommResp
|
||||
GroupRequestList []*open_im_sdk.GroupRequest `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type GetUserReqGroupApplicationListReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetUserRespGroupApplicationResp struct {
|
||||
GroupRequestList []*open_im_sdk.GroupRequest `json:"data"`
|
||||
}
|
||||
|
||||
type GetGroupInfoReq struct {
|
||||
GroupIDList []string `json:"groupIDList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetGroupInfoResp struct {
|
||||
CommResp
|
||||
GroupInfoList []*open_im_sdk.GroupInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
//type GroupInfoAlias struct {
|
||||
// open_im_sdk.GroupInfo
|
||||
// NeedVerification int32 `protobuf:"bytes,13,opt,name=needVerification" json:"needVerification,omitempty"`
|
||||
//}
|
||||
|
||||
//type GroupInfoAlias struct {
|
||||
// GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"`
|
||||
// GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
|
||||
// Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"`
|
||||
// Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"`
|
||||
// FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"`
|
||||
// OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
|
||||
// CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"`
|
||||
// MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"`
|
||||
// Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"`
|
||||
// Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"`
|
||||
// CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"`
|
||||
// GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"`
|
||||
// NeedVerification int32 `protobuf:"bytes,13,opt,name=needVerification" json:"needVerification,omitempty"`
|
||||
//}
|
||||
|
||||
type ApplicationGroupResponseReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID
|
||||
HandledMsg string `json:"handledMsg"`
|
||||
HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"`
|
||||
}
|
||||
type ApplicationGroupResponseResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type JoinGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
ReqMessage string `json:"reqMessage"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
JoinSource int32 `json:"joinSource"`
|
||||
InviterUserID string `json:"inviterUserID"`
|
||||
}
|
||||
|
||||
type JoinGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type QuitGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type QuitGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetGroupInfoReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex string `json:"ex"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
NeedVerification *int32 `json:"needVerification"`
|
||||
LookMemberInfo *int32 `json:"lookMemberInfo"`
|
||||
ApplyMemberFriend *int32 `json:"applyMemberFriend"`
|
||||
}
|
||||
|
||||
type SetGroupInfoResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type TransferGroupOwnerReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
OldOwnerUserID string `json:"oldOwnerUserID" binding:"required"`
|
||||
NewOwnerUserID string `json:"newOwnerUserID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type TransferGroupOwnerResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DismissGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type DismissGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MuteGroupMemberReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
MutedSeconds uint32 `json:"mutedSeconds" binding:"required"`
|
||||
}
|
||||
type MuteGroupMemberResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CancelMuteGroupMemberReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
}
|
||||
type CancelMuteGroupMemberResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MuteGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
}
|
||||
type MuteGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CancelMuteGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
}
|
||||
type CancelMuteGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetGroupMemberNicknameReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
Nickname string `json:"nickname"`
|
||||
}
|
||||
|
||||
type SetGroupMemberNicknameResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetGroupMemberInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
Nickname *string `json:"nickname"`
|
||||
FaceURL *string `json:"userGroupFaceUrl"`
|
||||
RoleLevel *int32 `json:"roleLevel" validate:"gte=1,lte=3"`
|
||||
Ex *string `json:"ex"`
|
||||
}
|
||||
|
||||
type SetGroupMemberInfoResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetGroupAbstractInfoReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
GroupID string `json:"groupID"`
|
||||
}
|
||||
|
||||
type GetGroupAbstractInfoResp struct {
|
||||
CommResp
|
||||
GroupMemberNumber int32 `json:"groupMemberNumber"`
|
||||
GroupMemberListHash uint64 `json:"groupMemberListHash"`
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import (
|
||||
pbRelay "Open_IM/pkg/proto/relay"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
)
|
||||
|
||||
type DeleteUsersReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
DeleteUserIDList []string `json:"deleteUserIDList" binding:"required"`
|
||||
}
|
||||
type DeleteUsersResp struct {
|
||||
CommResp
|
||||
FailedUserIDList []string `json:"data"`
|
||||
}
|
||||
type GetAllUsersUidReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetAllUsersUidResp struct {
|
||||
CommResp
|
||||
UserIDList []string `json:"data"`
|
||||
}
|
||||
type GetUsersOnlineStatusReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserIDList []string `json:"userIDList" binding:"required,lte=200"`
|
||||
}
|
||||
type GetUsersOnlineStatusResp struct {
|
||||
CommResp
|
||||
SuccessResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult `json:"data"`
|
||||
}
|
||||
type AccountCheckReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"`
|
||||
}
|
||||
type AccountCheckResp struct {
|
||||
CommResp
|
||||
ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"`
|
||||
}
|
||||
|
||||
type ManagementSendMsg struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
BusinessOperationID string `json:"businessOperationID"`
|
||||
SendID string `json:"sendID" binding:"required"`
|
||||
GroupID string `json:"groupID" `
|
||||
SenderNickname string `json:"senderNickname" `
|
||||
SenderFaceURL string `json:"senderFaceURL" `
|
||||
SenderPlatformID int32 `json:"senderPlatformID"`
|
||||
//ForceList []string `json:"forceList" `
|
||||
Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"`
|
||||
ContentType int32 `json:"contentType" binding:"required"`
|
||||
SessionType int32 `json:"sessionType" binding:"required"`
|
||||
IsOnlineOnly bool `json:"isOnlineOnly"`
|
||||
NotOfflinePush bool `json:"notOfflinePush"`
|
||||
OfflinePushInfo *server_api_params.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
}
|
||||
|
||||
type ManagementSendMsgReq struct {
|
||||
ManagementSendMsg
|
||||
RecvID string `json:"recvID" `
|
||||
}
|
||||
|
||||
type ManagementSendMsgResp struct {
|
||||
CommResp
|
||||
ResultList server_api_params.UserSendMsgResp `json:"data"`
|
||||
}
|
||||
|
||||
type ManagementBatchSendMsgReq struct {
|
||||
ManagementSendMsg
|
||||
IsSendAll bool `json:"isSendAll"`
|
||||
RecvIDList []string `json:"recvIDList"`
|
||||
}
|
||||
|
||||
type ManagementBatchSendMsgResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
ResultList []*SingleReturnResult `json:"resultList"`
|
||||
FailedIDList []string
|
||||
} `json:"data"`
|
||||
}
|
||||
type SingleReturnResult struct {
|
||||
ServerMsgID string `json:"serverMsgID"`
|
||||
ClientMsgID string `json:"clientMsgID"`
|
||||
SendTime int64 `json:"sendTime"`
|
||||
RecvID string `json:"recvID" `
|
||||
}
|
||||
|
||||
type CheckMsgIsSendSuccessReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
|
||||
type CheckMsgIsSendSuccessResp struct {
|
||||
CommResp
|
||||
Status int32 `json:"status"`
|
||||
}
|
||||
|
||||
type GetUsersReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserName string `json:"userName"`
|
||||
UserID string `json:"userID"`
|
||||
Content string `json:"content"`
|
||||
PageNumber int32 `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int32 `json:"showNumber" binding:"required"`
|
||||
}
|
||||
|
||||
type CMSUser struct {
|
||||
UserID string `json:"userID"`
|
||||
Nickname string `json:"nickname"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Gender int32 `json:"gender"`
|
||||
PhoneNumber string `json:"phoneNumber"`
|
||||
Birth uint32 `json:"birth"`
|
||||
Email string `json:"email"`
|
||||
Ex string `json:"ex"`
|
||||
CreateIp string `json:"createIp"`
|
||||
CreateTime uint32 `json:"createTime"`
|
||||
LastLoginIp string `json:"LastLoginIp"`
|
||||
LastLoginTime uint32 `json:"LastLoginTime"`
|
||||
AppMangerLevel int32 `json:"appMangerLevel"`
|
||||
GlobalRecvMsgOpt int32 `json:"globalRecvMsgOpt"`
|
||||
IsBlock bool `json:"isBlock"`
|
||||
}
|
||||
|
||||
type GetUsersResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
UserList []*CMSUser `json:"userList"`
|
||||
TotalNum int32 `json:"totalNum"`
|
||||
CurrentPage int32 `json:"currentPage"`
|
||||
ShowNumber int32 `json:"showNumber"`
|
||||
} `json:"data"`
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import (
|
||||
pbOffice "Open_IM/pkg/proto/office"
|
||||
)
|
||||
|
||||
type GetUserTagsReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetUserTagsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
Tags []*pbOffice.Tag `json:"tags"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type CreateTagReq struct {
|
||||
TagName string `json:"tagName" binding:"required"` // tag名称
|
||||
UserIDList []string `json:"userIDList" binding:"required"` // 用户ID列表
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type CreateTagResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DeleteTagReq struct {
|
||||
TagID string `json:"tagID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type DeleteTagResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetTagReq struct {
|
||||
TagID string `json:"tagID" binding:"required"`
|
||||
NewName string `json:"newName"`
|
||||
IncreaseUserIDList []string `json:"increaseUserIDList"`
|
||||
ReduceUserIDList []string `json:"reduceUserIDList"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type SetTagResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SendMsg2TagReq struct {
|
||||
TagList []string `json:"tagList"`
|
||||
UserList []string `json:"userList"`
|
||||
GroupList []string `json:"groupList"`
|
||||
|
||||
SenderPlatformID int32 `json:"senderPlatformID" binding:"required"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type SendMsg2TagResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetTagSendLogsReq struct {
|
||||
PageNumber int32 `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int32 `json:"showNumber" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetTagSendLogsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
Logs []*pbOffice.TagSendLog `json:"logs"`
|
||||
CurrentPage int32 `json:"currentPage"`
|
||||
ShowNumber int32 `json:"showNumber"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type GetUserTagByIDReq struct {
|
||||
TagID string `json:"tagID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetUserTagByIDResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
Tag *pbOffice.Tag `json:"tag"`
|
||||
} `json:"data"`
|
||||
}
|
@ -1,121 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
|
||||
type CreateDepartmentReq struct {
|
||||
*open_im_sdk.Department
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type CreateDepartmentResp struct {
|
||||
CommResp
|
||||
Department *open_im_sdk.Department `json:"-"`
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type UpdateDepartmentReq struct {
|
||||
*open_im_sdk.Department
|
||||
DepartmentID string `json:"departmentID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type UpdateDepartmentResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetSubDepartmentReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
DepartmentID string `json:"departmentID" binding:"required"`
|
||||
}
|
||||
type GetSubDepartmentResp struct {
|
||||
CommResp
|
||||
DepartmentList []*open_im_sdk.Department `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type DeleteDepartmentReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
DepartmentID string `json:"departmentID" binding:"required"`
|
||||
}
|
||||
type DeleteDepartmentResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CreateOrganizationUserReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
*open_im_sdk.OrganizationUser
|
||||
}
|
||||
type CreateOrganizationUserResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type UpdateOrganizationUserReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
*open_im_sdk.OrganizationUser
|
||||
}
|
||||
type UpdateOrganizationUserResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CreateDepartmentMemberReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
*open_im_sdk.DepartmentMember
|
||||
}
|
||||
|
||||
type CreateDepartmentMemberResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetUserInDepartmentReq struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetUserInDepartmentResp struct {
|
||||
CommResp
|
||||
UserInDepartment *open_im_sdk.UserInDepartment `json:"-"`
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type UpdateUserInDepartmentReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
*open_im_sdk.DepartmentMember
|
||||
}
|
||||
type UpdateUserInDepartmentResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DeleteOrganizationUserReq struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type DeleteOrganizationUserResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetDepartmentMemberReq struct {
|
||||
DepartmentID string `json:"departmentID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetDepartmentMemberResp struct {
|
||||
CommResp
|
||||
UserInDepartmentList []*open_im_sdk.UserDepartmentMember `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type DeleteUserInDepartmentReq struct {
|
||||
DepartmentID string `json:"departmentID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type DeleteUserInDepartmentResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetUserInOrganizationReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
}
|
||||
|
||||
type GetUserInOrganizationResp struct {
|
||||
CommResp
|
||||
OrganizationUserList []*open_im_sdk.OrganizationUser `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
type OSSCredentialReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
Filename string `json:"filename"`
|
||||
FileType string `json:"file_type"`
|
||||
}
|
||||
|
||||
type OSSCredentialRespData struct {
|
||||
Endpoint string `json:"endpoint"`
|
||||
AccessKeyId string `json:"access_key_id"`
|
||||
AccessKeySecret string `json:"access_key_secret"`
|
||||
Token string `json:"token"`
|
||||
Bucket string `json:"bucket"`
|
||||
FinalHost string `json:"final_host"`
|
||||
}
|
||||
|
||||
type OSSCredentialResp struct {
|
||||
CommResp
|
||||
OssData OSSCredentialRespData `json:"-"`
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
@ -1,143 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ApiUserInfo struct {
|
||||
UserID string `json:"userID" binding:"required,min=1,max=64" swaggo:"true,用户ID,"`
|
||||
Nickname string `json:"nickname" binding:"omitempty,min=1,max=64" swaggo:"true,my id,19"`
|
||||
FaceURL string `json:"faceURL" binding:"omitempty,max=1024"`
|
||||
Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"`
|
||||
PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"`
|
||||
Birth uint32 `json:"birth" binding:"omitempty"`
|
||||
Email string `json:"email" binding:"omitempty,max=64"`
|
||||
CreateTime int64 `json:"createTime"`
|
||||
LoginLimit int32 `json:"loginLimit" binding:"omitempty"`
|
||||
Ex string `json:"ex" binding:"omitempty,max=1024"`
|
||||
BirthStr string `json:"birthStr" binding:"omitempty"`
|
||||
}
|
||||
|
||||
//type Conversation struct {
|
||||
// OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"`
|
||||
// ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"`
|
||||
// ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"`
|
||||
// UserID string `gorm:"column:user_id;type:char(64)" json:"userID"`
|
||||
// GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"`
|
||||
// RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"`
|
||||
// UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"`
|
||||
// DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"`
|
||||
// IsPinned bool `gorm:"column:is_pinned" json:"isPinned"`
|
||||
// AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"`
|
||||
// Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
|
||||
//}
|
||||
|
||||
type GroupAddMemberInfo struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
RoleLevel int32 `json:"roleLevel" binding:"required,oneof= 1 3"`
|
||||
}
|
||||
|
||||
func SetErrCodeMsg(c *gin.Context, status int) *CommResp {
|
||||
resp := CommResp{ErrCode: int32(status), ErrMsg: http.StatusText(status)}
|
||||
c.JSON(status, resp)
|
||||
return &resp
|
||||
}
|
||||
|
||||
//GroupName string `json:"groupName"`
|
||||
// Introduction string `json:"introduction"`
|
||||
// Notification string `json:"notification"`
|
||||
// FaceUrl string `json:"faceUrl"`
|
||||
// OperationID string `json:"operationID" binding:"required"`
|
||||
// GroupType int32 `json:"groupType"`
|
||||
// Ex string `json:"ex"`
|
||||
|
||||
//type GroupInfo struct {
|
||||
// GroupID string `json:"groupID"`
|
||||
// GroupName string `json:"groupName"`
|
||||
// Notification string `json:"notification"`
|
||||
// Introduction string `json:"introduction"`
|
||||
// FaceUrl string `json:"faceUrl"`
|
||||
// OwnerUserID string `json:"ownerUserID"`
|
||||
// Ex string `json:"ex"`
|
||||
// GroupType int32 `json:"groupType"`
|
||||
//}
|
||||
|
||||
//type GroupMemberFullInfo struct {
|
||||
// GroupID string `json:"groupID"`
|
||||
// UserID string `json:"userID"`
|
||||
// RoleLevel int32 `json:"roleLevel"`
|
||||
// JoinTime uint64 `json:"joinTime"`
|
||||
// Nickname string `json:"nickname"`
|
||||
// FaceUrl string `json:"faceUrl"`
|
||||
// FriendRemark string `json:"friendRemark"`
|
||||
// AppMangerLevel int32 `json:"appMangerLevel"`
|
||||
// JoinSource int32 `json:"joinSource"`
|
||||
// OperatorUserID string `json:"operatorUserID"`
|
||||
// Ex string `json:"ex"`
|
||||
//}
|
||||
//
|
||||
//type PublicUserInfo struct {
|
||||
// UserID string `json:"userID"`
|
||||
// Nickname string `json:"nickname"`
|
||||
// FaceUrl string `json:"faceUrl"`
|
||||
// Gender int32 `json:"gender"`
|
||||
//}
|
||||
//
|
||||
//type UserInfo struct {
|
||||
// UserID string `json:"userID"`
|
||||
// Nickname string `json:"nickname"`
|
||||
// FaceUrl string `json:"faceUrl"`
|
||||
// Gender int32 `json:"gender"`
|
||||
// Mobile string `json:"mobile"`
|
||||
// Birth string `json:"birth"`
|
||||
// Email string `json:"email"`
|
||||
// Ex string `json:"ex"`
|
||||
//}
|
||||
//
|
||||
//type FriendInfo struct {
|
||||
// OwnerUserID string `json:"ownerUserID"`
|
||||
// Remark string `json:"remark"`
|
||||
// CreateTime int64 `json:"createTime"`
|
||||
// FriendUser UserInfo `json:"friendUser"`
|
||||
// AddSource int32 `json:"addSource"`
|
||||
// OperatorUserID string `json:"operatorUserID"`
|
||||
// Ex string `json:"ex"`
|
||||
//}
|
||||
//
|
||||
//type BlackInfo struct {
|
||||
// OwnerUserID string `json:"ownerUserID"`
|
||||
// CreateTime int64 `json:"createTime"`
|
||||
// BlackUser PublicUserInfo `json:"friendUser"`
|
||||
// AddSource int32 `json:"addSource"`
|
||||
// OperatorUserID string `json:"operatorUserID"`
|
||||
// Ex string `json:"ex"`
|
||||
//}
|
||||
//
|
||||
//type GroupRequest struct {
|
||||
// UserID string `json:"userID"`
|
||||
// GroupID string `json:"groupID"`
|
||||
// HandleResult string `json:"handleResult"`
|
||||
// ReqMsg string `json:"reqMsg"`
|
||||
// HandleMsg string `json:"handleMsg"`
|
||||
// ReqTime int64 `json:"reqTime"`
|
||||
// HandleUserID string `json:"handleUserID"`
|
||||
// HandleTime int64 `json:"handleTime"`
|
||||
// Ex string `json:"ex"`
|
||||
//}
|
||||
//
|
||||
//type FriendRequest struct {
|
||||
// FromUserID string `json:"fromUserID"`
|
||||
// ToUserID string `json:"toUserID"`
|
||||
// HandleResult int32 `json:"handleResult"`
|
||||
// ReqMessage string `json:"reqMessage"`
|
||||
// CreateTime int64 `json:"createTime"`
|
||||
// HandlerUserID string `json:"handlerUserID"`
|
||||
// HandleMsg string `json:"handleMsg"`
|
||||
// HandleTime int64 `json:"handleTime"`
|
||||
// Ex string `json:"ex"`
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
@ -1,123 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import "mime/multipart"
|
||||
|
||||
type MinioStorageCredentialReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
|
||||
type MiniostorageCredentialResp struct {
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
AccessKeyID string `json:"accessKeyID"`
|
||||
SessionToken string `json:"sessionToken"`
|
||||
BucketName string `json:"bucketName"`
|
||||
StsEndpointURL string `json:"stsEndpointURL"`
|
||||
StorageTime int `json:"storageTime"`
|
||||
IsDistributedMod bool `json:"isDistributedMod"`
|
||||
}
|
||||
|
||||
type MinioUploadFileReq struct {
|
||||
OperationID string `form:"operationID" binding:"required"`
|
||||
FileType int `form:"fileType" binding:"required"`
|
||||
}
|
||||
|
||||
type MinioUploadFile struct {
|
||||
URL string `json:"URL"`
|
||||
NewName string `json:"newName"`
|
||||
SnapshotURL string `json:"snapshotURL,omitempty"`
|
||||
SnapshotNewName string `json:"snapshotName,omitempty"`
|
||||
}
|
||||
|
||||
type MinioUploadFileResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
MinioUploadFile
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type UploadUpdateAppReq struct {
|
||||
OperationID string `form:"operationID" binding:"required"`
|
||||
Type int `form:"type" binding:"required"`
|
||||
Version string `form:"version" binding:"required"`
|
||||
File *multipart.FileHeader `form:"file" binding:"required"`
|
||||
Yaml *multipart.FileHeader `form:"yaml"`
|
||||
ForceUpdate bool `form:"forceUpdate"`
|
||||
UpdateLog string `form:"updateLog" binding:"required"`
|
||||
}
|
||||
|
||||
type UploadUpdateAppResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetDownloadURLReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
Type int `json:"type" binding:"required"`
|
||||
Version string `json:"version" binding:"required"`
|
||||
}
|
||||
|
||||
type GetDownloadURLResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
HasNewVersion bool `json:"hasNewVersion"`
|
||||
ForceUpdate bool `json:"forceUpdate"`
|
||||
FileURL string `json:"fileURL"`
|
||||
YamlURL string `json:"yamlURL"`
|
||||
Version string `json:"version"`
|
||||
UpdateLog string `json:"update_log"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type GetRTCInvitationInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
ClientMsgID string `json:"clientMsgID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetRTCInvitationInfoResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
OpUserID string `json:"opUserID"`
|
||||
Invitation struct {
|
||||
InviterUserID string `json:"inviterUserID"`
|
||||
InviteeUserIDList []string `json:"inviteeUserIDList"`
|
||||
GroupID string `json:"groupID"`
|
||||
RoomID string `json:"roomID"`
|
||||
Timeout int32 `json:"timeout"`
|
||||
MediaType string `json:"mediaType"`
|
||||
SessionType int32 `json:"sessionType"`
|
||||
InitiateTime int32 `json:"initiateTime"`
|
||||
PlatformID int32 `json:"platformID"`
|
||||
CustomData string `json:"customData"`
|
||||
} `json:"invitation"`
|
||||
OfflinePushInfo struct{} `json:"offlinePushInfo"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type GetRTCInvitationInfoStartAppReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetRTCInvitationInfoStartAppResp struct {
|
||||
GetRTCInvitationInfoResp
|
||||
}
|
||||
|
||||
/**
|
||||
* FCM第三方上报Token
|
||||
*/
|
||||
type FcmUpdateTokenReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
Platform int `json:"platform" binding:"required,min=1,max=2"` //only for ios + android
|
||||
FcmToken string `json:"fcmToken" binding:"required"`
|
||||
}
|
||||
|
||||
type FcmUpdateTokenResp struct {
|
||||
CommResp
|
||||
}
|
||||
type SetAppBadgeReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
AppUnreadCount int32 `json:"appUnreadCount"`
|
||||
}
|
||||
|
||||
type SetAppBadgeResp struct {
|
||||
CommResp
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import (
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
type GetUsersInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
}
|
||||
type GetUsersInfoResp struct {
|
||||
CommResp
|
||||
UserInfoList []*open_im_sdk.PublicUserInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type UpdateSelfUserInfoReq struct {
|
||||
ApiUserInfo
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type SetGlobalRecvMessageOptReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GlobalRecvMsgOpt *int32 `json:"globalRecvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||
}
|
||||
type SetGlobalRecvMessageOptResp struct {
|
||||
CommResp
|
||||
}
|
||||
type UpdateUserInfoResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetSelfUserInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
}
|
||||
type GetSelfUserInfoResp struct {
|
||||
CommResp
|
||||
UserInfo *open_im_sdk.UserInfo `json:"-"`
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
type GetFriendIDListFromCacheReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetFriendIDListFromCacheResp struct {
|
||||
CommResp
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
}
|
||||
|
||||
type GetBlackIDListFromCacheReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetBlackIDListFromCacheResp struct {
|
||||
CommResp
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
package api_struct
|
||||
|
||||
import "Open_IM/pkg/proto/office"
|
||||
|
||||
type CreateOneWorkMomentReq struct {
|
||||
office.CreateOneWorkMomentReq
|
||||
}
|
||||
|
||||
type CreateOneWorkMomentResp struct {
|
||||
CommResp
|
||||
Data struct{} `json:"data"`
|
||||
}
|
||||
|
||||
type DeleteOneWorkMomentReq struct {
|
||||
WorkMomentID string `json:"workMomentID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type DeleteOneWorkMomentResp struct {
|
||||
CommResp
|
||||
Data struct{} `json:"data"`
|
||||
}
|
||||
|
||||
type LikeOneWorkMomentReq struct {
|
||||
WorkMomentID string `json:"workMomentID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type LikeOneWorkMomentResp struct {
|
||||
CommResp
|
||||
Data struct{} `json:"data"`
|
||||
}
|
||||
|
||||
type CommentOneWorkMomentReq struct {
|
||||
WorkMomentID string `json:"workMomentID" binding:"required"`
|
||||
ReplyUserID string `json:"replyUserID"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type CommentOneWorkMomentResp struct {
|
||||
CommResp
|
||||
Data struct{} `json:"data"`
|
||||
}
|
||||
|
||||
type DeleteCommentReq struct {
|
||||
WorkMomentID string `json:"workMomentID" binding:"required"`
|
||||
ContentID string `json:"contentID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type DeleteCommentResp struct {
|
||||
CommResp
|
||||
Data struct{} `json:"data"`
|
||||
}
|
||||
|
||||
type WorkMomentsUserCommonReq struct {
|
||||
PageNumber int32 `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int32 `json:"showNumber" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetWorkMomentByIDReq struct {
|
||||
WorkMomentID string `json:"workMomentID" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type WorkMoment struct {
|
||||
WorkMomentID string `json:"workMomentID"`
|
||||
UserID string `json:"userID"`
|
||||
Content string `json:"content"`
|
||||
LikeUserList []*WorkMomentUser `json:"likeUsers"`
|
||||
Comments []*Comment `json:"comments"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
UserName string `json:"userName"`
|
||||
AtUserList []*WorkMomentUser `json:"atUsers"`
|
||||
PermissionUserList []*WorkMomentUser `json:"permissionUsers"`
|
||||
CreateTime int32 `json:"createTime"`
|
||||
Permission int32 `json:"permission"`
|
||||
}
|
||||
|
||||
type WorkMomentUser struct {
|
||||
UserID string `json:"userID"`
|
||||
UserName string `json:"userName"`
|
||||
}
|
||||
|
||||
type Comment struct {
|
||||
UserID string `json:"userID"`
|
||||
UserName string `json:"userName"`
|
||||
ReplyUserID string `json:"replyUserID"`
|
||||
ReplyUserName string `json:"replyUserName"`
|
||||
ContentID string `json:"contentID"`
|
||||
Content string `json:"content"`
|
||||
CreateTime int32 `json:"createTime"`
|
||||
}
|
||||
|
||||
type GetWorkMomentByIDResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
WorkMoment *WorkMoment `json:"workMoment"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type GetUserWorkMomentsReq struct {
|
||||
WorkMomentsUserCommonReq
|
||||
UserID string `json:"userID"`
|
||||
}
|
||||
|
||||
type GetUserWorkMomentsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
WorkMoments []*WorkMoment `json:"workMoments"`
|
||||
CurrentPage int32 `json:"currentPage"`
|
||||
ShowNumber int32 `json:"showNumber"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type GetUserFriendWorkMomentsReq struct {
|
||||
WorkMomentsUserCommonReq
|
||||
}
|
||||
|
||||
type GetUserFriendWorkMomentsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
WorkMoments []*WorkMoment `json:"workMoments"`
|
||||
CurrentPage int32 `json:"currentPage"`
|
||||
ShowNumber int32 `json:"showNumber"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type SetUserWorkMomentsLevelReq struct {
|
||||
office.SetUserWorkMomentsLevelReq
|
||||
}
|
||||
|
||||
type SetUserWorkMomentsLevelResp struct {
|
||||
CommResp
|
||||
Data struct{} `json:"data"`
|
||||
}
|
@ -1,10 +1,6 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/utils"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -12,27 +8,6 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func JWTAuth() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
ok, userID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), "")
|
||||
// log.NewInfo("0", utils.GetSelfFuncName(), "userID: ", userID)
|
||||
c.Set("userID", userID)
|
||||
if !ok {
|
||||
log.NewError("", "GetUserIDFromToken false ", c.Request.Header.Get("token"))
|
||||
c.Abort()
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": 400, "errMsg": errInfo})
|
||||
return
|
||||
} else {
|
||||
if !utils.IsContain(userID, config.Config.Manager.AppManagerUid) {
|
||||
c.Abort()
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": 400, "errMsg": "user is not admin"})
|
||||
return
|
||||
}
|
||||
log.NewInfo("0", utils.GetSelfFuncName(), "failed: ", errInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CorsHandler() gin.HandlerFunc {
|
||||
return func(context *gin.Context) {
|
||||
context.Writer.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
|
@ -1,73 +0,0 @@
|
||||
package multi_terminal_login
|
||||
|
||||
//
|
||||
//import (
|
||||
// "Open_IM/internal/push/content_struct"
|
||||
// "Open_IM/internal/push/logic"
|
||||
// "Open_IM/pkg/common/config"
|
||||
// "Open_IM/pkg/common/constant"
|
||||
// "Open_IM/pkg/common/db"
|
||||
// pbChat "Open_IM/pkg/proto/msg"
|
||||
// "Open_IM/pkg/utils"
|
||||
//)
|
||||
//
|
||||
//const DayOfSecond = 24*60*60
|
||||
//func MultiTerminalLoginChecker(uid, token string, platformID int32) error {
|
||||
// // 1.check userid and platform class 0 not exists and 1 exists
|
||||
// exists, err := db.DB.ExistsUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)))
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// //get config multi login policy
|
||||
// if config.Config.MultiLoginPolicy {
|
||||
// //OnlyOneTerminalAccess policy need to check all terminal
|
||||
// if constant.PlatformNameToClass(constant.PlatformIDToName(platformID)) == "PC" {
|
||||
// exists, err = db.DB.ExistsUserIDAndPlatform(uid, "Mobile")
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// } else {
|
||||
// exists, err = db.DB.ExistsUserIDAndPlatform(uid, "PC")
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// }
|
||||
// if exists == 1 {
|
||||
// err := db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// PushMessageToTheTerminal(uid, platformID)
|
||||
// return nil
|
||||
// }
|
||||
// } else if config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther {
|
||||
// // common terminal need to kick eich other
|
||||
// if exists == 1 {
|
||||
// err := db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// PushMessageToTheTerminal(uid, platformID)
|
||||
// return nil
|
||||
// }
|
||||
// }
|
||||
// err = db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// PushMessageToTheTerminal(uid, platformID)
|
||||
// return nil
|
||||
//}
|
||||
////
|
||||
////func PushMessageToTheTerminal(uid string, platform int32) {
|
||||
////
|
||||
//// logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{
|
||||
//// SendID: uid,
|
||||
//// RecvID: uid,
|
||||
//// Content: content_struct.NewContentStructString(1, "", "Your account is already logged on other terminal,please confirm"),
|
||||
//// SendTime: utils.GetCurrentTimestampBySecond(),
|
||||
//// MsgFrom: constant.SysMsgType,
|
||||
//// ContentType: constant.KickOnlineTip,
|
||||
//// PlatformID: platform,
|
||||
//// })
|
||||
////}
|
Loading…
x
Reference in New Issue
Block a user