mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 11:35:59 +08:00
merge cms into v2.3.0release
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package base_info
|
||||
|
||||
type RequestPagination struct {
|
||||
PageNumber int `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int `json:"showNumber" binding:"required"`
|
||||
}
|
||||
|
||||
type ResponsePagination struct {
|
||||
CurrentPage int `json:"currentPage"`
|
||||
ShowNumber int `json:"showNumber"`
|
||||
}
|
||||
@@ -93,3 +93,39 @@ 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"`
|
||||
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"`
|
||||
}
|
||||
|
||||
@@ -7,21 +7,16 @@ import (
|
||||
)
|
||||
|
||||
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"`
|
||||
CreateIp string `json:"createIp" binding:"omitempty,max=15"`
|
||||
CreateTime int64 `json:"createTime"`
|
||||
LastLoginIp string `json:"LastLoginIp" binding:"omitempty,max=15"`
|
||||
LastLoginTime int64 `json:"lastLoginTime"`
|
||||
LoginTimes int32 `json:"loginTimes" binding:"omitempty"`
|
||||
LoginLimit int32 `json:"loginLimit" binding:"omitempty"`
|
||||
Ex string `json:"ex" binding:"omitempty,max=1024"`
|
||||
InvitationCode string `json:"invitationCode" binding:"omitempty"`
|
||||
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"`
|
||||
}
|
||||
|
||||
//type Conversation struct {
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package cms_api_struct
|
||||
|
||||
import server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
import (
|
||||
"Open_IM/pkg/base_info"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
type AdminLoginRequest struct {
|
||||
AdminName string `json:"admin_name" binding:"required"`
|
||||
Secret string `json:"secret" binding:"required"`
|
||||
AdminName string `json:"adminID" binding:"required"`
|
||||
Secret string `json:"secret" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type AdminLoginResponse struct {
|
||||
@@ -30,10 +34,10 @@ type ReduceUserRegisterAddFriendIDListResponse struct {
|
||||
|
||||
type GetUserRegisterAddFriendIDListRequest struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
RequestPaginationBody
|
||||
base_info.RequestPagination
|
||||
}
|
||||
|
||||
type GetUserRegisterAddFriendIDListResponse struct {
|
||||
Users []*server_api_params.UserInfo `json:"users"`
|
||||
ResponsePagination
|
||||
base_info.ResponsePagination
|
||||
}
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
package cms_api_struct
|
||||
|
||||
type RequestPagination struct {
|
||||
PageNumber int `form:"page_number" binding:"required"`
|
||||
ShowNumber int `form:"show_number" binding:"required"`
|
||||
}
|
||||
|
||||
type RequestPaginationBody struct {
|
||||
PageNumber int `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int `json:"showNumber" binding:"required"`
|
||||
}
|
||||
|
||||
type ResponsePagination struct {
|
||||
CurrentPage int `json:"current_number" binding:"required"`
|
||||
ShowNumber int `json:"show_number" binding:"required"`
|
||||
CurrentPage int `json:"currentPage"`
|
||||
ShowNumber int `json:"showNumber"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cms_api_struct
|
||||
|
||||
type GetFriendsReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
UserID string `json:"userID"`
|
||||
FriendUserName string `json:"friendUserName"`
|
||||
FriendUserID string `json:"friendUserID"`
|
||||
RequestPagination
|
||||
}
|
||||
|
||||
type FriendInfo struct {
|
||||
OwnerUserID string `json:"ownerUserID"`
|
||||
Remark string `json:"remark"`
|
||||
CreateTime uint32 `json:"createTime"`
|
||||
UserID string `json:"userID"`
|
||||
Nickname string `json:"nickName"`
|
||||
AddSource int32 `json:"addSource"`
|
||||
OperatorUserID string `json:"operatorUserID"`
|
||||
}
|
||||
|
||||
type GetFriendsResp struct {
|
||||
ResponsePagination
|
||||
FriendInfoList []*FriendInfo `json:"friendInfoList"`
|
||||
FriendNums int32 `json:"friendNums"`
|
||||
}
|
||||
+8
-108
@@ -1,9 +1,8 @@
|
||||
package cms_api_struct
|
||||
|
||||
type GroupResponse struct {
|
||||
GroupOwnerName string `json:"GroupOwnerName"`
|
||||
GroupOwnerID string `json:"GroupOwnerID"`
|
||||
//*server_api_params.GroupInfo
|
||||
GroupOwnerName string `json:"GroupOwnerName"`
|
||||
GroupOwnerID string `json:"GroupOwnerID"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
@@ -23,27 +22,11 @@ type GroupResponse struct {
|
||||
NotificationUserID string `json:"notificationUserID"`
|
||||
}
|
||||
|
||||
type GetGroupByIDRequest struct {
|
||||
GroupID string `form:"groupID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetGroupByIDResponse struct {
|
||||
GroupResponse
|
||||
}
|
||||
|
||||
type GetGroupRequest struct {
|
||||
GroupName string `form:"groupName" binding:"required"`
|
||||
RequestPagination
|
||||
}
|
||||
|
||||
type GetGroupResponse struct {
|
||||
Groups []GroupResponse `json:"groups"`
|
||||
GroupNums int `json:"groupNums"`
|
||||
ResponsePagination
|
||||
}
|
||||
|
||||
type GetGroupsRequest struct {
|
||||
RequestPagination
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupName string `json:"groupName"`
|
||||
}
|
||||
|
||||
type GetGroupsResponse struct {
|
||||
@@ -52,55 +35,10 @@ type GetGroupsResponse struct {
|
||||
ResponsePagination
|
||||
}
|
||||
|
||||
type CreateGroupRequest struct {
|
||||
GroupName string `json:"groupName" binding:"required"`
|
||||
GroupMasterId string `json:"groupOwnerID" binding:"required"`
|
||||
GroupMembers []string `json:"groupMembers" binding:"required"`
|
||||
}
|
||||
|
||||
type CreateGroupResponse struct {
|
||||
}
|
||||
|
||||
type SetGroupMasterRequest struct {
|
||||
GroupId string `json:"groupID" binding:"required"`
|
||||
UserId string `json:"userID" binding:"required"`
|
||||
}
|
||||
|
||||
type SetGroupMasterResponse struct {
|
||||
}
|
||||
|
||||
type SetGroupMemberRequest struct {
|
||||
GroupId string `json:"groupID" binding:"required"`
|
||||
UserId string `json:"userID" binding:"required"`
|
||||
}
|
||||
|
||||
type SetGroupMemberRespones struct {
|
||||
}
|
||||
|
||||
type BanGroupChatRequest struct {
|
||||
GroupId string `json:"groupID" binding:"required"`
|
||||
}
|
||||
|
||||
type BanGroupChatResponse struct {
|
||||
}
|
||||
|
||||
type BanPrivateChatRequest struct {
|
||||
GroupId string `json:"groupID" binding:"required"`
|
||||
}
|
||||
|
||||
type BanPrivateChatResponse struct {
|
||||
}
|
||||
|
||||
type DeleteGroupRequest struct {
|
||||
GroupId string `json:"groupID" binding:"required"`
|
||||
}
|
||||
|
||||
type DeleteGroupResponse struct {
|
||||
}
|
||||
|
||||
type GetGroupMembersRequest struct {
|
||||
GroupID string `form:"groupID" binding:"required"`
|
||||
UserName string `form:"userName"`
|
||||
GroupID string `form:"groupID" binding:"required"`
|
||||
UserName string `form:"userName"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
RequestPagination
|
||||
}
|
||||
|
||||
@@ -124,41 +62,3 @@ type GetGroupMembersResponse struct {
|
||||
ResponsePagination
|
||||
MemberNums int `json:"memberNums"`
|
||||
}
|
||||
|
||||
type GroupMemberRequest struct {
|
||||
GroupId string `json:"groupID" binding:"required"`
|
||||
Members []string `json:"members" binding:"required"`
|
||||
}
|
||||
|
||||
type GroupMemberOperateResponse struct {
|
||||
Success []string `json:"success"`
|
||||
Failed []string `json:"failed"`
|
||||
}
|
||||
|
||||
type AddGroupMembersRequest struct {
|
||||
GroupMemberRequest
|
||||
}
|
||||
|
||||
type AddGroupMembersResponse struct {
|
||||
GroupMemberOperateResponse
|
||||
}
|
||||
|
||||
type RemoveGroupMembersRequest struct {
|
||||
GroupMemberRequest
|
||||
}
|
||||
|
||||
type RemoveGroupMembersResponse struct {
|
||||
GroupMemberOperateResponse
|
||||
}
|
||||
|
||||
type AlterGroupInfoRequest struct {
|
||||
GroupID string `json:"groupID"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
ProfilePhoto string `json:"profilePhoto"`
|
||||
GroupType int `json:"groupType"`
|
||||
}
|
||||
|
||||
type AlterGroupInfoResponse struct {
|
||||
}
|
||||
|
||||
@@ -1,50 +1,48 @@
|
||||
package cms_api_struct
|
||||
|
||||
type BroadcastRequest struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type BroadcastResponse struct {
|
||||
}
|
||||
|
||||
type MassSendMassageRequest struct {
|
||||
Message string `json:"message"`
|
||||
Users []string `json:"users"`
|
||||
}
|
||||
|
||||
type MassSendMassageResponse struct {
|
||||
}
|
||||
|
||||
type GetChatLogsRequest struct {
|
||||
SessionType int `form:"session_type"`
|
||||
ContentType int `form:"content_type"`
|
||||
Content string `form:"content"`
|
||||
UserId string `form:"user_id"`
|
||||
GroupId string `form:"group_id"`
|
||||
Date string `form:"date"`
|
||||
import (
|
||||
pbCommon "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
type GetChatLogsReq struct {
|
||||
SessionType int `json:"sessionType"`
|
||||
ContentType int `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
SendID string `json:"userID"`
|
||||
RecvID string `json:"recvID"`
|
||||
GroupID string `json:"groupID"`
|
||||
SendTime string `json:"sendTime"`
|
||||
RequestPagination
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
|
||||
type ChatLog struct {
|
||||
SessionType int `json:"session_type"`
|
||||
ContentType int `json:"content_type"`
|
||||
SenderNickName string `json:"sender_nick_name"`
|
||||
SenderId string `json:"sender_id"`
|
||||
SearchContent string `json:"search_content"`
|
||||
WholeContent string `json:"whole_content"`
|
||||
|
||||
ReceiverNickName string `json:"receiver_nick_name,omitempty"`
|
||||
ReceiverID string `json:"receiver_id,omitempty"`
|
||||
|
||||
GroupName string `json:"group_name,omitempty"`
|
||||
GroupId string `json:"group_id,omitempty"`
|
||||
|
||||
Date string `json:"date"`
|
||||
SendID string `json:"sendID,omitempty"`
|
||||
RecvID string `json:"recvID,omitempty"`
|
||||
GroupID string `json:"groupID,omitempty"`
|
||||
ClientMsgID string `json:"clientMsgID,omitempty"`
|
||||
ServerMsgID string `json:"serverMsgID,omitempty"`
|
||||
SenderPlatformID int32 `json:"senderPlatformID,omitempty"`
|
||||
SenderNickname string `json:"senderNickname,omitempty"`
|
||||
SenderFaceURL string `json:"senderFaceURL,omitempty"`
|
||||
SessionType int32 `json:"sessionType,omitempty"`
|
||||
MsgFrom int32 `json:"msgFrom,omitempty"`
|
||||
ContentType int32 `json:"contentType,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Seq uint32 `json:"seq,omitempty"`
|
||||
SendTime int64 `json:"sendTime,omitempty"`
|
||||
CreateTime int64 `json:"createTime,omitempty"`
|
||||
Status int32 `json:"status,omitempty"`
|
||||
Options map[string]bool `json:"options,omitempty"`
|
||||
OfflinePushInfo *pbCommon.OfflinePushInfo `json:"offlinePushInfo,omitempty"`
|
||||
AtUserIDList []string `json:"atUserIDList,omitempty"`
|
||||
MsgDataList []byte `json:"msgDataList,omitempty"`
|
||||
AttachedInfo string `json:"attachedInfo,omitempty"`
|
||||
Ex string `json:"ex,omitempty"`
|
||||
}
|
||||
|
||||
type GetChatLogsResponse struct {
|
||||
ChatLogs []ChatLog `json:"chat_logs"`
|
||||
ChatLogsNum int `json:"log_nums"`
|
||||
type GetChatLogsResp struct {
|
||||
ChatLogs []*ChatLog `json:"chatLogs"`
|
||||
ChatLogsNum int `json:"logNums"`
|
||||
ResponsePagination
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package cms_api_struct
|
||||
|
||||
type GetStaffsResponse struct {
|
||||
StaffsList []struct {
|
||||
ProfilePhoto string `json:"profile_photo"`
|
||||
NickName string `json:"nick_name"`
|
||||
StaffId int `json:"staff_id"`
|
||||
Position string `json:"position"`
|
||||
EntryTime string `json:"entry_time"`
|
||||
} `json:"staffs_list"`
|
||||
}
|
||||
|
||||
type GetOrganizationsResponse struct {
|
||||
OrganizationList []struct {
|
||||
OrganizationId int `json:"organization_id"`
|
||||
OrganizationName string `json:"organization_name"`
|
||||
} `json:"organization_list"`
|
||||
}
|
||||
|
||||
type SquadResponse struct {
|
||||
SquadList []struct {
|
||||
SquadId int `json:"squad_id"`
|
||||
SquadName string `json:"squad_name"`
|
||||
} `json:"squad_list"`
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package cms_api_struct
|
||||
|
||||
type GetStatisticsRequest struct {
|
||||
From string `form:"from" binding:"required"`
|
||||
To string `form:"to" binding:"required"`
|
||||
From string `json:"from" binding:"required"`
|
||||
To string `json:"to" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type GetMessageStatisticsRequest struct {
|
||||
@@ -10,16 +11,16 @@ type GetMessageStatisticsRequest struct {
|
||||
}
|
||||
|
||||
type GetMessageStatisticsResponse struct {
|
||||
PrivateMessageNum int `json:"private_message_num"`
|
||||
GroupMessageNum int `json:"group_message_num"`
|
||||
PrivateMessageNum int `json:"privateMessageNum"`
|
||||
GroupMessageNum int `json:"groupMessageNum"`
|
||||
PrivateMessageNumList []struct {
|
||||
Date string `json:"date"`
|
||||
MessageNum int `json:"message_num"`
|
||||
} `json:"private_message_num_list"`
|
||||
MessageNum int `json:"messageNum"`
|
||||
} `json:"privateMessageNumList"`
|
||||
GroupMessageNumList []struct {
|
||||
Date string `json:"date"`
|
||||
MessageNum int `json:"message_num"`
|
||||
} `json:"group_message_num_list"`
|
||||
MessageNum int `json:"messageNum"`
|
||||
} `json:"groupMessageNumList"`
|
||||
}
|
||||
|
||||
type GetUserStatisticsRequest struct {
|
||||
@@ -27,21 +28,21 @@ type GetUserStatisticsRequest struct {
|
||||
}
|
||||
|
||||
type GetUserStatisticsResponse struct {
|
||||
IncreaseUserNum int `json:"increase_user_num"`
|
||||
ActiveUserNum int `json:"active_user_num"`
|
||||
TotalUserNum int `json:"total_user_num"`
|
||||
IncreaseUserNum int `json:"increaseUserNum"`
|
||||
ActiveUserNum int `json:"activeUserNum"`
|
||||
TotalUserNum int `json:"totalUserNum"`
|
||||
IncreaseUserNumList []struct {
|
||||
Date string `json:"date"`
|
||||
IncreaseUserNum int `json:"increase_user_num"`
|
||||
} `json:"increase_user_num_list"`
|
||||
IncreaseUserNum int `json:"increaseUserNum"`
|
||||
} `json:"increaseUserNumList"`
|
||||
ActiveUserNumList []struct {
|
||||
Date string `json:"date"`
|
||||
ActiveUserNum int `json:"active_user_num"`
|
||||
} `json:"active_user_num_list"`
|
||||
ActiveUserNum int `json:"activeUserNum"`
|
||||
} `json:"activeUserNumList"`
|
||||
TotalUserNumList []struct {
|
||||
Date string `json:"date"`
|
||||
TotalUserNum int `json:"total_user_num"`
|
||||
} `json:"total_user_num_list"`
|
||||
TotalUserNum int `json:"totalUserNum"`
|
||||
} `json:"totalUserNumList"`
|
||||
}
|
||||
|
||||
type GetGroupStatisticsRequest struct {
|
||||
@@ -50,16 +51,16 @@ type GetGroupStatisticsRequest struct {
|
||||
|
||||
// 群聊统计
|
||||
type GetGroupStatisticsResponse struct {
|
||||
IncreaseGroupNum int `json:"increase_group_num"`
|
||||
TotalGroupNum int `json:"total_group_num"`
|
||||
IncreaseGroupNum int `json:"increaseGroupNum"`
|
||||
TotalGroupNum int `json:"totalGroupNum"`
|
||||
IncreaseGroupNumList []struct {
|
||||
Date string `json:"date"`
|
||||
IncreaseGroupNum int `json:"increase_group_num"`
|
||||
} `json:"increase_group_num_list"`
|
||||
IncreaseGroupNum int `json:"increaseGroupNum"`
|
||||
} `json:"increaseGroupNumList"`
|
||||
TotalGroupNumList []struct {
|
||||
Date string `json:"date"`
|
||||
TotalGroupNum int `json:"total_group_num"`
|
||||
} `json:"total_group_num_list"`
|
||||
TotalGroupNum int `json:"totalGroupNum"`
|
||||
} `json:"totalGroupNumList"`
|
||||
}
|
||||
|
||||
type GetActiveUserRequest struct {
|
||||
@@ -69,10 +70,10 @@ type GetActiveUserRequest struct {
|
||||
|
||||
type GetActiveUserResponse struct {
|
||||
ActiveUserList []struct {
|
||||
NickName string `json:"nick_name"`
|
||||
UserId string `json:"user_id"`
|
||||
MessageNum int `json:"message_num"`
|
||||
} `json:"active_user_list"`
|
||||
NickName string `json:"nickName"`
|
||||
UserId string `json:"userID"`
|
||||
MessageNum int `json:"messageNum"`
|
||||
} `json:"activeUserList"`
|
||||
}
|
||||
|
||||
type GetActiveGroupRequest struct {
|
||||
@@ -82,8 +83,8 @@ type GetActiveGroupRequest struct {
|
||||
|
||||
type GetActiveGroupResponse struct {
|
||||
ActiveGroupList []struct {
|
||||
GroupName string `json:"group_name"`
|
||||
GroupId string `json:"group_id"`
|
||||
MessageNum int `json:"message_num"`
|
||||
} `json:"active_group_list"`
|
||||
GroupName string `json:"groupName"`
|
||||
GroupId string `json:"groupID"`
|
||||
MessageNum int `json:"messageNum"`
|
||||
} `json:"activeGroupList"`
|
||||
}
|
||||
|
||||
+25
-85
@@ -1,79 +1,31 @@
|
||||
package cms_api_struct
|
||||
|
||||
type UserResponse struct {
|
||||
ProfilePhoto string `json:"profile_photo"`
|
||||
Nickname string `json:"nick_name"`
|
||||
UserId string `json:"user_id"`
|
||||
CreateTime string `json:"create_time,omitempty"`
|
||||
CreateIp string `json:"create_ip,omitempty"`
|
||||
LastLoginTime string `json:"last_login_time,omitempty"`
|
||||
LastLoginIp string `json:"last_login_ip,omitempty"`
|
||||
LoginTimes int32 `json:"login_times"`
|
||||
LoginLimit int32 `json:"login_limit"`
|
||||
IsBlock bool `json:"is_block"`
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Nickname string `json:"nickName"`
|
||||
UserID string `json:"userID"`
|
||||
CreateTime string `json:"createTime,omitempty"`
|
||||
CreateIp string `json:"createIp,omitempty"`
|
||||
LastLoginTime string `json:"lastLoginTime,omitempty"`
|
||||
LastLoginIp string `json:"lastLoginIP,omitempty"`
|
||||
LoginTimes int32 `json:"loginTimes"`
|
||||
LoginLimit int32 `json:"loginLimit"`
|
||||
IsBlock bool `json:"isBlock"`
|
||||
PhoneNumber string `json:"phoneNumber"`
|
||||
Email string `json:"email"`
|
||||
Birth string `json:"birth"`
|
||||
Gender int `json:"gender"`
|
||||
}
|
||||
|
||||
type GetUserRequest struct {
|
||||
UserId string `form:"user_id" binding:"required"`
|
||||
}
|
||||
|
||||
type GetUserResponse struct {
|
||||
UserResponse
|
||||
}
|
||||
|
||||
type GetUsersRequest struct {
|
||||
RequestPagination
|
||||
}
|
||||
|
||||
type GetUsersResponse struct {
|
||||
Users []*UserResponse `json:"users"`
|
||||
ResponsePagination
|
||||
UserNums int32 `json:"user_nums"`
|
||||
}
|
||||
|
||||
type GetUsersByNameRequest struct {
|
||||
UserName string `form:"user_name" binding:"required"`
|
||||
RequestPagination
|
||||
}
|
||||
|
||||
type GetUsersByNameResponse struct {
|
||||
Users []*UserResponse `json:"users"`
|
||||
ResponsePagination
|
||||
UserNums int32 `json:"user_nums"`
|
||||
}
|
||||
|
||||
type ResignUserRequest struct {
|
||||
UserId string `json:"user_id"`
|
||||
}
|
||||
|
||||
type ResignUserResponse struct {
|
||||
}
|
||||
|
||||
type AlterUserRequest struct {
|
||||
UserId string `json:"user_id" binding:"required"`
|
||||
Nickname string `json:"nickname"`
|
||||
PhoneNumber string `json:"phone_number" validate:"len=11"`
|
||||
Email string `json:"email"`
|
||||
Birth string `json:"birth"`
|
||||
Gender string `json:"gender"`
|
||||
Photo string `json:"photo"`
|
||||
}
|
||||
|
||||
type AlterUserResponse struct {
|
||||
}
|
||||
|
||||
type AddUserRequest struct {
|
||||
PhoneNumber string `json:"phone_number" binding:"required"`
|
||||
UserId string `json:"user_id" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
PhoneNumber string `json:"phoneNumber" binding:"required"`
|
||||
UserId string `json:"userID" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Email string `json:"email"`
|
||||
Birth string `json:"birth"`
|
||||
Gender string `json:"gender"`
|
||||
Photo string `json:"photo"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
}
|
||||
|
||||
type AddUserResponse struct {
|
||||
@@ -81,46 +33,34 @@ type AddUserResponse struct {
|
||||
|
||||
type BlockUser struct {
|
||||
UserResponse
|
||||
BeginDisableTime string `json:"begin_disable_time"`
|
||||
EndDisableTime string `json:"end_disable_time"`
|
||||
BeginDisableTime string `json:"beginDisableTime"`
|
||||
EndDisableTime string `json:"endDisableTime"`
|
||||
}
|
||||
|
||||
type BlockUserRequest struct {
|
||||
UserId string `json:"user_id" binding:"required"`
|
||||
EndDisableTime string `json:"end_disable_time" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
EndDisableTime string `json:"endDisableTime" binding:"required"`
|
||||
}
|
||||
|
||||
type BlockUserResponse struct {
|
||||
}
|
||||
|
||||
type UnblockUserRequest struct {
|
||||
UserId string `json:"user_id" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
}
|
||||
|
||||
type UnBlockUserResponse struct {
|
||||
}
|
||||
|
||||
type GetBlockUsersRequest struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
RequestPagination
|
||||
}
|
||||
|
||||
type GetBlockUsersResponse struct {
|
||||
BlockUsers []BlockUser `json:"block_users"`
|
||||
BlockUsers []BlockUser `json:"blockUsers"`
|
||||
ResponsePagination
|
||||
UserNums int32 `json:"user_nums"`
|
||||
}
|
||||
|
||||
type GetBlockUserRequest struct {
|
||||
UserId string `form:"user_id" binding:"required"`
|
||||
}
|
||||
|
||||
type GetBlockUserResponse struct {
|
||||
BlockUser
|
||||
}
|
||||
|
||||
type DeleteUserRequest struct {
|
||||
UserId string `json:"user_id" binding:"required"`
|
||||
}
|
||||
|
||||
type DeleteUserResponse struct {
|
||||
UserNums int32 `json:"userNums"`
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type Register struct {
|
||||
type Invitation struct {
|
||||
InvitationCode string `gorm:"column:invitation_code;primary_key;type:varchar(32)"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
UserID string `gorm:"column:user_id"`
|
||||
UserID string `gorm:"column:user_id;index:userID"`
|
||||
LastTime time.Time `gorm:"column:last_time"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
}
|
||||
@@ -92,7 +92,7 @@ type Group struct {
|
||||
Notification string `gorm:"column:notification;size:255" json:"notification"`
|
||||
Introduction string `gorm:"column:introduction;size:255" json:"introduction"`
|
||||
FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
CreateTime time.Time `gorm:"column:create_time;index:create_time"`
|
||||
Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
CreatorUserID string `gorm:"column:creator_user_id;size:64"`
|
||||
@@ -176,16 +176,20 @@ type User struct {
|
||||
Birth time.Time `gorm:"column:birth"`
|
||||
Email string `gorm:"column:email;size:64"`
|
||||
Ex string `gorm:"column:ex;size:1024"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
CreateIp string `gorm:"column:create_ip;size:15"`
|
||||
LastLoginTime time.Time `gorm:"column:last_login_time"`
|
||||
LastLoginIp string `gorm:"column:last_login_ip;size:15"`
|
||||
LoginTimes int32 `gorm:"column:login_times"`
|
||||
LoginLimit int32 `gorm:"column:login_limit"`
|
||||
CreateTime time.Time `gorm:"column:create_time;index:create_time"`
|
||||
AppMangerLevel int32 `gorm:"column:app_manger_level"`
|
||||
GlobalRecvMsgOpt int32 `gorm:"column:global_recv_msg_opt"`
|
||||
InvitationCode string `gorm:"column:invitation_code"`
|
||||
status int32 `gorm:"column:status"`
|
||||
|
||||
status int32 `gorm:"column:status"`
|
||||
}
|
||||
|
||||
type UserIpRecord struct {
|
||||
UserID string `gorm:"column:user_id;primary_key;size:64"`
|
||||
CreateIp string `gorm:"column:create_ip;size:15"`
|
||||
LastLoginTime time.Time `gorm:"column:last_login_time"`
|
||||
LastLoginIp string `gorm:"column:last_login_ip;size:15"`
|
||||
LoginTimes int32 `gorm:"column:login_times"`
|
||||
LoginLimit int32 `gorm:"column:login_limit"`
|
||||
}
|
||||
|
||||
type IpLimit struct {
|
||||
@@ -223,17 +227,17 @@ type Black struct {
|
||||
type ChatLog struct {
|
||||
ServerMsgID string `gorm:"column:server_msg_id;primary_key;type:char(64)" json:"serverMsgID"`
|
||||
ClientMsgID string `gorm:"column:client_msg_id;type:char(64)" json:"clientMsgID"`
|
||||
SendID string `gorm:"column:send_id;type:char(64)" json:"sendID"`
|
||||
RecvID string `gorm:"column:recv_id;type:char(64)" json:"recvID"`
|
||||
SendID string `gorm:"column:send_id;type:char(64);index:send_id,priority:2" json:"sendID"`
|
||||
RecvID string `gorm:"column:recv_id;type:char(64);index:recv_id,priority:2" json:"recvID"`
|
||||
SenderPlatformID int32 `gorm:"column:sender_platform_id" json:"senderPlatformID"`
|
||||
SenderNickname string `gorm:"column:sender_nick_name;type:varchar(255)" json:"senderNickname"`
|
||||
SenderFaceURL string `gorm:"column:sender_face_url;type:varchar(255)" json:"senderFaceURL"`
|
||||
SessionType int32 `gorm:"column:session_type" json:"sessionType"`
|
||||
SenderFaceURL string `gorm:"column:sender_face_url;type:varchar(255);" json:"senderFaceURL"`
|
||||
SessionType int32 `gorm:"column:session_type;index:session_type,priority:2;index:session_type_alone" json:"sessionType"`
|
||||
MsgFrom int32 `gorm:"column:msg_from" json:"msgFrom"`
|
||||
ContentType int32 `gorm:"column:content_type" json:"contentType"`
|
||||
ContentType int32 `gorm:"column:content_type;index:content_type,priority:2;index:content_type_alone" json:"contentType"`
|
||||
Content string `gorm:"column:content;type:varchar(3000)" json:"content"`
|
||||
Status int32 `gorm:"column:status" json:"status"`
|
||||
SendTime time.Time `gorm:"column:send_time" json:"sendTime"`
|
||||
SendTime time.Time `gorm:"column:send_time;index:sendTime;index:content_type,priority:1;index:session_type,priority:1;index:recv_id,priority:1;index:send_id,priority:1" json:"sendTime"`
|
||||
CreateTime time.Time `gorm:"column:create_time" json:"createTime"`
|
||||
Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ func initMysqlDB() {
|
||||
Writer{},
|
||||
logger.Config{
|
||||
SlowThreshold: 200 * time.Millisecond, // Slow SQL threshold
|
||||
LogLevel: logger.Error, // Log level
|
||||
LogLevel: logger.Info, // Log level
|
||||
IgnoreRecordNotFoundError: true, // Ignore ErrRecordNotFound error for logger
|
||||
Colorful: true, // Disable color
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ package im_mysql_model
|
||||
import (
|
||||
"Open_IM/pkg/common/db"
|
||||
"errors"
|
||||
|
||||
_ "gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -74,3 +75,10 @@ func DeleteAllRegisterAddFriendIDList() error {
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Where("1 = 1").Delete(&db.RegisterAddFriend{}).Error
|
||||
return err
|
||||
}
|
||||
|
||||
func GetUserIPLimit(userID string) (db.UserIpLimit, error) {
|
||||
var limit db.UserIpLimit
|
||||
limit.UserID = userID
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpLimit{}).Take(&limit).Error
|
||||
return limit, err
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package im_mysql_model
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/db"
|
||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
||||
)
|
||||
|
||||
func InsertToFriend(toInsertFollow *db.Friend) error {
|
||||
@@ -51,3 +53,34 @@ func UpdateFriendComment(OwnerUserID, FriendUserID, Remark string) error {
|
||||
func DeleteSingleFriendInfo(OwnerUserID, FriendUserID string) error {
|
||||
return db.DB.MysqlDB.DefaultGormDB().Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Delete(db.Friend{}).Error
|
||||
}
|
||||
|
||||
type FriendUser struct {
|
||||
db.Friend
|
||||
Nickname string `gorm:"column:name;size:255"`
|
||||
}
|
||||
|
||||
func GetUserFriendsCMS(ownerUserID, friendUserName string, pageNumber, showNumber int32) (friendUserList []*FriendUser, count int64, err error) {
|
||||
db := db.DB.MysqlDB.DefaultGormDB().Table("friends").
|
||||
Select("friends.*, users.name").
|
||||
Where("friends.owner_user_id=?", ownerUserID).Limit(int(showNumber)).
|
||||
Joins("left join users on friends.friend_user_id = users.user_id").
|
||||
Offset(int(showNumber * (pageNumber - 1)))
|
||||
if friendUserName != "" {
|
||||
db = db.Where("users.name like ?", fmt.Sprintf("%%%s%%", friendUserName))
|
||||
}
|
||||
if err = db.Count(&count).Error; err != nil {
|
||||
return
|
||||
}
|
||||
err = db.Find(&friendUserList).Error
|
||||
return
|
||||
}
|
||||
|
||||
func GetFriendByIDCMS(ownerUserID, friendUserID string) (friendUser *FriendUser, err error) {
|
||||
friendUser = &FriendUser{}
|
||||
err = db.DB.MysqlDB.DefaultGormDB().Table("friends").
|
||||
Select("friends.*, users.name").
|
||||
Where("friends.owner_user_id=? and friends.friend_user_id=?", ownerUserID, friendUserID).
|
||||
Joins("left join users on friends.friend_user_id = users.user_id").
|
||||
Take(friendUser).Error
|
||||
return friendUser, err
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package im_mysql_model
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/utils"
|
||||
"fmt"
|
||||
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -54,7 +56,7 @@ type GroupWithNum struct {
|
||||
func GetGroupsByName(groupName string, pageNumber, showNumber int32) ([]GroupWithNum, error) {
|
||||
var groups []GroupWithNum
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("groups").Select("groups.*, (select count(*) from group_members where group_members.group_id=groups.group_id) as num").
|
||||
Where(fmt.Sprintf(" name like '%%%s%%' ", groupName)).Limit(int(showNumber)).Offset(int(showNumber * (pageNumber - 1))).Find(&groups).Error
|
||||
Where(" name like ? and status != ?", fmt.Sprintf("%%%s%%", groupName), constant.GroupStatusDismissed).Limit(int(showNumber)).Offset(int(showNumber * (pageNumber - 1))).Find(&groups).Error
|
||||
return groups, err
|
||||
}
|
||||
|
||||
@@ -80,7 +82,7 @@ func OperateGroupStatus(groupId string, groupStatus int32) error {
|
||||
|
||||
func GetGroupsCountNum(group db.Group) (int32, error) {
|
||||
var count int64
|
||||
if err := db.DB.MysqlDB.DefaultGormDB().Table("groups").Where(fmt.Sprintf(" name like '%%%s%%' ", group.GroupName)).Count(&count).Error; err != nil {
|
||||
if err := db.DB.MysqlDB.DefaultGormDB().Table("groups").Where(" name like ? ", fmt.Sprintf("%%%s%%", group.GroupName)).Count(&count).Error; err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int32(count), nil
|
||||
|
||||
@@ -74,3 +74,15 @@ func GetRegisterUserNum(ip string) ([]string, error) {
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.Register{}).Where("register_ip=?", ip).Pluck("user_id", &userIDList).Error
|
||||
return userIDList, err
|
||||
}
|
||||
|
||||
func InsertIpRecord(userID, createIp string) error {
|
||||
record := &db.UserIpRecord{UserID: userID, CreateIp: createIp, LastLoginTime: time.Now(), LoginTimes: 1}
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpRecord{}).Create(record).Error
|
||||
return err
|
||||
}
|
||||
|
||||
func UpdateIpReocord(userID, ip string) error {
|
||||
record := &db.UserIpRecord{UserID: userID, LastLoginIp: ip, LastLoginTime: time.Now()}
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpRecord{}).Updates(record).Updates("login_times = login_times + 1").Error
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package im_mysql_model
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/utils"
|
||||
@@ -10,10 +11,17 @@ import (
|
||||
func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog, error) {
|
||||
var chatLogs []db.ChatLog
|
||||
db := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").
|
||||
Where(fmt.Sprintf(" content like '%%%s%%'", chatLog.Content)).
|
||||
Limit(int(showNumber)).Offset(int(showNumber * (pageNumber - 1)))
|
||||
if chatLog.SessionType != 0 {
|
||||
if chatLog.SendTime.Unix() > 0 {
|
||||
db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
}
|
||||
if chatLog.Content != "" {
|
||||
db = db.Where(" content like ? ", fmt.Sprintf("%%%s%%", chatLog.Content))
|
||||
}
|
||||
if chatLog.SessionType == 1 {
|
||||
db = db.Where("session_type = ?", chatLog.SessionType)
|
||||
} else if chatLog.SessionType == 2 {
|
||||
db = db.Where("content_type in (?)", []int{constant.GroupChatType, constant.SuperGroupChatType})
|
||||
}
|
||||
if chatLog.ContentType != 0 {
|
||||
db = db.Where("content_type = ?", chatLog.ContentType)
|
||||
@@ -24,23 +32,28 @@ func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog,
|
||||
if chatLog.RecvID != "" {
|
||||
db = db.Where("recv_id = ?", chatLog.RecvID)
|
||||
}
|
||||
if chatLog.SendTime.Unix() > 0 {
|
||||
db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
}
|
||||
|
||||
err := db.Find(&chatLogs).Error
|
||||
return chatLogs, err
|
||||
}
|
||||
|
||||
func GetChatLogCount(chatLog db.ChatLog) (int64, error) {
|
||||
var chatLogs []db.ChatLog
|
||||
var count int64
|
||||
db := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").
|
||||
Where(fmt.Sprintf(" content like '%%%s%%'", chatLog.Content))
|
||||
db := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs")
|
||||
if chatLog.SendTime.Unix() > 0 {
|
||||
log.NewDebug("", utils.GetSelfFuncName(), chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
}
|
||||
if chatLog.Content != "" {
|
||||
db = db.Where(" content like ? ", fmt.Sprintf("%%%s%%", chatLog.Content))
|
||||
}
|
||||
if chatLog.SessionType != 0 {
|
||||
db = db.Where("session_type = ?", chatLog.SessionType)
|
||||
}
|
||||
if chatLog.ContentType != 0 {
|
||||
if chatLog.ContentType == 1 {
|
||||
db = db.Where("content_type = ?", chatLog.ContentType)
|
||||
} else if chatLog.ContentType == 2 {
|
||||
db = db.Where("content_type in (?)", []int{constant.GroupChatType, constant.SuperGroupChatType})
|
||||
}
|
||||
if chatLog.SendID != "" {
|
||||
db = db.Where("send_id = ?", chatLog.SendID)
|
||||
@@ -48,11 +61,7 @@ func GetChatLogCount(chatLog db.ChatLog) (int64, error) {
|
||||
if chatLog.RecvID != "" {
|
||||
db = db.Where("recv_id = ?", chatLog.RecvID)
|
||||
}
|
||||
if chatLog.SendTime.Unix() > 0 {
|
||||
log.NewDebug("", utils.GetSelfFuncName(), chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1))
|
||||
}
|
||||
|
||||
err := db.Find(&chatLogs).Count(&count).Error
|
||||
err := db.Count(&count).Error
|
||||
return count, err
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package im_mysql_model
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GetActiveUserNum(from, to time.Time) (int32, error) {
|
||||
var num int64
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("count(distinct(send_id))").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("count(distinct(send_id))").Where("send_time >= ? and send_time <= ?", from, to).Count(&num).Error
|
||||
return int32(num), err
|
||||
}
|
||||
|
||||
@@ -31,13 +32,13 @@ func GetTotalUserNumByDate(to time.Time) (int32, error) {
|
||||
|
||||
func GetPrivateMessageNum(from, to time.Time) (int32, error) {
|
||||
var num int64
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 1).Count(&num).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Where("send_time >= ? and send_time <= ? and session_type = ?", from, to, 1).Count(&num).Error
|
||||
return int32(num), err
|
||||
}
|
||||
|
||||
func GetGroupMessageNum(from, to time.Time) (int32, error) {
|
||||
var num int64
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 2).Count(&num).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Where("send_time >= ? and send_time <= ? and session_type = ?", from, to, 2).Count(&num).Error
|
||||
return int32(num), err
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ type activeGroup struct {
|
||||
|
||||
func GetActiveGroups(from, to time.Time, limit int) ([]*activeGroup, error) {
|
||||
var activeGroups []*activeGroup
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("recv_id, count(*) as message_num").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 2).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("recv_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type in (?)", from, to, []int{constant.GroupChatType, constant.SuperGroupChatType}).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error
|
||||
for _, activeGroup := range activeGroups {
|
||||
group := db.Group{
|
||||
GroupID: activeGroup.Id,
|
||||
@@ -80,18 +81,21 @@ func GetActiveGroups(from, to time.Time, limit int) ([]*activeGroup, error) {
|
||||
|
||||
type activeUser struct {
|
||||
Name string
|
||||
Id string `gorm:"column:send_id"`
|
||||
ID string `gorm:"column:send_id"`
|
||||
MessageNum int `gorm:"column:message_num"`
|
||||
}
|
||||
|
||||
func GetActiveUsers(from, to time.Time, limit int) ([]*activeUser, error) {
|
||||
var activeUsers []*activeUser
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("send_id, count(*) as message_num").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 1).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("send_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type = ?", from, to, constant.SingleChatType).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error
|
||||
for _, activeUser := range activeUsers {
|
||||
user := db.User{
|
||||
UserID: activeUser.Id,
|
||||
UserID: activeUser.ID,
|
||||
}
|
||||
err = db.DB.MysqlDB.DefaultGormDB().Table("users").Select("user_id, name").Find(&user).Error
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
db.DB.MysqlDB.DefaultGormDB().Table("users").Select("user_id, name").Find(&user)
|
||||
activeUser.Name = user.Nickname
|
||||
}
|
||||
return activeUsers, err
|
||||
|
||||
@@ -11,14 +11,14 @@ func InsertInToUserBlackList(black db.Black) error {
|
||||
return db.DB.MysqlDB.DefaultGormDB().Table("blacks").Create(black).Error
|
||||
}
|
||||
|
||||
//type Black struct {
|
||||
// OwnerUserID string `gorm:"column:owner_user_id;primaryKey;"`
|
||||
// BlockUserID string `gorm:"column:block_user_id;primaryKey;"`
|
||||
// CreateTime time.Time `gorm:"column:create_time"`
|
||||
// AddSource int32 `gorm:"column:add_source"`
|
||||
// OperatorUserID int32 `gorm:"column:operator_user_id"`
|
||||
// Ex string `gorm:"column:ex"`
|
||||
//}
|
||||
// type Black struct {
|
||||
// OwnerUserID string `gorm:"column:owner_user_id;primaryKey;"`
|
||||
// BlockUserID string `gorm:"column:block_user_id;primaryKey;"`
|
||||
// CreateTime time.Time `gorm:"column:create_time"`
|
||||
// AddSource int32 `gorm:"column:add_source"`
|
||||
// OperatorUserID int32 `gorm:"column:operator_user_id"`
|
||||
// Ex string `gorm:"column:ex"`
|
||||
// }
|
||||
|
||||
func CheckBlack(ownerUserID, blockUserID string) error {
|
||||
var black db.Black
|
||||
|
||||
@@ -43,9 +43,6 @@ func UserRegister(user db.User) error {
|
||||
if user.Birth.Unix() < 0 {
|
||||
user.Birth = utils.UnixSecondToTime(0)
|
||||
}
|
||||
user.LastLoginTime = time.Now()
|
||||
user.LoginTimes = 0
|
||||
user.LastLoginIp = user.CreateIp
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("users").Create(&user).Error
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -124,31 +121,21 @@ func GetUsers(showNumber, pageNumber int32) ([]db.User, error) {
|
||||
return users, err
|
||||
}
|
||||
|
||||
func AddUser(userId string, phoneNumber string, name string, email string, gender string, photo string, birth string) error {
|
||||
_gender, _err := strconv.Atoi(gender)
|
||||
if _err != nil {
|
||||
_gender = 0
|
||||
}
|
||||
_birth, _err := time.ParseInLocation("2006-01-02", birth, time.Local)
|
||||
func AddUser(userID string, phoneNumber string, name string, email string, gender int32, faceURL string, birth uint32) error {
|
||||
_birth, _err := time.ParseInLocation("2006-01-02", strconv.Itoa(int(birth)), time.Local)
|
||||
if _err != nil {
|
||||
_birth = time.Now()
|
||||
}
|
||||
user := db.User{
|
||||
UserID: userId,
|
||||
Nickname: name,
|
||||
FaceURL: photo,
|
||||
Gender: int32(_gender),
|
||||
PhoneNumber: phoneNumber,
|
||||
Birth: _birth,
|
||||
Email: email,
|
||||
Ex: "",
|
||||
CreateTime: time.Now(),
|
||||
CreateIp: "",
|
||||
LastLoginTime: time.Now(),
|
||||
LastLoginIp: "",
|
||||
LoginTimes: 0,
|
||||
LoginLimit: 0,
|
||||
InvitationCode: "",
|
||||
UserID: userID,
|
||||
Nickname: name,
|
||||
FaceURL: faceURL,
|
||||
Gender: gender,
|
||||
PhoneNumber: phoneNumber,
|
||||
Birth: _birth,
|
||||
Email: email,
|
||||
Ex: "",
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
result := db.DB.MysqlDB.DefaultGormDB().Table("users").Create(&user)
|
||||
return result.Error
|
||||
@@ -163,8 +150,13 @@ func UserIsBlock(userId string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func BlockUser(userId, endDisableTime string) error {
|
||||
user, err := GetUserByUserID(userId)
|
||||
func UsersIsBlock(userIDList []string) (inBlockUserIDList []string, err error) {
|
||||
err = db.DB.MysqlDB.DefaultGormDB().Table("black_lists").Where("uid in (?) and end_disable_time > now()", userIDList).Pluck("uid", &inBlockUserIDList).Error
|
||||
return inBlockUserIDList, err
|
||||
}
|
||||
|
||||
func BlockUser(userID, endDisableTime string) error {
|
||||
user, err := GetUserByUserID(userID)
|
||||
if err != nil || user.UserID == "" {
|
||||
return err
|
||||
}
|
||||
@@ -176,34 +168,34 @@ func BlockUser(userId, endDisableTime string) error {
|
||||
return constant.ErrDB
|
||||
}
|
||||
var blockUser db.BlackList
|
||||
db.DB.MysqlDB.DefaultGormDB().Table("black_lists").Where("uid=?", userId).First(&blockUser)
|
||||
db.DB.MysqlDB.DefaultGormDB().Table("black_lists").Where("uid=?", userID).First(&blockUser)
|
||||
if blockUser.UserId != "" {
|
||||
db.DB.MysqlDB.DefaultGormDB().Model(&blockUser).Where("uid=?", blockUser.UserId).Update("end_disable_time", end)
|
||||
if user.LoginLimit != 2 {
|
||||
db.DB.MysqlDB.DefaultGormDB().Table("users").Where("user_id=?", blockUser.UserId).Update("login_limit", 2)
|
||||
}
|
||||
// if user.LoginLimit != 2 {
|
||||
// db.DB.MysqlDB.DefaultGormDB().Table("users").Where("user_id=?", blockUser.UserId).Update("login_limit", 2)
|
||||
// }
|
||||
return nil
|
||||
}
|
||||
blockUser = db.BlackList{
|
||||
UserId: userId,
|
||||
UserId: userID,
|
||||
BeginDisableTime: time.Now(),
|
||||
EndDisableTime: end,
|
||||
}
|
||||
result := db.DB.MysqlDB.DefaultGormDB().Create(&blockUser)
|
||||
if result.Error == nil {
|
||||
if user.LoginLimit != 2 {
|
||||
db.DB.MysqlDB.DefaultGormDB().Table("users").Where("user_id=?", blockUser.UserId).Update("login_limit", 2)
|
||||
}
|
||||
// if user.LoginLimit != 2 {
|
||||
// db.DB.MysqlDB.DefaultGormDB().Table("users").Where("user_id=?", blockUser.UserId).Update("login_limit", 2)
|
||||
// }
|
||||
}
|
||||
return result.Error
|
||||
}
|
||||
|
||||
func UnBlockUser(userId string) error {
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Where("uid=?", userId).Delete(&db.BlackList{}).Error
|
||||
func UnBlockUser(userID string) error {
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Where("uid=?", userID).Delete(&db.BlackList{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return db.DB.MysqlDB.DefaultGormDB().Table("users").Where("user_id=?", userId).Update("login_limit", 0).Error
|
||||
return db.DB.MysqlDB.DefaultGormDB().Table("users").Where("user_id=?", userID).Update("login_limit", 0).Error
|
||||
}
|
||||
|
||||
type BlockUserInfo struct {
|
||||
@@ -212,7 +204,7 @@ type BlockUserInfo struct {
|
||||
EndDisableTime time.Time
|
||||
}
|
||||
|
||||
func GetBlockUserById(userId string) (BlockUserInfo, error) {
|
||||
func GetBlockUserByID(userId string) (BlockUserInfo, error) {
|
||||
var blockUserInfo BlockUserInfo
|
||||
blockUser := db.BlackList{
|
||||
UserId: userId,
|
||||
@@ -267,13 +259,13 @@ func GetBlockUsers(showNumber, pageNumber int32) ([]BlockUserInfo, error) {
|
||||
|
||||
func GetUserByName(userName string, showNumber, pageNumber int32) ([]db.User, error) {
|
||||
var users []db.User
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("users").Where(fmt.Sprintf(" name like '%%%s%%' ", userName)).Limit(int(showNumber)).Offset(int(showNumber * (pageNumber - 1))).Find(&users).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("users").Where(" name like ?", fmt.Sprintf("%%%s%%", userName)).Limit(int(showNumber)).Offset(int(showNumber * (pageNumber - 1))).Find(&users).Error
|
||||
return users, err
|
||||
}
|
||||
|
||||
func GetUsersCount(user db.User) (int32, error) {
|
||||
func GetUsersCount(userName string) (int32, error) {
|
||||
var count int64
|
||||
if err := db.DB.MysqlDB.DefaultGormDB().Table("users").Where(fmt.Sprintf(" name like '%%%s%%' ", user.Nickname)).Count(&count).Error; err != nil {
|
||||
if err := db.DB.MysqlDB.DefaultGormDB().Table("users").Where(" name like ? ", fmt.Sprintf("%%%s%%", userName)).Count(&count).Error; err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int32(count), nil
|
||||
|
||||
@@ -75,7 +75,10 @@ func GetFriendIDListFromCache(userID string) ([]string, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(friendIDList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
friendIDListStr, err := db.DB.Rc.Fetch(friendRelationCache+userID, time.Second*30*60, getFriendIDList)
|
||||
if err != nil {
|
||||
@@ -98,7 +101,10 @@ func GetBlackListFromCache(userID string) ([]string, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(blackIDList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
blackIDListStr, err := db.DB.Rc.Fetch(blackListCache+userID, time.Second*30*60, getBlackIDList)
|
||||
if err != nil {
|
||||
@@ -120,7 +126,10 @@ func GetJoinedGroupIDListFromCache(userID string) ([]string, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(joinedGroupList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
joinedGroupIDListStr, err := db.DB.Rc.Fetch(joinedGroupListCache+userID, time.Second*30*60, getJoinedGroupIDList)
|
||||
if err != nil {
|
||||
@@ -155,7 +164,10 @@ func GetGroupMemberIDListFromCache(groupID string) ([]string, error) {
|
||||
}
|
||||
}
|
||||
bytes, err := json.Marshal(groupMemberIDList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, f)
|
||||
if err != nil {
|
||||
@@ -178,7 +190,10 @@ func GetUserInfoFromCache(userID string) (*db.User, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(userInfo)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
userInfoStr, err := db.DB.Rc.Fetch(userInfoCache+userID, time.Second*30*60, getUserInfo)
|
||||
if err != nil {
|
||||
@@ -200,7 +215,10 @@ func GetGroupMemberInfoFromCache(groupID, userID string) (*db.GroupMember, error
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(groupMemberInfo)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
groupMemberInfoStr, err := db.DB.Rc.Fetch(groupMemberInfoCache+groupID+"-"+userID, time.Second*30*60, getGroupMemberInfo)
|
||||
if err != nil {
|
||||
@@ -266,7 +284,10 @@ func GetAllGroupMembersInfoFromCache(groupID string) ([]*db.GroupMember, error)
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(groupMembers)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
groupMembersStr, err := db.DB.Rc.Fetch(groupAllMemberInfoCache+groupID, time.Second*30*60, getGroupMemberInfo)
|
||||
if err != nil {
|
||||
@@ -288,7 +309,10 @@ func GetGroupInfoFromCache(groupID string) (*db.Group, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(groupInfo)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
groupInfoStr, err := db.DB.Rc.Fetch(groupInfoCache+groupID, time.Second*30*60, getGroupInfo)
|
||||
if err != nil {
|
||||
@@ -310,7 +334,10 @@ func GetAllFriendsInfoFromCache(userID string) ([]*db.Friend, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(friendInfoList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
allFriendInfoStr, err := db.DB.Rc.Fetch(allFriendInfoCache+userID, time.Second*30*60, getAllFriendInfo)
|
||||
if err != nil {
|
||||
@@ -332,7 +359,10 @@ func GetAllDepartmentsFromCache() ([]db.Department, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(departmentList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
allDepartmentsStr, err := db.DB.Rc.Fetch(allDepartmentCache, time.Second*30*60, getAllDepartments)
|
||||
if err != nil {
|
||||
@@ -354,7 +384,10 @@ func GetAllDepartmentMembersFromCache() ([]db.DepartmentMember, error) {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
bytes, err := json.Marshal(departmentMembers)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
allDepartmentMembersStr, err := db.DB.Rc.Fetch(allDepartmentMemberCache, time.Second*30*60, getAllDepartmentMembers)
|
||||
if err != nil {
|
||||
@@ -379,7 +412,10 @@ func GetJoinedSuperGroupListFromCache(userID string) ([]string, error) {
|
||||
return "", errors.New("GroupIDList == 0")
|
||||
}
|
||||
bytes, err := json.Marshal(userToSuperGroup.GroupIDList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
joinedSuperGroupListStr, err := db.DB.Rc.Fetch(joinedSuperGroupListCache+userID, time.Second*30*60, getJoinedSuperGroupIDList)
|
||||
if err != nil {
|
||||
@@ -445,7 +481,10 @@ func GetUserConversationIDListFromCache(userID string) ([]string, error) {
|
||||
}
|
||||
log.NewDebug("", utils.GetSelfFuncName(), conversationIDList)
|
||||
bytes, err := json.Marshal(conversationIDList)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
return string(bytes), nil
|
||||
}
|
||||
conversationIDListStr, err := db.DB.Rc.Fetch(conversationIDListCache+userID, time.Second*30*60, getConversationIDList)
|
||||
var conversationIDList []string
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"fmt"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
//"Open_IM/pkg/cms_api_struct"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type BaseResp struct {
|
||||
Code int32 `json:"code"`
|
||||
ErrMsg string `json:"err_msg"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
func RespHttp200(ctx *gin.Context, err error, data interface{}) {
|
||||
var resp BaseResp
|
||||
switch e := err.(type) {
|
||||
case constant.ErrInfo:
|
||||
resp.Code = e.ErrCode
|
||||
resp.ErrMsg = e.ErrMsg
|
||||
default:
|
||||
s, ok := status.FromError(err)
|
||||
if !ok {
|
||||
fmt.Println("need grpc format error")
|
||||
return
|
||||
}
|
||||
resp.Code = int32(s.Code())
|
||||
resp.ErrMsg = s.Message()
|
||||
}
|
||||
resp.Data = data
|
||||
ctx.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
// warp error
|
||||
func WrapError(err constant.ErrInfo) error {
|
||||
return status.Error(codes.Code(err.ErrCode), err.ErrMsg)
|
||||
}
|
||||
@@ -42,7 +42,7 @@ func loggerInit(moduleName string) *Logger {
|
||||
}
|
||||
writer := bufio.NewWriter(src)
|
||||
logger.SetOutput(writer)
|
||||
//logger.SetOutput(os.Stdout)
|
||||
// logger.SetOutput(os.Stdout)
|
||||
//Log Console Print Style Setting
|
||||
logger.SetFormatter(&nested.Formatter{
|
||||
TimestampFormat: "2006-01-02 15:04:05.000",
|
||||
|
||||
+3119
-56
File diff suppressed because it is too large
Load Diff
@@ -3,15 +3,22 @@ option go_package = "./admin_cms;admin_cms";
|
||||
import "Open_IM/pkg/proto/sdk_ws/ws.proto";
|
||||
package admin_cms;
|
||||
|
||||
message AdminLoginReq {
|
||||
string OperationID = 1;
|
||||
string AdminID = 2;
|
||||
string Secret = 3;
|
||||
|
||||
message CommonResp {
|
||||
int32 errCode = 1;
|
||||
string errMsg = 2;
|
||||
}
|
||||
|
||||
message AdminLoginReq {
|
||||
string operationID = 1;
|
||||
string adminID = 2;
|
||||
string secret = 3;
|
||||
}
|
||||
|
||||
|
||||
message AdminLoginResp {
|
||||
string token = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message AddUserRegisterAddFriendIDListReq {
|
||||
@@ -20,7 +27,7 @@ message AddUserRegisterAddFriendIDListReq {
|
||||
}
|
||||
|
||||
message AddUserRegisterAddFriendIDListResp {
|
||||
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message ReduceUserRegisterAddFriendIDListReq {
|
||||
@@ -30,17 +37,278 @@ message ReduceUserRegisterAddFriendIDListReq {
|
||||
}
|
||||
|
||||
message ReduceUserRegisterAddFriendIDListResp {
|
||||
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetUserRegisterAddFriendIDListReq {
|
||||
string operationID = 1;
|
||||
server_api_params.RequestPagination Pagination = 2;
|
||||
server_api_params.RequestPagination pagination = 2;
|
||||
}
|
||||
|
||||
message GetUserRegisterAddFriendIDListResp {
|
||||
repeated server_api_params.UserInfo UserInfoList = 1;
|
||||
repeated server_api_params.UserInfo userInfoList = 1;
|
||||
server_api_params.ResponsePagination pagination = 2;
|
||||
CommonResp commonResp = 3;
|
||||
}
|
||||
|
||||
message GetChatLogsReq {
|
||||
string content = 1;
|
||||
string sendID = 2;
|
||||
string recvID = 3;
|
||||
string sendTime = 4;
|
||||
int32 sessionType = 5;
|
||||
int32 contentType = 6;
|
||||
server_api_params.RequestPagination pagination = 7;
|
||||
string operationID = 8;
|
||||
|
||||
}
|
||||
|
||||
message ChatLog {
|
||||
string serverMsgID = 1;
|
||||
string clientMsgID = 2;
|
||||
string sendID = 3;
|
||||
string recvID = 4;
|
||||
string groupID = 5;
|
||||
string recvNickname = 6;
|
||||
int32 senderPlatformID = 7;
|
||||
string senderNickname = 8;
|
||||
string senderFaceURL = 9;
|
||||
string groupName = 10;
|
||||
int32 sessionType = 11;
|
||||
int32 msgFrom = 12;
|
||||
int32 contentType = 13;
|
||||
string content = 14;
|
||||
int32 status = 15;
|
||||
int64 sendTime = 16;
|
||||
int64 createTime = 17;
|
||||
string ex = 18;
|
||||
}
|
||||
|
||||
message GetChatLogsResp {
|
||||
repeated ChatLog chatLogs = 1;
|
||||
server_api_params.ResponsePagination pagination = 2;
|
||||
int32 chatLogsNum = 3;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
|
||||
message StatisticsReq {
|
||||
string from = 1;
|
||||
string to = 2;
|
||||
}
|
||||
|
||||
message GetActiveUserReq{
|
||||
StatisticsReq statisticsReq = 1;
|
||||
string operationID = 2;
|
||||
}
|
||||
|
||||
message UserResp{
|
||||
string nickName = 1;
|
||||
string userID = 2;
|
||||
int32 messageNum = 3;
|
||||
}
|
||||
|
||||
message GetActiveUserResp {
|
||||
repeated UserResp Users = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message GetActiveGroupReq{
|
||||
StatisticsReq statisticsReq = 1;
|
||||
string operationID = 2;
|
||||
}
|
||||
|
||||
message GroupResp {
|
||||
string GroupName = 1;
|
||||
string GroupId = 2;
|
||||
int32 MessageNum = 3;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
message GetActiveGroupResp {
|
||||
repeated GroupResp Groups = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message DateNumList {
|
||||
string Date = 1;
|
||||
int32 Num = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetMessageStatisticsReq {
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetMessageStatisticsResp {
|
||||
int32 PrivateMessageNum = 1;
|
||||
int32 GroupMessageNum = 2;
|
||||
repeated DateNumList PrivateMessageNumList = 3;
|
||||
repeated DateNumList GroupMessageNumList = 4;
|
||||
CommonResp commonResp = 5;
|
||||
}
|
||||
|
||||
message GetGroupStatisticsReq {
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetGroupStatisticsResp {
|
||||
int32 IncreaseGroupNum = 1;
|
||||
int32 TotalGroupNum = 2;
|
||||
repeated DateNumList IncreaseGroupNumList = 3;
|
||||
repeated DateNumList TotalGroupNumList = 4;
|
||||
CommonResp commonResp = 5;
|
||||
}
|
||||
|
||||
message GetUserStatisticsReq {
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message GetUserStatisticsResp {
|
||||
int32 IncreaseUserNum = 1;
|
||||
int32 ActiveUserNum = 2;
|
||||
int32 TotalUserNum = 3;
|
||||
repeated DateNumList IncreaseUserNumList = 4;
|
||||
repeated DateNumList ActiveUserNumList = 5;
|
||||
repeated DateNumList TotalUserNumList = 6;
|
||||
CommonResp commonResp = 7;
|
||||
}
|
||||
|
||||
message GenerateInvitationCodeReq {
|
||||
string operationID = 1;
|
||||
int32 codeLen = 2;
|
||||
int32 codeNum = 3;
|
||||
}
|
||||
|
||||
message GenerateInvitationCodeResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetInvitationCodesReq {
|
||||
string operationID = 1;
|
||||
string code = 2;
|
||||
int32 status = 3;
|
||||
server_api_params.RequestPagination pagination = 4;
|
||||
}
|
||||
|
||||
message invitationCode {
|
||||
string invitationCode = 1;
|
||||
int32 createTime = 2;
|
||||
int32 lastTime = 3;
|
||||
string userID = 4;
|
||||
int32 status = 5;
|
||||
}
|
||||
|
||||
message GetInvitationCodesResp {
|
||||
repeated invitationCode invitationCodes = 1;
|
||||
server_api_params.ResponsePagination Pagination = 2;
|
||||
CommonResp commonResp = 3;
|
||||
}
|
||||
|
||||
message QueryIPRegisterReq {
|
||||
string operationID = 1;
|
||||
string IP = 2;
|
||||
}
|
||||
|
||||
message QueryIPRegisterResp {
|
||||
string IP = 1;
|
||||
int32 RegisterNum = 2;
|
||||
int32 Status = 3;
|
||||
repeated string userIDList = 4;
|
||||
CommonResp commonResp = 5;
|
||||
}
|
||||
|
||||
message AddIPLimitReq {
|
||||
string operationID = 1;
|
||||
string IP = 2;
|
||||
int32 limitTime = 3;
|
||||
}
|
||||
|
||||
message AddIPLimitResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message RemoveIPLimitReq {
|
||||
string operationID = 1;
|
||||
string IP = 2;
|
||||
}
|
||||
|
||||
message RemoveIPLimitResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message QueryUserIDIPLimitLoginReq {
|
||||
string operationID = 1;
|
||||
string userID = 2;
|
||||
}
|
||||
|
||||
message UserIPLimit {
|
||||
string userID = 1;
|
||||
string IP = 2;
|
||||
int32 createTime = 3;
|
||||
}
|
||||
|
||||
message QueryUserIDIPLimitLoginResp {
|
||||
repeated UserIPLimit UserIPLimits = 1;
|
||||
CommonResp commonResp = 2;
|
||||
}
|
||||
|
||||
message AddUserIPLimitLoginReq {
|
||||
string userID = 1;
|
||||
string operationID = 2;
|
||||
string IP = 3;
|
||||
}
|
||||
|
||||
message AddUserIPLimitLoginResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message RemoveUserIPLimitReq {
|
||||
string userID = 1;
|
||||
string operationID = 2;
|
||||
string IP = 3;
|
||||
}
|
||||
|
||||
message RemoveUserIPLimitResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetClientInitConfigReq {
|
||||
string operationID = 1;
|
||||
}
|
||||
|
||||
message GetClientInitConfigResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message SetClientInitConfigReq {
|
||||
string operationID = 1;
|
||||
string discoverPageURL = 2;
|
||||
}
|
||||
|
||||
message SetClientInitConfigResp {
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetUserFriendsReq {
|
||||
string operationID = 1;
|
||||
string userID = 2;
|
||||
string friendUserID = 3;
|
||||
string friendUserName = 4;
|
||||
server_api_params.RequestPagination pagination = 5;
|
||||
}
|
||||
|
||||
|
||||
message GetUserFriendsResp {
|
||||
server_api_params.ResponsePagination pagination = 1;
|
||||
repeated server_api_params.FriendInfo friendInfoList = 2;
|
||||
int32 friendNums = 3;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
service adminCMS {
|
||||
@@ -48,4 +316,28 @@ service adminCMS {
|
||||
rpc AddUserRegisterAddFriendIDList(AddUserRegisterAddFriendIDListReq) returns(AddUserRegisterAddFriendIDListResp);
|
||||
rpc ReduceUserRegisterAddFriendIDList(ReduceUserRegisterAddFriendIDListReq) returns(ReduceUserRegisterAddFriendIDListResp);
|
||||
rpc GetUserRegisterAddFriendIDList(GetUserRegisterAddFriendIDListReq) returns(GetUserRegisterAddFriendIDListResp);
|
||||
}
|
||||
|
||||
|
||||
rpc GetChatLogs(GetChatLogsReq) returns(GetChatLogsResp);
|
||||
|
||||
rpc GetActiveUser(GetActiveUserReq) returns(GetActiveUserResp);
|
||||
rpc GetActiveGroup(GetActiveGroupReq) returns(GetActiveGroupResp);
|
||||
rpc GetMessageStatistics(GetMessageStatisticsReq) returns(GetMessageStatisticsResp);
|
||||
rpc GetGroupStatistics(GetGroupStatisticsReq) returns(GetGroupStatisticsResp);
|
||||
rpc GetUserStatistics(GetUserStatisticsReq) returns(GetUserStatisticsResp);
|
||||
|
||||
rpc GenerateInvitationCode(GenerateInvitationCodeReq) returns(GenerateInvitationCodeResp);
|
||||
rpc GetInvitationCodes(GetInvitationCodesReq) returns(GetInvitationCodesResp);
|
||||
|
||||
rpc QueryIPRegister(QueryIPRegisterReq) returns(QueryIPRegisterResp);
|
||||
rpc AddIPLimit(AddIPLimitReq) returns(AddIPLimitResp);
|
||||
rpc RemoveIPLimit(RemoveIPLimitReq) returns(RemoveIPLimitResp);
|
||||
rpc QueryUserIDIPLimitLogin(QueryUserIDIPLimitLoginReq) returns(QueryUserIDIPLimitLoginResp);
|
||||
rpc AddUserIPLimitLogin(AddUserIPLimitLoginReq) returns(AddUserIPLimitLoginResp);
|
||||
rpc RemoveUserIPLimit(RemoveUserIPLimitReq) returns(RemoveUserIPLimitResp);
|
||||
|
||||
rpc GetClientInitConfig(GetClientInitConfigReq) returns(GetClientInitConfigResp);
|
||||
rpc SetClientInitConfig(SetClientInitConfigReq) returns(SetClientInitConfigResp);
|
||||
|
||||
rpc GetUserFriends(GetUserFriendsReq) returns(GetUserFriendsResp);
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package base;
|
||||
|
||||
|
||||
|
||||
+234
-891
File diff suppressed because it is too large
Load Diff
@@ -219,27 +219,19 @@ message CMSGroup {
|
||||
string GroupOwnerUserID = 3;
|
||||
}
|
||||
|
||||
message GetGroupReq {
|
||||
string GroupName = 1;
|
||||
server_api_params.RequestPagination Pagination = 2;
|
||||
string OperationID = 3;
|
||||
}
|
||||
|
||||
message GetGroupResp {
|
||||
repeated CMSGroup CMSGroups = 1;
|
||||
server_api_params.RequestPagination Pagination = 2;
|
||||
int32 GroupNums = 3;
|
||||
}
|
||||
|
||||
message GetGroupsReq {
|
||||
server_api_params.RequestPagination Pagination = 1;
|
||||
string OperationID = 2;
|
||||
string GroupName = 2;
|
||||
string GroupID = 3;
|
||||
string OperationID = 4;
|
||||
}
|
||||
|
||||
message GetGroupsResp {
|
||||
repeated CMSGroup CMSGroups = 1;
|
||||
server_api_params.RequestPagination Pagination = 2;
|
||||
server_api_params.ResponsePagination Pagination = 2;
|
||||
int32 GroupNum = 3;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
message GetGroupMemberReq {
|
||||
@@ -247,26 +239,6 @@ message GetGroupMemberReq {
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message OperateUserRoleReq {
|
||||
string GroupID = 1;
|
||||
string UserID = 2;
|
||||
int32 RoleLevel = 3;
|
||||
string OperationID = 4;
|
||||
}
|
||||
|
||||
message OperateUserRoleResp {
|
||||
|
||||
}
|
||||
|
||||
message GetGroupByIDReq {
|
||||
string GroupID = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message GetGroupByIDResp {
|
||||
CMSGroup CMSGroup = 1;
|
||||
}
|
||||
|
||||
message GetGroupMembersCMSReq {
|
||||
string GroupID = 1;
|
||||
string UserName = 2;
|
||||
@@ -278,30 +250,7 @@ message GetGroupMembersCMSResp {
|
||||
repeated server_api_params.GroupMemberFullInfo members = 1;
|
||||
server_api_params.ResponsePagination Pagination = 2;
|
||||
int32 MemberNums = 3;
|
||||
}
|
||||
|
||||
message RemoveGroupMembersCMSReq {
|
||||
string GroupID = 1;
|
||||
repeated string UserIDList = 2;
|
||||
string OperationID = 3;
|
||||
string OpUserID = 4;
|
||||
}
|
||||
|
||||
message RemoveGroupMembersCMSResp {
|
||||
repeated string success = 1;
|
||||
repeated string failed = 2;
|
||||
}
|
||||
|
||||
message AddGroupMembersCMSReq {
|
||||
string GroupID = 1;
|
||||
repeated string UserIDList = 2;
|
||||
string OperationID = 3;
|
||||
string OpUserID = 4;
|
||||
}
|
||||
|
||||
message AddGroupMembersCMSResp {
|
||||
repeated string success = 1;
|
||||
repeated string failed = 2;
|
||||
CommonResp commonResp = 4;
|
||||
}
|
||||
|
||||
message DismissGroupReq{
|
||||
@@ -444,13 +393,9 @@ service group{
|
||||
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
|
||||
rpc getGroupAllMember(GetGroupAllMemberReq) returns(GetGroupAllMemberResp);
|
||||
|
||||
rpc GetGroupByID(GetGroupByIDReq) returns(GetGroupByIDResp);
|
||||
rpc GetGroup(GetGroupReq) returns(GetGroupResp);
|
||||
rpc GetGroups(GetGroupsReq) returns(GetGroupsResp);
|
||||
rpc OperateUserRole(OperateUserRoleReq) returns(OperateUserRoleResp);
|
||||
rpc GetGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp);
|
||||
rpc RemoveGroupMembersCMS(RemoveGroupMembersCMSReq) returns(RemoveGroupMembersCMSResp);
|
||||
rpc AddGroupMembersCMS(AddGroupMembersCMSReq) returns(AddGroupMembersCMSResp);
|
||||
|
||||
|
||||
rpc DismissGroup(DismissGroupReq) returns(DismissGroupResp);
|
||||
rpc MuteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp);
|
||||
@@ -459,7 +404,6 @@ service group{
|
||||
rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp);
|
||||
|
||||
rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp);
|
||||
|
||||
rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
|
||||
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
|
||||
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,71 +0,0 @@
|
||||
syntax = "proto3";
|
||||
import "Open_IM/pkg/proto/sdk_ws/ws.proto";
|
||||
option go_package = "./message_cms;message_cms";
|
||||
package message_cms;
|
||||
|
||||
message BoradcastMessageReq {
|
||||
string Message = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message BoradcastMessageResp {
|
||||
|
||||
}
|
||||
|
||||
message MassSendMessageReq {
|
||||
string Message = 1;
|
||||
repeated string UserIds = 2;
|
||||
string OperationID = 3;
|
||||
}
|
||||
|
||||
message MassSendMessageResp {
|
||||
|
||||
}
|
||||
|
||||
message GetChatLogsReq {
|
||||
string Content = 1;
|
||||
string UserId = 2;
|
||||
string GroupId = 3;
|
||||
string Date = 4;
|
||||
int32 SessionType = 5;
|
||||
int32 ContentType = 6;
|
||||
server_api_params.RequestPagination Pagination = 7;
|
||||
string OperationID = 8;
|
||||
|
||||
}
|
||||
|
||||
message ChatLogs {
|
||||
int32 SessionType = 1;
|
||||
int32 ContentType = 2;
|
||||
string SenderNickName = 3;
|
||||
string SenderId = 4;
|
||||
string ReciverNickName = 5;
|
||||
string ReciverId = 6;
|
||||
string SearchContent = 7;
|
||||
string WholeContent = 8;
|
||||
string GroupId = 9;
|
||||
string GroupName = 10;
|
||||
string Date = 11;
|
||||
}
|
||||
|
||||
message GetChatLogsResp {
|
||||
repeated ChatLogs ChatLogs = 1;
|
||||
server_api_params.ResponsePagination Pagination = 2;
|
||||
int32 ChatLogsNum = 3;
|
||||
}
|
||||
|
||||
message WithdrawMessageReq {
|
||||
string ServerMsgId = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message WithdrawMessageResp {
|
||||
|
||||
}
|
||||
|
||||
service messageCMS {
|
||||
rpc BoradcastMessage(BoradcastMessageReq) returns(BoradcastMessageResp);
|
||||
rpc MassSendMessage(MassSendMessageReq) returns(MassSendMessageResp);
|
||||
rpc GetChatLogs(GetChatLogsReq) returns(GetChatLogsResp);
|
||||
rpc WithdrawMessage(WithdrawMessageReq) returns(WithdrawMessageResp);
|
||||
}
|
||||
+310
-363
File diff suppressed because it is too large
Load Diff
@@ -72,15 +72,9 @@ message UserInfo{
|
||||
uint32 birth = 6;
|
||||
string email = 7;
|
||||
string ex = 8;
|
||||
string createIp = 9;
|
||||
uint32 createTime = 10;
|
||||
string LastLoginIp =11;
|
||||
uint32 LastLoginTime = 12;
|
||||
int32 LoginTimes = 13;
|
||||
int32 LoginLimit = 14;
|
||||
int32 appMangerLevel = 15;
|
||||
int32 globalRecvMsgOpt = 16;
|
||||
string invitationCode = 17;
|
||||
uint32 createTime = 9;
|
||||
int32 appMangerLevel = 10;
|
||||
int32 globalRecvMsgOpt = 11;
|
||||
}
|
||||
|
||||
message FriendInfo{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,93 +0,0 @@
|
||||
syntax = "proto3";
|
||||
// import "Open_IM/pkg/proto/sdk_ws/ws.proto";
|
||||
option go_package = "./statistics;statistics";
|
||||
package statistics;
|
||||
|
||||
message StatisticsReq {
|
||||
string from = 1;
|
||||
string to = 2;
|
||||
}
|
||||
|
||||
message GetActiveUserReq{
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message UserResp{
|
||||
string NickName = 1;
|
||||
string UserId = 2;
|
||||
int32 MessageNum = 3;
|
||||
}
|
||||
|
||||
message GetActiveUserResp {
|
||||
repeated UserResp Users = 1;
|
||||
}
|
||||
|
||||
message GetActiveGroupReq{
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message GroupResp {
|
||||
string GroupName = 1;
|
||||
string GroupId = 2;
|
||||
int32 MessageNum = 3;
|
||||
}
|
||||
|
||||
message GetActiveGroupResp {
|
||||
repeated GroupResp Groups = 1;
|
||||
}
|
||||
|
||||
message DateNumList {
|
||||
string Date = 1;
|
||||
int32 Num = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetMessageStatisticsReq {
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetMessageStatisticsResp {
|
||||
int32 PrivateMessageNum = 1;
|
||||
int32 GroupMessageNum = 2;
|
||||
repeated DateNumList PrivateMessageNumList = 3;
|
||||
repeated DateNumList GroupMessageNumList = 4;
|
||||
}
|
||||
|
||||
message GetGroupStatisticsReq {
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetGroupStatisticsResp {
|
||||
int32 IncreaseGroupNum = 1;
|
||||
int32 TotalGroupNum = 2;
|
||||
repeated DateNumList IncreaseGroupNumList = 3;
|
||||
repeated DateNumList TotalGroupNumList = 4;
|
||||
}
|
||||
|
||||
message GetUserStatisticsReq {
|
||||
StatisticsReq StatisticsReq = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message GetUserStatisticsResp {
|
||||
int32 IncreaseUserNum = 1;
|
||||
int32 ActiveUserNum = 2;
|
||||
int32 TotalUserNum = 3;
|
||||
repeated DateNumList IncreaseUserNumList = 4;
|
||||
repeated DateNumList ActiveUserNumList = 5;
|
||||
repeated DateNumList TotalUserNumList = 6;
|
||||
}
|
||||
|
||||
service user {
|
||||
rpc GetActiveUser(GetActiveUserReq) returns(GetActiveUserResp);
|
||||
rpc GetActiveGroup(GetActiveGroupReq) returns(GetActiveGroupResp);
|
||||
rpc GetMessageStatistics(GetMessageStatisticsReq) returns(GetMessageStatisticsResp);
|
||||
rpc GetGroupStatistics(GetGroupStatisticsReq) returns(GetGroupStatisticsResp);
|
||||
rpc GetUserStatistics(GetUserStatisticsReq) returns(GetUserStatisticsResp);
|
||||
}
|
||||
+239
-1359
File diff suppressed because it is too large
Load Diff
+30
-125
@@ -9,16 +9,6 @@ message CommonResp{
|
||||
string errMsg = 2;
|
||||
}
|
||||
|
||||
message DeleteUsersReq{
|
||||
repeated string DeleteUserIDList = 2;
|
||||
string OpUserID = 3;
|
||||
string OperationID = 4;
|
||||
}
|
||||
|
||||
message DeleteUsersResp{
|
||||
CommonResp CommonResp = 1;
|
||||
repeated string FailedUserIDList = 2;
|
||||
}
|
||||
|
||||
|
||||
message GetAllUserIDReq{
|
||||
@@ -143,94 +133,29 @@ message BatchSetConversationsResp{
|
||||
repeated string Failed = 3;
|
||||
}
|
||||
|
||||
message ResignUserReq{
|
||||
string UserId = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message ResignUserResp{
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message GetUserByIdReq{
|
||||
string UserId = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message User{
|
||||
string ProfilePhoto = 1;
|
||||
string Nickname = 2;
|
||||
string UserId = 3;
|
||||
string CreateTime = 4;
|
||||
string PhoneNumber = 5;
|
||||
string Email = 6;
|
||||
string Birth = 7;
|
||||
string CreateIp = 8;
|
||||
string LastLoginTime = 9;
|
||||
string LastLoginIp = 10;
|
||||
int32 LoginTimes = 11;
|
||||
int32 Gender = 12;
|
||||
int32 LoginLimit = 13;
|
||||
bool IsBlock = 14;
|
||||
string RegisterIp = 15;
|
||||
}
|
||||
|
||||
message GetUserByIdResp{
|
||||
CommonResp CommonResp = 1;
|
||||
User user = 2;
|
||||
}
|
||||
|
||||
message GetUsersByNameReq {
|
||||
string UserName = 1;
|
||||
server_api_params.RequestPagination Pagination = 2;
|
||||
string OperationID = 3;
|
||||
}
|
||||
|
||||
message GetUsersByNameResp {
|
||||
repeated User users = 1;
|
||||
server_api_params.ResponsePagination Pagination = 2;
|
||||
int32 UserNums = 3;
|
||||
}
|
||||
|
||||
message AlterUserReq{
|
||||
string UserId = 1;
|
||||
string OperationID = 2;
|
||||
string PhoneNumber = 3;
|
||||
string Nickname = 4;
|
||||
string Email = 5;
|
||||
string Gender = 6;
|
||||
string Birth =7;
|
||||
string Photo = 8;
|
||||
string OpUserId = 9;
|
||||
}
|
||||
|
||||
message AlterUserResp{
|
||||
CommonResp CommonResp = 1;
|
||||
}
|
||||
|
||||
message GetUsersReq {
|
||||
string OperationID = 1;
|
||||
server_api_params.RequestPagination Pagination = 2;
|
||||
string UserName = 3;
|
||||
string operationID = 1;
|
||||
server_api_params.RequestPagination pagination = 2;
|
||||
string userName = 3;
|
||||
string userID = 4;
|
||||
}
|
||||
|
||||
message CmsUser {
|
||||
server_api_params.UserInfo user = 1;
|
||||
bool isBlock = 2;
|
||||
}
|
||||
|
||||
message GetUsersResp{
|
||||
CommonResp CommonResp = 1;
|
||||
repeated User user = 2;
|
||||
CommonResp commonResp = 1;
|
||||
repeated CmsUser userList = 2;
|
||||
server_api_params.ResponsePagination Pagination = 3;
|
||||
int32 UserNums = 4;
|
||||
int32 totalNums = 4;
|
||||
}
|
||||
|
||||
message AddUserReq{
|
||||
string OperationID = 1;
|
||||
string PhoneNumber = 2;
|
||||
string UserId = 3;
|
||||
string name = 4;
|
||||
string Email = 5;
|
||||
string Gender = 6;
|
||||
string Birth =7;
|
||||
string Photo = 8;
|
||||
string OpUserId = 9;
|
||||
server_api_params.UserInfo userInfo = 1;
|
||||
string operationID = 2;
|
||||
}
|
||||
|
||||
message AddUserResp{
|
||||
@@ -239,10 +164,10 @@ message AddUserResp{
|
||||
|
||||
|
||||
message BlockUserReq{
|
||||
string UserId = 1;
|
||||
string EndDisableTime = 2;
|
||||
string OperationID = 3;
|
||||
string OpUserId = 4;
|
||||
string userID = 1;
|
||||
string endDisableTime = 2;
|
||||
string operationID = 3;
|
||||
string opUserID = 4;
|
||||
}
|
||||
|
||||
message BlockUserResp{
|
||||
@@ -250,9 +175,9 @@ message BlockUserResp{
|
||||
}
|
||||
|
||||
message UnBlockUserReq{
|
||||
string UserId = 1;
|
||||
string OperationID = 2;
|
||||
string OpUserId = 3;
|
||||
string userID = 1;
|
||||
string operationID = 2;
|
||||
string opUserID = 3;
|
||||
}
|
||||
|
||||
message UnBlockUserResp{
|
||||
@@ -260,13 +185,14 @@ message UnBlockUserResp{
|
||||
}
|
||||
|
||||
message GetBlockUsersReq{
|
||||
server_api_params.RequestPagination Pagination = 1;
|
||||
string OperationID = 2;
|
||||
int32 BlockUserNum = 3;
|
||||
server_api_params.RequestPagination pagination = 1;
|
||||
string operationID = 2;
|
||||
string userID = 3;
|
||||
int32 totalBlockUserNum = 4;
|
||||
}
|
||||
|
||||
message BlockUser {
|
||||
User User = 1;
|
||||
server_api_params.UserInfo UserInfo = 1;
|
||||
string BeginDisableTime = 2;
|
||||
string EndDisableTime = 3;
|
||||
}
|
||||
@@ -278,24 +204,6 @@ message GetBlockUsersResp{
|
||||
int32 UserNums = 4;
|
||||
}
|
||||
|
||||
message GetBlockUserByIdReq {
|
||||
string User_id = 1;
|
||||
string OperationID = 2;
|
||||
}
|
||||
|
||||
message GetBlockUserByIdResp {
|
||||
BlockUser BlockUser = 2;
|
||||
}
|
||||
|
||||
message DeleteUserReq {
|
||||
string User_id = 1;
|
||||
string OperationID = 2;
|
||||
string OpUserId = 3;
|
||||
}
|
||||
|
||||
message DeleteUserResp {
|
||||
CommonResp CommonResp = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -303,7 +211,6 @@ service user {
|
||||
rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp);
|
||||
rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp);
|
||||
rpc SetGlobalRecvMessageOpt(SetGlobalRecvMessageOptReq) returns(SetGlobalRecvMessageOptResp);
|
||||
rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp);
|
||||
rpc GetAllUserID(GetAllUserIDReq)returns(GetAllUserIDResp);
|
||||
|
||||
rpc AccountCheck(AccountCheckReq)returns(AccountCheckResp);
|
||||
@@ -314,15 +221,13 @@ service user {
|
||||
rpc SetConversation(SetConversationReq)returns(SetConversationResp);
|
||||
rpc SetRecvMsgOpt(SetRecvMsgOptReq)returns(SetRecvMsgOptResp);
|
||||
|
||||
rpc GetUserById(GetUserByIdReq) returns (GetUserByIdResp);
|
||||
rpc GetUsersByName(GetUsersByNameReq) returns (GetUsersByNameResp);
|
||||
rpc ResignUser(ResignUserReq) returns (ResignUserResp);
|
||||
rpc AlterUser(AlterUserReq) returns (AlterUserResp);
|
||||
|
||||
rpc GetUsers(GetUsersReq) returns (GetUsersResp);
|
||||
|
||||
rpc AddUser(AddUserReq) returns (AddUserResp);
|
||||
|
||||
rpc BlockUser(BlockUserReq) returns (BlockUserResp);
|
||||
rpc UnBlockUser(UnBlockUserReq) returns (UnBlockUserResp);
|
||||
rpc GetBlockUsers(GetBlockUsersReq) returns (GetBlockUsersResp);
|
||||
rpc GetBlockUserById(GetBlockUserByIdReq) returns (GetBlockUserByIdResp);
|
||||
rpc DeleteUser(DeleteUserReq) returns (DeleteUserResp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user