复制项目
This commit is contained in:
28
pkg/apistruct/config_manager.go
Normal file
28
pkg/apistruct/config_manager.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package apistruct
|
||||
|
||||
type GetConfigReq struct {
|
||||
ConfigName string `json:"configName"`
|
||||
}
|
||||
|
||||
type GetConfigListResp struct {
|
||||
Environment string `json:"environment"`
|
||||
Version string `json:"version"`
|
||||
ConfigNames []string `json:"configNames"`
|
||||
}
|
||||
|
||||
type SetConfigReq struct {
|
||||
ConfigName string `json:"configName"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type SetConfigsReq struct {
|
||||
Configs []SetConfigReq `json:"configs"`
|
||||
}
|
||||
|
||||
type SetEnableConfigManagerReq struct {
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
|
||||
type GetEnableConfigManagerResp struct {
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
15
pkg/apistruct/doc.go
Normal file
15
pkg/apistruct/doc.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright © 2024 OpenIM. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package apistruct // import "git.imall.cloud/openim/open-im-server-deploy/pkg/apistruct"
|
||||
584
pkg/apistruct/manage.go
Normal file
584
pkg/apistruct/manage.go
Normal file
@@ -0,0 +1,584 @@
|
||||
// Copyright © 2023 OpenIM. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package apistruct
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
pbmsg "git.imall.cloud/openim/protocol/msg"
|
||||
"git.imall.cloud/openim/protocol/sdkws"
|
||||
)
|
||||
|
||||
// SendMsg defines the structure for sending messages with various metadata.
|
||||
type SendMsg struct {
|
||||
// SendID uniquely identifies the sender.
|
||||
SendID string `json:"sendID" binding:"required"`
|
||||
|
||||
// GroupID is the identifier for the group, required if SessionType is 2 or 3.
|
||||
GroupID string `json:"groupID" binding:"required_if=SessionType 2|required_if=SessionType 3"`
|
||||
|
||||
// SenderNickname is the nickname of the sender.
|
||||
SenderNickname string `json:"senderNickname"`
|
||||
|
||||
// SenderFaceURL is the URL to the sender's avatar.
|
||||
SenderFaceURL string `json:"senderFaceURL"`
|
||||
|
||||
// SenderPlatformID is an integer identifier for the sender's platform.
|
||||
SenderPlatformID int32 `json:"senderPlatformID"`
|
||||
|
||||
// Content is the actual content of the message, required and excluded from Swagger documentation.
|
||||
Content map[string]any `json:"content" binding:"required" swaggerignore:"true"`
|
||||
|
||||
// ContentType is an integer that represents the type of the content.
|
||||
ContentType int32 `json:"contentType" binding:"required"`
|
||||
|
||||
// SessionType is an integer that represents the type of session for the message.
|
||||
SessionType int32 `json:"sessionType" binding:"required"`
|
||||
|
||||
// IsOnlineOnly specifies if the message is only sent when the receiver is online.
|
||||
IsOnlineOnly bool `json:"isOnlineOnly"`
|
||||
|
||||
// NotOfflinePush specifies if the message should not trigger offline push notifications.
|
||||
NotOfflinePush bool `json:"notOfflinePush"`
|
||||
|
||||
// SendTime is a timestamp indicating when the message was sent.
|
||||
SendTime int64 `json:"sendTime"`
|
||||
|
||||
// OfflinePushInfo contains information for offline push notifications.
|
||||
OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
|
||||
// Ex stores extended fields
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
// SendMsgReq extends SendMsg with the requirement of RecvID when SessionType indicates a one-on-one or notification chat.
|
||||
type SendMsgReq struct {
|
||||
// RecvID uniquely identifies the receiver and is required for one-on-one or notification chat types.
|
||||
RecvID string `json:"recvID" binding:"required_if" message:"recvID is required if sessionType is SingleChatType or NotificationChatType"`
|
||||
SendMsg
|
||||
}
|
||||
|
||||
type GetConversationListReq struct {
|
||||
// userID uniquely identifies the user.
|
||||
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty" binding:"required"`
|
||||
|
||||
// ConversationIDs contains a list of unique identifiers for conversations.
|
||||
ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs,omitempty"`
|
||||
}
|
||||
|
||||
type GetConversationListResp struct {
|
||||
// ConversationElems is a map that associates conversation IDs with their respective details.
|
||||
ConversationElems map[string]*ConversationElem `protobuf:"bytes,1,rep,name=conversationElems,proto3" json:"conversationElems,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
type ConversationElem struct {
|
||||
// MaxSeq represents the maximum sequence number within the conversation.
|
||||
MaxSeq int64 `protobuf:"varint,1,opt,name=maxSeq,proto3" json:"maxSeq,omitempty"`
|
||||
|
||||
// UnreadSeq represents the number of unread messages in the conversation.
|
||||
UnreadSeq int64 `protobuf:"varint,2,opt,name=unreadSeq,proto3" json:"unreadSeq,omitempty"`
|
||||
|
||||
// LastSeqTime represents the timestamp of the last sequence in the conversation.
|
||||
LastSeqTime int64 `protobuf:"varint,3,opt,name=LastSeqTime,proto3" json:"LastSeqTime,omitempty"`
|
||||
}
|
||||
|
||||
// BatchSendMsgReq defines the structure for sending a message to multiple recipients.
|
||||
type BatchSendMsgReq struct {
|
||||
SendMsg
|
||||
|
||||
// IsSendAll indicates whether the message should be sent to all users.
|
||||
IsSendAll bool `json:"isSendAll"`
|
||||
|
||||
// RecvIDs is a slice of receiver identifiers to whom the message will be sent, required field.
|
||||
RecvIDs []string `json:"recvIDs" binding:"required"`
|
||||
}
|
||||
|
||||
// BatchSendMsgResp contains the results of a batch message send operation.
|
||||
type BatchSendMsgResp struct {
|
||||
// Results is a slice of SingleReturnResult, representing the outcome of each message sent.
|
||||
Results []*SingleReturnResult `json:"results"`
|
||||
|
||||
// FailedIDs is a slice of user IDs for whom the message send failed.
|
||||
FailedIDs []string `json:"failedUserIDs"`
|
||||
}
|
||||
|
||||
// SendRedPacketReq 发送红包请求
|
||||
type SendRedPacketReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"` // 群ID
|
||||
RedPacketType int32 `json:"redPacketType" binding:"required"` // 红包类型:1-普通红包,2-拼手气红包
|
||||
TotalAmount int64 `json:"totalAmount" binding:"required"` // 总金额(分)
|
||||
TotalCount int32 `json:"totalCount" binding:"required"` // 总个数
|
||||
Blessing string `json:"blessing"` // 祝福语
|
||||
}
|
||||
|
||||
// SendRedPacketResp 发送红包响应
|
||||
type SendRedPacketResp struct {
|
||||
RedPacketID string `json:"redPacketID"` // 红包ID
|
||||
ServerMsgID string `json:"serverMsgID"` // 消息ID
|
||||
ClientMsgID string `json:"clientMsgID"` // 客户端消息ID
|
||||
SendTime int64 `json:"sendTime"` // 发送时间
|
||||
}
|
||||
|
||||
// ReceiveRedPacketReq 领取红包请求
|
||||
type ReceiveRedPacketReq struct {
|
||||
RedPacketID string `json:"redPacketID" binding:"required"` // 红包ID
|
||||
}
|
||||
|
||||
// ReceiveRedPacketResp 领取红包响应
|
||||
type ReceiveRedPacketResp struct {
|
||||
RedPacketID string `json:"redPacketID"` // 红包ID
|
||||
Amount int64 `json:"amount"` // 领取金额(分)
|
||||
IsLucky bool `json:"isLucky"` // 是否为手气最佳(仅拼手气红包有效)
|
||||
}
|
||||
|
||||
// GetRedPacketsByGroupReq 根据群ID查询红包列表请求(群ID为选填,不填则查询所有红包)
|
||||
type GetRedPacketsByGroupReq struct {
|
||||
GroupID string `json:"groupID"` // 群ID(选填,不填则查询所有红包)
|
||||
Pagination Pagination `json:"pagination"` // 分页参数
|
||||
}
|
||||
|
||||
// Pagination 分页参数
|
||||
type Pagination struct {
|
||||
PageNumber int32 `json:"pageNumber"` // 页码,从1开始
|
||||
ShowNumber int32 `json:"showNumber"` // 每页数量
|
||||
}
|
||||
|
||||
// GetRedPacketsByGroupResp 根据群ID查询红包列表响应
|
||||
type GetRedPacketsByGroupResp struct {
|
||||
Total int64 `json:"total"` // 总数
|
||||
RedPackets []*RedPacketInfo `json:"redPackets"` // 红包列表
|
||||
}
|
||||
|
||||
// RedPacketInfo 红包信息
|
||||
type RedPacketInfo struct {
|
||||
RedPacketID string `json:"redPacketID"` // 红包ID
|
||||
SendUserID string `json:"sendUserID"` // 发送者ID
|
||||
GroupID string `json:"groupID"` // 群ID
|
||||
GroupName string `json:"groupName"` // 群名称
|
||||
RedPacketType int32 `json:"redPacketType"` // 红包类型:1-普通红包,2-拼手气红包
|
||||
TotalAmount int64 `json:"totalAmount"` // 总金额(分)
|
||||
TotalCount int32 `json:"totalCount"` // 总个数
|
||||
RemainAmount int64 `json:"remainAmount"` // 剩余金额(分)
|
||||
RemainCount int32 `json:"remainCount"` // 剩余个数
|
||||
Blessing string `json:"blessing"` // 祝福语
|
||||
Status int32 `json:"status"` // 状态:0-进行中,1-已领完,2-已过期
|
||||
ExpireTime int64 `json:"expireTime"` // 过期时间戳(毫秒)
|
||||
CreateTime int64 `json:"createTime"` // 创建时间戳(毫秒)
|
||||
}
|
||||
|
||||
// GetRedPacketReceiveInfoReq 查询红包领取情况请求
|
||||
type GetRedPacketReceiveInfoReq struct {
|
||||
RedPacketID string `json:"redPacketID" binding:"required"` // 红包ID
|
||||
}
|
||||
|
||||
// GetRedPacketReceiveInfoResp 查询红包领取情况响应
|
||||
type GetRedPacketReceiveInfoResp struct {
|
||||
RedPacketID string `json:"redPacketID"` // 红包ID
|
||||
TotalAmount int64 `json:"totalAmount"` // 总金额(分)
|
||||
TotalCount int32 `json:"totalCount"` // 总个数
|
||||
RemainAmount int64 `json:"remainAmount"` // 剩余金额(分)
|
||||
RemainCount int32 `json:"remainCount"` // 剩余个数
|
||||
Status int32 `json:"status"` // 状态:0-进行中,1-已领完,2-已过期
|
||||
Receives []*RedPacketReceiveDetail `json:"receives"` // 领取记录列表
|
||||
}
|
||||
|
||||
// RedPacketReceiveDetail 红包领取详情(后台管理接口使用)
|
||||
type RedPacketReceiveDetail struct {
|
||||
ReceiveID string `json:"receiveID"` // 领取记录ID
|
||||
ReceiveUserID string `json:"receiveUserID"` // 领取者ID
|
||||
Amount int64 `json:"amount"` // 领取金额(分)
|
||||
ReceiveTime int64 `json:"receiveTime"` // 领取时间戳(毫秒)
|
||||
IsLucky bool `json:"isLucky"` // 是否为手气最佳(仅拼手气红包有效)
|
||||
}
|
||||
|
||||
// PauseRedPacketReq 暂停红包请求
|
||||
type PauseRedPacketReq struct {
|
||||
RedPacketID string `json:"redPacketID" binding:"required"` // 红包ID
|
||||
}
|
||||
|
||||
// PauseRedPacketResp 暂停红包响应
|
||||
type PauseRedPacketResp struct {
|
||||
RedPacketID string `json:"redPacketID"` // 红包ID
|
||||
}
|
||||
|
||||
// GetRedPacketDetailReq 查询红包详情请求(用户端)
|
||||
type GetRedPacketDetailReq struct {
|
||||
RedPacketID string `json:"redPacketID" binding:"required"` // 红包ID(必填)
|
||||
}
|
||||
|
||||
// GetRedPacketDetailResp 查询红包详情响应(用户端)
|
||||
type GetRedPacketDetailResp struct {
|
||||
RedPacketID string `json:"redPacketID"` // 红包ID
|
||||
GroupID string `json:"groupID"` // 群ID
|
||||
RedPacketType int32 `json:"redPacketType"` // 红包类型:1-普通红包,2-拼手气红包
|
||||
TotalAmount int64 `json:"totalAmount"` // 总金额(分)
|
||||
TotalCount int32 `json:"totalCount"` // 总个数
|
||||
RemainAmount int64 `json:"remainAmount"` // 剩余金额(分)
|
||||
RemainCount int32 `json:"remainCount"` // 剩余个数
|
||||
Blessing string `json:"blessing"` // 祝福语
|
||||
Status int32 `json:"status"` // 状态:0-进行中,1-已领完,2-已过期
|
||||
IsExpired bool `json:"isExpired"` // 是否过期(超过一周)
|
||||
MyReceive *RedPacketMyReceiveDetail `json:"myReceive"` // 当前用户的领取信息(如果已领取)
|
||||
Receives []*RedPacketUserReceiveDetail `json:"receives"` // 领取记录列表(仅群主/管理员可见)
|
||||
}
|
||||
|
||||
// RedPacketMyReceiveDetail 当前用户自己的领取详情(不包含用户ID、昵称、头像)
|
||||
type RedPacketMyReceiveDetail struct {
|
||||
ReceiveID string `json:"receiveID"` // 领取记录ID
|
||||
Amount int64 `json:"amount"` // 领取金额(分)
|
||||
ReceiveTime int64 `json:"receiveTime"` // 领取时间戳(毫秒)
|
||||
IsLucky bool `json:"isLucky"` // 是否为手气最佳(仅拼手气红包有效)
|
||||
}
|
||||
|
||||
// RedPacketUserReceiveDetail 红包用户领取详情(用户端,包含用户信息)
|
||||
type RedPacketUserReceiveDetail struct {
|
||||
ReceiveID string `json:"receiveID"` // 领取记录ID
|
||||
ReceiveUserID string `json:"receiveUserID"` // 领取者ID
|
||||
Nickname string `json:"nickname"` // 领取者昵称
|
||||
FaceURL string `json:"faceURL"` // 领取者头像
|
||||
Amount int64 `json:"amount"` // 领取金额(分)
|
||||
ReceiveTime int64 `json:"receiveTime"` // 领取时间戳(毫秒)
|
||||
IsLucky bool `json:"isLucky"` // 是否为手气最佳(仅拼手气红包有效)
|
||||
}
|
||||
|
||||
// GetWalletsReq 查询用户钱包列表请求(后台管理接口)
|
||||
type GetWalletsReq struct {
|
||||
UserID string `json:"userID"` // 用户ID(选填,支持通过ID、手机号、账号查询)
|
||||
PhoneNumber string `json:"phoneNumber"` // 手机号(选填,支持通过ID、手机号、账号查询)
|
||||
Account string `json:"account"` // 账号(选填,支持通过ID、手机号、账号查询)
|
||||
Pagination Pagination `json:"pagination"` // 分页参数
|
||||
}
|
||||
|
||||
// GetWalletsResp 查询用户钱包列表响应
|
||||
type GetWalletsResp struct {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Wallets []*WalletInfo `json:"wallets"` // 钱包列表
|
||||
}
|
||||
|
||||
// WalletInfo 钱包信息
|
||||
type WalletInfo struct {
|
||||
UserID string `json:"userID"` // 用户ID
|
||||
Nickname string `json:"nickname"` // 用户昵称
|
||||
FaceURL string `json:"faceURL"` // 用户头像
|
||||
Balance int64 `json:"balance"` // 余额(分)
|
||||
CreateTime int64 `json:"createTime"` // 创建时间戳(毫秒)
|
||||
UpdateTime int64 `json:"updateTime"` // 更新时间戳(毫秒)
|
||||
}
|
||||
|
||||
// BatchUpdateWalletBalanceReq 批量修改用户余额请求(后台管理接口)
|
||||
type BatchUpdateWalletBalanceReq struct {
|
||||
Users []WalletUserIdentifier `json:"users" binding:"required"` // 用户标识列表(支持用户ID、手机号、账号)
|
||||
Amount int64 `json:"amount"` // 默认金额(分),如果用户没有指定金额则使用此值
|
||||
Operation string `json:"operation"` // 默认操作类型:set(设置为指定金额)、add(增加金额)、subtract(减少金额),默认为add
|
||||
}
|
||||
|
||||
// WalletUserIdentifier 钱包用户标识(支持用户ID、手机号、账号)
|
||||
type WalletUserIdentifier struct {
|
||||
UserID FlexibleString `json:"userID"` // 用户ID(选填,支持数字和字符串)
|
||||
PhoneNumber string `json:"phoneNumber"` // 手机号(选填)
|
||||
Account string `json:"account"` // 账号(选填)
|
||||
Amount int64 `json:"amount"` // 金额(分),如果未指定则使用请求中的默认金额
|
||||
Operation string `json:"operation"` // 操作类型:set(设置为指定金额)、add(增加金额)、subtract(减少金额),如果未指定则使用请求中的默认操作类型
|
||||
Remark string `json:"remark"` // 备注(选填),每条修改记录对应的备注信息
|
||||
}
|
||||
|
||||
// FlexibleString 灵活的字符串类型,可以接受数字和字符串
|
||||
type FlexibleString string
|
||||
|
||||
// UnmarshalJSON 自定义JSON反序列化,支持数字和字符串
|
||||
func (f *FlexibleString) UnmarshalJSON(data []byte) error {
|
||||
// 尝试解析为字符串
|
||||
var s string
|
||||
if err := json.Unmarshal(data, &s); err == nil {
|
||||
*f = FlexibleString(s)
|
||||
return nil
|
||||
}
|
||||
// 尝试解析为数字
|
||||
var num json.Number
|
||||
if err := json.Unmarshal(data, &num); err == nil {
|
||||
*f = FlexibleString(num.String())
|
||||
return nil
|
||||
}
|
||||
// 尝试解析为整数
|
||||
var i int64
|
||||
if err := json.Unmarshal(data, &i); err == nil {
|
||||
*f = FlexibleString(strconv.FormatInt(i, 10))
|
||||
return nil
|
||||
}
|
||||
// 尝试解析为浮点数
|
||||
var f64 float64
|
||||
if err := json.Unmarshal(data, &f64); err == nil {
|
||||
*f = FlexibleString(strconv.FormatFloat(f64, 'f', -1, 64))
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("cannot unmarshal %s into FlexibleString", string(data))
|
||||
}
|
||||
|
||||
// String 返回字符串值
|
||||
func (f FlexibleString) String() string {
|
||||
return string(f)
|
||||
}
|
||||
|
||||
// BatchUpdateWalletBalanceResp 批量修改用户余额响应
|
||||
type BatchUpdateWalletBalanceResp struct {
|
||||
Total int32 `json:"total"` // 总处理数量
|
||||
Success int32 `json:"success"` // 成功数量
|
||||
Failed int32 `json:"failed"` // 失败数量
|
||||
Results []WalletUpdateResult `json:"results"` // 处理结果列表
|
||||
}
|
||||
|
||||
// WalletUpdateResult 钱包更新结果
|
||||
type WalletUpdateResult struct {
|
||||
UserID string `json:"userID"` // 用户ID
|
||||
PhoneNumber string `json:"phoneNumber"` // 手机号
|
||||
Account string `json:"account"` // 账号
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Message string `json:"message"` // 结果消息
|
||||
OldBalance int64 `json:"oldBalance"` // 修改前余额
|
||||
NewBalance int64 `json:"newBalance"` // 修改后余额
|
||||
Remark string `json:"remark"` // 备注信息
|
||||
}
|
||||
|
||||
// SendSingleMsgReq defines the structure for sending a message to multiple recipients.
|
||||
type SendSingleMsgReq struct {
|
||||
// groupMsg should appoint sendID
|
||||
SendID string `json:"sendID"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type KeyMsgData struct {
|
||||
SendID string `json:"sendID"`
|
||||
RecvID string `json:"recvID"`
|
||||
GroupID string `json:"groupID"`
|
||||
}
|
||||
|
||||
// SingleReturnResult encapsulates the result of a single message send attempt.
|
||||
type SingleReturnResult struct {
|
||||
// ServerMsgID is the message identifier on the server-side.
|
||||
ServerMsgID string `json:"serverMsgID"`
|
||||
|
||||
// ClientMsgID is the message identifier on the client-side.
|
||||
ClientMsgID string `json:"clientMsgID"`
|
||||
|
||||
// SendTime is the timestamp of when the message was sent.
|
||||
SendTime int64 `json:"sendTime"`
|
||||
|
||||
// RecvID uniquely identifies the receiver of the message.
|
||||
RecvID string `json:"recvID"`
|
||||
|
||||
// Modify fields modified via webhook.
|
||||
Modify map[string]any `json:"modify,omitempty"`
|
||||
}
|
||||
|
||||
type SendMsgResp struct {
|
||||
// SendMsgResp original response.
|
||||
*pbmsg.SendMsgResp
|
||||
|
||||
// Modify fields modified via webhook.
|
||||
Modify map[string]any `json:"modify,omitempty"`
|
||||
}
|
||||
|
||||
// CreateMeetingReq 创建会议请求
|
||||
type CreateMeetingReq struct {
|
||||
MeetingID string `json:"meetingID"` // 会议ID(选填,不填则自动生成)
|
||||
Subject string `json:"subject" binding:"required"` // 会议主题(必填)
|
||||
CoverURL string `json:"coverURL"` // 封面URL
|
||||
ScheduledTime int64 `json:"scheduledTime" binding:"required"` // 预约时间戳(毫秒,必填)
|
||||
Description string `json:"description"` // 会议描述
|
||||
Duration int32 `json:"duration"` // 会议时长(分钟)
|
||||
EstimatedCount int32 `json:"estimatedCount"` // 会议预估人数
|
||||
EnableMic bool `json:"enableMic"` // 是否开启连麦
|
||||
EnableComment bool `json:"enableComment"` // 是否开启评论
|
||||
AnchorUserIDs []string `json:"anchorUserIDs"` // 主播用户ID列表(多选)
|
||||
Password string `json:"password"` // 会议密码(6位数字,选填,不填则自动生成)
|
||||
Ex string `json:"ex"` // 扩展字段
|
||||
}
|
||||
|
||||
// CreateMeetingResp 创建会议响应
|
||||
type CreateMeetingResp struct {
|
||||
MeetingInfo *MeetingInfo `json:"meetingInfo"` // 会议信息
|
||||
GroupID string `json:"groupID"` // 创建的群聊ID
|
||||
}
|
||||
|
||||
// UpdateMeetingReq 更新会议请求
|
||||
type UpdateMeetingReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
Subject string `json:"subject"` // 会议主题
|
||||
CoverURL string `json:"coverURL"` // 封面URL
|
||||
ScheduledTime int64 `json:"scheduledTime"` // 预约时间戳(毫秒)
|
||||
Status int32 `json:"status"` // 会议状态:1-已预约,2-进行中,3-已结束,4-已取消
|
||||
Description string `json:"description"` // 会议描述
|
||||
Duration int32 `json:"duration"` // 会议时长(分钟)
|
||||
EstimatedCount int32 `json:"estimatedCount"` // 会议预估人数
|
||||
EnableMic *bool `json:"enableMic"` // 是否开启连麦(使用指针以区分是否设置)
|
||||
EnableComment *bool `json:"enableComment"` // 是否开启评论(使用指针以区分是否设置)
|
||||
AnchorUserIDs []string `json:"anchorUserIDs"` // 主播用户ID列表(多选)
|
||||
Password *string `json:"password"` // 会议密码(6位数字,使用指针以区分是否设置)
|
||||
Ex string `json:"ex"` // 扩展字段
|
||||
}
|
||||
|
||||
// UpdateMeetingResp 更新会议响应
|
||||
type UpdateMeetingResp struct {
|
||||
MeetingInfo *MeetingInfo `json:"meetingInfo"` // 会议信息
|
||||
}
|
||||
|
||||
// GetMeetingsReq 获取会议列表请求
|
||||
type GetMeetingsReq struct {
|
||||
CreatorUserID string `json:"creatorUserID"` // 创建者用户ID(选填)
|
||||
Status int32 `json:"status"` // 会议状态(选填):1-已预约,2-进行中,3-已结束,4-已取消
|
||||
Keyword string `json:"keyword"` // 搜索关键词(选填,搜索主题和描述)
|
||||
StartTime int64 `json:"startTime"` // 开始时间戳(毫秒,选填)
|
||||
EndTime int64 `json:"endTime"` // 结束时间戳(毫秒,选填)
|
||||
Pagination Pagination `json:"pagination"` // 分页参数
|
||||
}
|
||||
|
||||
// GetMeetingsResp 获取会议列表响应
|
||||
type GetMeetingsResp struct {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Meetings []*MeetingInfo `json:"meetings"` // 会议列表
|
||||
}
|
||||
|
||||
// DeleteMeetingReq 删除会议请求
|
||||
type DeleteMeetingReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
}
|
||||
|
||||
// DeleteMeetingResp 删除会议响应
|
||||
type DeleteMeetingResp struct {
|
||||
}
|
||||
|
||||
// MeetingInfo 会议信息
|
||||
type MeetingInfo struct {
|
||||
MeetingID string `json:"meetingID"` // 会议ID
|
||||
Subject string `json:"subject"` // 会议主题
|
||||
CoverURL string `json:"coverURL"` // 封面URL
|
||||
ScheduledTime int64 `json:"scheduledTime"` // 预约时间戳(毫秒)
|
||||
Status int32 `json:"status"` // 会议状态:1-已预约,2-进行中,3-已结束,4-已取消
|
||||
CreatorUserID string `json:"creatorUserID"` // 创建者用户ID
|
||||
Description string `json:"description"` // 会议描述
|
||||
Duration int32 `json:"duration"` // 会议时长(分钟)
|
||||
EstimatedCount int32 `json:"estimatedCount"` // 会议预估人数
|
||||
EnableMic bool `json:"enableMic"` // 是否开启连麦
|
||||
EnableComment bool `json:"enableComment"` // 是否开启评论
|
||||
AnchorUserIDs []string `json:"anchorUserIDs"` // 主播用户ID列表(多选)
|
||||
AnchorUsers []*sdkws.UserInfo `json:"anchorUsers"` // 主播用户信息列表
|
||||
CreateTime int64 `json:"createTime"` // 创建时间戳(毫秒)
|
||||
UpdateTime int64 `json:"updateTime"` // 更新时间戳(毫秒)
|
||||
Ex string `json:"ex"` // 扩展字段
|
||||
GroupID string `json:"groupID"` // 关联的群聊ID
|
||||
CheckInCount int32 `json:"checkInCount"` // 签到人数统计
|
||||
Password string `json:"password"` // 会议密码(6位数字)
|
||||
}
|
||||
|
||||
// GetMeetingReq 获取会议请求(用户端)
|
||||
type GetMeetingReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
}
|
||||
|
||||
// GetMeetingResp 获取会议响应(用户端)
|
||||
type GetMeetingResp struct {
|
||||
MeetingInfo *MeetingPublicInfo `json:"meetingInfo"` // 会议信息
|
||||
}
|
||||
|
||||
// GetMeetingsPublicReq 获取会议列表请求(用户端)
|
||||
type GetMeetingsPublicReq struct {
|
||||
Status int32 `json:"status"` // 会议状态(选填):1-已预约,2-进行中,3-已结束,4-已取消
|
||||
Keyword string `json:"keyword"` // 搜索关键词(选填,搜索主题和描述)
|
||||
StartTime int64 `json:"startTime"` // 开始时间戳(毫秒,选填)
|
||||
EndTime int64 `json:"endTime"` // 结束时间戳(毫秒,选填)
|
||||
Pagination Pagination `json:"pagination"` // 分页参数
|
||||
}
|
||||
|
||||
// GetMeetingsPublicResp 获取会议列表响应(用户端)
|
||||
type GetMeetingsPublicResp struct {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Meetings []*MeetingPublicInfo `json:"meetings"` // 会议列表
|
||||
}
|
||||
|
||||
// MeetingPublicInfo 会议公开信息(用户端,过滤了管理字段)
|
||||
type MeetingPublicInfo struct {
|
||||
MeetingID string `json:"meetingID"` // 会议ID
|
||||
Subject string `json:"subject"` // 会议主题
|
||||
CoverURL string `json:"coverURL"` // 封面URL
|
||||
ScheduledTime int64 `json:"scheduledTime"` // 预约时间戳(毫秒)
|
||||
Status int32 `json:"status"` // 会议状态:1-已预约,2-进行中,3-已结束,4-已取消
|
||||
Description string `json:"description"` // 会议描述
|
||||
Duration int32 `json:"duration"` // 会议时长(分钟)
|
||||
EstimatedCount int32 `json:"estimatedCount"` // 会议预估人数
|
||||
EnableMic bool `json:"enableMic"` // 是否开启连麦
|
||||
EnableComment bool `json:"enableComment"` // 是否开启评论
|
||||
AnchorUsers []*sdkws.UserInfo `json:"anchorUsers"` // 主播用户信息列表
|
||||
GroupID string `json:"groupID"` // 关联的群聊ID
|
||||
CheckInCount int32 `json:"checkInCount"` // 签到人数统计
|
||||
Password string `json:"password"` // 会议密码(6位数字)
|
||||
}
|
||||
|
||||
// CheckInMeetingReq 会议签到请求
|
||||
type CheckInMeetingReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
}
|
||||
|
||||
// CheckInMeetingResp 会议签到响应
|
||||
type CheckInMeetingResp struct {
|
||||
CheckInID string `json:"checkInID"` // 签到ID
|
||||
CheckInTime int64 `json:"checkInTime"` // 签到时间戳(毫秒)
|
||||
}
|
||||
|
||||
// GetMeetingCheckInsReq 获取会议签到列表请求
|
||||
type GetMeetingCheckInsReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
Pagination Pagination `json:"pagination"` // 分页参数
|
||||
}
|
||||
|
||||
// GetMeetingCheckInsResp 获取会议签到列表响应
|
||||
type GetMeetingCheckInsResp struct {
|
||||
Total int64 `json:"total"` // 总数
|
||||
CheckIns []*MeetingCheckInInfo `json:"checkIns"` // 签到列表
|
||||
}
|
||||
|
||||
// MeetingCheckInInfo 会议签到信息
|
||||
type MeetingCheckInInfo struct {
|
||||
CheckInID string `json:"checkInID"` // 签到ID
|
||||
MeetingID string `json:"meetingID"` // 会议ID
|
||||
UserID string `json:"userID"` // 用户ID
|
||||
CheckInTime int64 `json:"checkInTime"` // 签到时间戳(毫秒)
|
||||
UserInfo *sdkws.UserInfo `json:"userInfo"` // 用户信息
|
||||
}
|
||||
|
||||
// GetMeetingCheckInStatsReq 获取会议签到统计请求
|
||||
type GetMeetingCheckInStatsReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
}
|
||||
|
||||
// GetMeetingCheckInStatsResp 获取会议签到统计响应
|
||||
type GetMeetingCheckInStatsResp struct {
|
||||
MeetingID string `json:"meetingID"` // 会议ID
|
||||
CheckInCount int64 `json:"checkInCount"` // 签到人数
|
||||
}
|
||||
|
||||
// CheckUserCheckInReq 检查用户是否已签到请求
|
||||
type CheckUserCheckInReq struct {
|
||||
MeetingID string `json:"meetingID" binding:"required"` // 会议ID(必填)
|
||||
}
|
||||
|
||||
// CheckUserCheckInResp 检查用户是否已签到响应
|
||||
type CheckUserCheckInResp struct {
|
||||
IsCheckedIn bool `json:"isCheckedIn"` // 是否已签到
|
||||
CheckInInfo *MeetingCheckInInfo `json:"checkInInfo,omitempty"` // 签到信息(如果已签到)
|
||||
}
|
||||
186
pkg/apistruct/msg.go
Normal file
186
pkg/apistruct/msg.go
Normal file
@@ -0,0 +1,186 @@
|
||||
// Copyright © 2023 OpenIM. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package apistruct
|
||||
|
||||
import "git.imall.cloud/openim/protocol/sdkws"
|
||||
|
||||
type PictureBaseInfo struct {
|
||||
UUID string `mapstructure:"uuid"`
|
||||
Type string `mapstructure:"type" validate:"required"`
|
||||
Size int64 `mapstructure:"size"`
|
||||
Width int32 `mapstructure:"width" validate:"required"`
|
||||
Height int32 `mapstructure:"height" validate:"required"`
|
||||
Url string `mapstructure:"url" validate:"required"`
|
||||
}
|
||||
|
||||
type PictureElem struct {
|
||||
SourcePath string `mapstructure:"sourcePath"`
|
||||
SourcePicture PictureBaseInfo `mapstructure:"sourcePicture" validate:"required"`
|
||||
BigPicture PictureBaseInfo `mapstructure:"bigPicture" validate:"required"`
|
||||
SnapshotPicture PictureBaseInfo `mapstructure:"snapshotPicture" validate:"required"`
|
||||
}
|
||||
|
||||
type SoundElem struct {
|
||||
UUID string `mapstructure:"uuid"`
|
||||
SoundPath string `mapstructure:"soundPath"`
|
||||
SourceURL string `mapstructure:"sourceUrl" validate:"required"`
|
||||
DataSize int64 `mapstructure:"dataSize"`
|
||||
Duration int64 `mapstructure:"duration" validate:"required,min=1"`
|
||||
}
|
||||
|
||||
type VideoElem struct {
|
||||
VideoPath string `mapstructure:"videoPath"`
|
||||
VideoUUID string `mapstructure:"videoUUID"`
|
||||
VideoURL string `mapstructure:"videoUrl" validate:"required"`
|
||||
VideoType string `mapstructure:"videoType" validate:"required"`
|
||||
VideoSize int64 `mapstructure:"videoSize" validate:"required"`
|
||||
Duration int64 `mapstructure:"duration" validate:"required"`
|
||||
SnapshotPath string `mapstructure:"snapshotPath"`
|
||||
SnapshotUUID string `mapstructure:"snapshotUUID"`
|
||||
SnapshotSize int64 `mapstructure:"snapshotSize"`
|
||||
SnapshotURL string `mapstructure:"snapshotUrl" validate:"required"`
|
||||
SnapshotWidth int32 `mapstructure:"snapshotWidth" validate:"required"`
|
||||
SnapshotHeight int32 `mapstructure:"snapshotHeight" validate:"required"`
|
||||
}
|
||||
|
||||
type FileElem struct {
|
||||
FilePath string `mapstructure:"filePath"`
|
||||
UUID string `mapstructure:"uuid"`
|
||||
SourceURL string `mapstructure:"sourceUrl" validate:"required"`
|
||||
FileName string `mapstructure:"fileName" validate:"required"`
|
||||
FileSize int64 `mapstructure:"fileSize" validate:"required"`
|
||||
}
|
||||
type AtElem struct {
|
||||
Text string `mapstructure:"text"`
|
||||
AtUserList []string `mapstructure:"atUserList" validate:"required,max=1000"`
|
||||
AtUsersInfo []*AtInfo `json:"atUsersInfo"`
|
||||
QuoteMessage *MsgStruct `json:"quoteMessage"`
|
||||
IsAtSelf bool `mapstructure:"isAtSelf"`
|
||||
}
|
||||
type LocationElem struct {
|
||||
Description string `mapstructure:"description"`
|
||||
Longitude float64 `mapstructure:"longitude" validate:"required"`
|
||||
Latitude float64 `mapstructure:"latitude" validate:"required"`
|
||||
}
|
||||
|
||||
type CustomElem struct {
|
||||
Data string `mapstructure:"data" validate:"required"`
|
||||
Description string `mapstructure:"description"`
|
||||
Extension string `mapstructure:"extension"`
|
||||
}
|
||||
|
||||
type TextElem struct {
|
||||
Content string `json:"content" validate:"required"`
|
||||
}
|
||||
|
||||
type MarkdownTextElem struct {
|
||||
Content string `mapstructure:"content" validate:"required"`
|
||||
}
|
||||
|
||||
type StreamMsgElem struct {
|
||||
Type string `mapstructure:"type" validate:"required"`
|
||||
Content string `mapstructure:"content" validate:"required"`
|
||||
}
|
||||
|
||||
type RevokeElem struct {
|
||||
RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"`
|
||||
}
|
||||
|
||||
type QuoteElem struct {
|
||||
Text string `json:"text,omitempty"`
|
||||
QuoteMessage *MsgStruct `json:"quoteMessage,omitempty"`
|
||||
}
|
||||
|
||||
type OANotificationElem struct {
|
||||
NotificationName string `mapstructure:"notificationName" json:"notificationName" validate:"required"`
|
||||
NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL"`
|
||||
NotificationType int32 `mapstructure:"notificationType" json:"notificationType" validate:"required"`
|
||||
Text string `mapstructure:"text" json:"text" validate:"required"`
|
||||
Url string `mapstructure:"url" json:"url"`
|
||||
MixType int32 `mapstructure:"mixType" json:"mixType" validate:"gte=0,lte=5"`
|
||||
PictureElem *PictureElem `mapstructure:"pictureElem" json:"pictureElem"`
|
||||
SoundElem *SoundElem `mapstructure:"soundElem" json:"soundElem"`
|
||||
VideoElem *VideoElem `mapstructure:"videoElem" json:"videoElem"`
|
||||
FileElem *FileElem `mapstructure:"fileElem" json:"fileElem"`
|
||||
Ex string `mapstructure:"ex" json:"ex"`
|
||||
}
|
||||
|
||||
type MessageRevoked struct {
|
||||
RevokerID string `mapstructure:"revokerID" json:"revokerID" validate:"required"`
|
||||
RevokerRole int32 `mapstructure:"revokerRole" json:"revokerRole" validate:"required"`
|
||||
ClientMsgID string `mapstructure:"clientMsgID" json:"clientMsgID" validate:"required"`
|
||||
RevokerNickname string `mapstructure:"revokerNickname" json:"revokerNickname"`
|
||||
SessionType int32 `mapstructure:"sessionType" json:"sessionType" validate:"required"`
|
||||
Seq uint32 `mapstructure:"seq" json:"seq" validate:"required"`
|
||||
}
|
||||
|
||||
type MsgStruct struct {
|
||||
ClientMsgID string `json:"clientMsgID,omitempty"`
|
||||
ServerMsgID string `json:"serverMsgID,omitempty"`
|
||||
CreateTime int64 `json:"createTime"`
|
||||
SendTime int64 `json:"sendTime"`
|
||||
SessionType int32 `json:"sessionType"`
|
||||
SendID string `json:"sendID,omitempty"`
|
||||
RecvID string `json:"recvID,omitempty"`
|
||||
MsgFrom int32 `json:"msgFrom"`
|
||||
ContentType int32 `json:"contentType"`
|
||||
SenderPlatformID int32 `json:"senderPlatformID"`
|
||||
SenderNickname string `json:"senderNickname,omitempty"`
|
||||
SenderFaceURL string `json:"senderFaceUrl,omitempty"`
|
||||
GroupID string `json:"groupID,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Seq int64 `json:"seq"`
|
||||
IsRead bool `json:"isRead"`
|
||||
Status int32 `json:"status"`
|
||||
IsReact bool `json:"isReact,omitempty"`
|
||||
IsExternalExtensions bool `json:"isExternalExtensions,omitempty"`
|
||||
OfflinePush *sdkws.OfflinePushInfo `json:"offlinePush,omitempty"`
|
||||
AttachedInfo string `json:"attachedInfo,omitempty"`
|
||||
Ex string `json:"ex,omitempty"`
|
||||
LocalEx string `json:"localEx,omitempty"`
|
||||
TextElem *TextElem `json:"textElem,omitempty"`
|
||||
PictureElem *PictureElem `json:"pictureElem,omitempty"`
|
||||
SoundElem *SoundElem `json:"soundElem,omitempty"`
|
||||
VideoElem *VideoElem `json:"videoElem,omitempty"`
|
||||
FileElem *FileElem `json:"fileElem,omitempty"`
|
||||
AtTextElem *AtElem `json:"atTextElem,omitempty"`
|
||||
LocationElem *LocationElem `json:"locationElem,omitempty"`
|
||||
CustomElem *CustomElem `json:"customElem,omitempty"`
|
||||
QuoteElem *QuoteElem `json:"quoteElem,omitempty"`
|
||||
}
|
||||
|
||||
type AtInfo struct {
|
||||
AtUserID string `json:"atUserID,omitempty"`
|
||||
GroupNickname string `json:"groupNickname,omitempty"`
|
||||
}
|
||||
|
||||
// RedPacketReceiveInfo 红包领取信息(已领取时返回)
|
||||
type RedPacketReceiveInfo struct {
|
||||
Amount int64 `json:"amount"` // 领取金额(分)
|
||||
ReceiveTime int64 `json:"receiveTime"` // 领取时间戳(毫秒)
|
||||
IsLucky bool `json:"isLucky"` // 是否为手气最佳(仅拼手气红包有效)
|
||||
}
|
||||
|
||||
// RedPacketElem 红包消息元素
|
||||
type RedPacketElem struct {
|
||||
RedPacketID string `json:"redPacketID" validate:"required"` // 红包ID
|
||||
RedPacketType int32 `json:"redPacketType" validate:"required"` // 红包类型:1-普通红包,2-拼手气红包
|
||||
Blessing string `json:"blessing"` // 祝福语
|
||||
IsReceived bool `json:"isReceived"` // 当前用户是否已领取
|
||||
ReceiveInfo *RedPacketReceiveInfo `json:"receiveInfo,omitempty"` // 领取信息(已领取时返回,包含金额)
|
||||
Status int32 `json:"status"` // 红包状态:0-进行中,1-已领完,2-已过期
|
||||
IsExpired bool `json:"isExpired"` // 是否已过期
|
||||
IsFinished bool `json:"isFinished"` // 是否已领完
|
||||
}
|
||||
20
pkg/apistruct/public.go
Normal file
20
pkg/apistruct/public.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright © 2023 OpenIM. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package apistruct
|
||||
|
||||
type GroupAddMemberInfo struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
RoleLevel int32 `json:"roleLevel" binding:"required,oneof= 1 3"`
|
||||
}
|
||||
124
pkg/apistruct/statistics.go
Normal file
124
pkg/apistruct/statistics.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package apistruct
|
||||
|
||||
// OnlineUserCountResp 在线人数统计返回
|
||||
type OnlineUserCountResp struct {
|
||||
OnlineCount int64 `json:"onlineCount"`
|
||||
}
|
||||
|
||||
// UserSendMsgCountReq 用户发送消息总数统计请求
|
||||
type UserSendMsgCountReq struct{}
|
||||
|
||||
// UserSendMsgCountResp 用户发送消息总数统计返回
|
||||
type UserSendMsgCountResp struct {
|
||||
// Count24h 最近24小时发送消息总数
|
||||
Count24h int64 `json:"count24h"`
|
||||
// Count7d 最近7天发送消息总数
|
||||
Count7d int64 `json:"count7d"`
|
||||
// Count30d 最近30天发送消息总数
|
||||
Count30d int64 `json:"count30d"`
|
||||
}
|
||||
|
||||
// UserSendMsgQueryReq 用户发送消息查询请求
|
||||
type UserSendMsgQueryReq struct {
|
||||
UserID string `json:"userID"`
|
||||
StartTime int64 `json:"startTime"`
|
||||
EndTime int64 `json:"endTime"`
|
||||
Content string `json:"content"`
|
||||
PageNumber int32 `json:"pageNumber"`
|
||||
// ShowNumber 每页条数 默认50 最大200
|
||||
ShowNumber int32 `json:"showNumber"`
|
||||
}
|
||||
|
||||
// UserSendMsgQueryRecord 用户发送消息查询记录
|
||||
type UserSendMsgQueryRecord struct {
|
||||
// MsgID 使用服务端消息ID
|
||||
MsgID string `json:"msgID"`
|
||||
// SendID 发送者ID
|
||||
SendID string `json:"sendID"`
|
||||
// SenderName 发送者昵称或名称
|
||||
SenderName string `json:"senderName"`
|
||||
// RecvID 接收者ID 群聊为群ID
|
||||
RecvID string `json:"recvID"`
|
||||
// RecvName 接收者昵称或名称 群聊为群名称
|
||||
RecvName string `json:"recvName"`
|
||||
// ContentType 消息类型编号
|
||||
ContentType int32 `json:"contentType"`
|
||||
// ContentTypeName 消息类型名称
|
||||
ContentTypeName string `json:"contentTypeName"`
|
||||
// SessionType 聊天类型编号
|
||||
SessionType int32 `json:"sessionType"`
|
||||
// ChatTypeName 聊天类型名称
|
||||
ChatTypeName string `json:"chatTypeName"`
|
||||
// Content 消息内容
|
||||
Content string `json:"content"`
|
||||
// SendTime 消息发送时间
|
||||
SendTime int64 `json:"sendTime"`
|
||||
}
|
||||
|
||||
// UserSendMsgQueryResp 用户发送消息查询返回
|
||||
type UserSendMsgQueryResp struct {
|
||||
Count int64 `json:"count"`
|
||||
PageNumber int32 `json:"pageNumber"`
|
||||
ShowNumber int32 `json:"showNumber"`
|
||||
Records []*UserSendMsgQueryRecord `json:"records"`
|
||||
}
|
||||
|
||||
// OnlineUserCountTrendReq 在线人数走势统计请求
|
||||
type OnlineUserCountTrendReq struct {
|
||||
// StartTime 统计开始时间(毫秒时间戳),为空时默认最近24小时
|
||||
StartTime int64 `json:"startTime"`
|
||||
// EndTime 统计结束时间(毫秒时间戳),为空时默认当前时间
|
||||
EndTime int64 `json:"endTime"`
|
||||
// IntervalMinutes 统计间隔(分钟),仅支持15/30/60
|
||||
IntervalMinutes int32 `json:"intervalMinutes" binding:"required,oneof=15 30 60"`
|
||||
}
|
||||
|
||||
// OnlineUserCountTrendItem 在线人数走势数据点
|
||||
type OnlineUserCountTrendItem struct {
|
||||
// Timestamp 区间起始时间(毫秒时间戳)
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
// OnlineCount 区间内平均在线人数
|
||||
OnlineCount int64 `json:"onlineCount"`
|
||||
}
|
||||
|
||||
// OnlineUserCountTrendResp 在线人数走势统计返回
|
||||
type OnlineUserCountTrendResp struct {
|
||||
// IntervalMinutes 统计间隔(分钟)
|
||||
IntervalMinutes int32 `json:"intervalMinutes"`
|
||||
// Points 走势数据点
|
||||
Points []*OnlineUserCountTrendItem `json:"points"`
|
||||
}
|
||||
|
||||
// UserSendMsgCountTrendReq 用户发送消息走势统计请求
|
||||
type UserSendMsgCountTrendReq struct {
|
||||
// UserID 发送者用户ID
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
// ChatType 聊天类型:1-单聊,2-群聊
|
||||
ChatType int32 `json:"chatType" binding:"required,oneof=1 2"`
|
||||
// StartTime 统计开始时间(毫秒时间戳),为空时默认最近24小时
|
||||
StartTime int64 `json:"startTime"`
|
||||
// EndTime 统计结束时间(毫秒时间戳),为空时默认当前时间
|
||||
EndTime int64 `json:"endTime"`
|
||||
// IntervalMinutes 统计间隔(分钟),仅支持15/30/60
|
||||
IntervalMinutes int32 `json:"intervalMinutes" binding:"required,oneof=15 30 60"`
|
||||
}
|
||||
|
||||
// UserSendMsgCountTrendItem 用户发送消息走势数据点
|
||||
type UserSendMsgCountTrendItem struct {
|
||||
// Timestamp 区间起始时间(毫秒时间戳)
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
// Count 区间内发送消息数
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
// UserSendMsgCountTrendResp 用户发送消息走势统计返回
|
||||
type UserSendMsgCountTrendResp struct {
|
||||
// UserID 发送者用户ID
|
||||
UserID string `json:"userID"`
|
||||
// ChatType 聊天类型:1-单聊,2-群聊
|
||||
ChatType int32 `json:"chatType"`
|
||||
// IntervalMinutes 统计间隔(分钟)
|
||||
IntervalMinutes int32 `json:"intervalMinutes"`
|
||||
// Points 走势数据点
|
||||
Points []*UserSendMsgCountTrendItem `json:"points"`
|
||||
}
|
||||
Reference in New Issue
Block a user