mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-29 23:38:11 +08:00
feat: add prom address
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
parent
4786e2ce43
commit
88dcbc5c31
@ -18,40 +18,83 @@ import (
|
|||||||
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// SendMsg defines the structure for sending messages with various metadata.
|
||||||
type SendMsg struct {
|
type SendMsg struct {
|
||||||
SendID string `json:"sendID" binding:"required"`
|
// SendID uniquely identifies the sender.
|
||||||
GroupID string `json:"groupID" binding:"required_if=SessionType 2|required_if=SessionType 3"`
|
SendID string `json:"sendID" binding:"required"`
|
||||||
SenderNickname string `json:"senderNickname"`
|
|
||||||
SenderFaceURL string `json:"senderFaceURL"`
|
// GroupID is the identifier for the group, required if SessionType is 2 or 3.
|
||||||
SenderPlatformID int32 `json:"senderPlatformID"`
|
GroupID string `json:"groupID" binding:"required_if=SessionType 2|required_if=SessionType 3"`
|
||||||
Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"`
|
|
||||||
ContentType int32 `json:"contentType" binding:"required"`
|
// SenderNickname is the nickname of the sender.
|
||||||
SessionType int32 `json:"sessionType" binding:"required"`
|
SenderNickname string `json:"senderNickname"`
|
||||||
IsOnlineOnly bool `json:"isOnlineOnly"`
|
|
||||||
NotOfflinePush bool `json:"notOfflinePush"`
|
// SenderFaceURL is the URL to the sender's avatar.
|
||||||
SendTime int64 `json:"sendTime"`
|
SenderFaceURL string `json:"senderFaceURL"`
|
||||||
OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"`
|
|
||||||
|
// 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]interface{} `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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SendMsgReq extends SendMsg with the requirement of RecvID when SessionType indicates a one-on-one or notification chat.
|
||||||
type SendMsgReq struct {
|
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"`
|
RecvID string `json:"recvID" binding:"required_if" message:"recvID is required if sessionType is SingleChatType or NotificationChatType"`
|
||||||
SendMsg
|
SendMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BatchSendMsgReq defines the structure for sending a message to multiple recipients.
|
||||||
type BatchSendMsgReq struct {
|
type BatchSendMsgReq struct {
|
||||||
SendMsg
|
SendMsg
|
||||||
IsSendAll bool `json:"isSendAll"`
|
|
||||||
RecvIDs []string `json:"recvIDs" binding:"required"`
|
// 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 {
|
type BatchSendMsgResp struct {
|
||||||
Results []*SingleReturnResult `json:"results"`
|
// Results is a slice of SingleReturnResult, representing the outcome of each message sent.
|
||||||
FailedIDs []string `json:"failedUserIDs"`
|
Results []*SingleReturnResult `json:"results"`
|
||||||
|
|
||||||
|
// FailedIDs is a slice of user IDs for whom the message send failed.
|
||||||
|
FailedIDs []string `json:"failedUserIDs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SingleReturnResult encapsulates the result of a single message send attempt.
|
||||||
type SingleReturnResult struct {
|
type SingleReturnResult struct {
|
||||||
|
// ServerMsgID is the message identifier on the server-side.
|
||||||
ServerMsgID string `json:"serverMsgID"`
|
ServerMsgID string `json:"serverMsgID"`
|
||||||
|
|
||||||
|
// ClientMsgID is the message identifier on the client-side.
|
||||||
ClientMsgID string `json:"clientMsgID"`
|
ClientMsgID string `json:"clientMsgID"`
|
||||||
SendTime int64 `json:"sendTime"`
|
|
||||||
RecvID string `json:"recvID"`
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,4 +107,4 @@ func InitConfig(configFolderPath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return initConfig(&Config.Notification, NotificationFileName, configFolderPath)
|
return initConfig(&Config.Notification, NotificationFileName, configFolderPath)
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user