类 EMCreateMessage
java.lang.Object
com.easemob.im.api.model.EMCreateMessage
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2025-03-03T21:15:46.103336+08:00[Asia/Shanghai]")
public class EMCreateMessage
extends Object
EMCreateMessage
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addRoamIgnoreUsersItem(String roamIgnoreUsersItem) addUsersItem(String usersItem) body(EMMessageContent body) chatroomMsgLevel(String chatroomMsgLevel) booleanstatic EMCreateMessageCreate an instance of EMCreateMessage given an JSON stringgetBody()Get body聊天室消息优先级,仅对发送聊天室消息有效: - high:高; - (默认)normal:普通; - low:低getExt()消息支持扩展字段,可添加自定义信息。getFrom()消息发送方的用户 ID。设置哪些用户拉漫游消息时拉不到该消息若传入该参数,其值为 ROUTE_ONLINE,表示接收方只有在线时才能收到消息,若接收方离线则无法收到消息。消息发送成功后,是否将消息同步到发送方 - true:是; - (默认)false:否getTo()发送单聊消息 - 消息接收方的用户 ID 数组。getType()消息类型: - txt:文本消息; - img:图片消息; - audio:语音消息; - video:视频消息; - file:文件消息; - loc:位置消息; - cmd:透传消息; - custom:自定义消息。getUsers()接收消息的群成员或聊天室成员的用户 ID 数组。inthashCode()roamIgnoreUsers(List<String> roamIgnoreUsers) voidsetBody(EMMessageContent body) voidsetChatroomMsgLevel(String chatroomMsgLevel) voidvoidvoidsetRoamIgnoreUsers(List<String> roamIgnoreUsers) voidsetRoutetype(String routetype) voidsetSyncDevice(Boolean syncDevice) voidvoidvoidsyncDevice(Boolean syncDevice) toJson()Convert an instance of EMCreateMessage to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
字段详细资料
-
SERIALIZED_NAME_FROM
- 另请参阅:
-
SERIALIZED_NAME_TO
- 另请参阅:
-
SERIALIZED_NAME_TYPE
- 另请参阅:
-
SERIALIZED_NAME_BODY
- 另请参阅:
-
SERIALIZED_NAME_SYNC_DEVICE
- 另请参阅:
-
SERIALIZED_NAME_ROUTETYPE
- 另请参阅:
-
SERIALIZED_NAME_EXT
- 另请参阅:
-
SERIALIZED_NAME_CHATROOM_MSG_LEVEL
- 另请参阅:
-
SERIALIZED_NAME_ROAM_IGNORE_USERS
- 另请参阅:
-
SERIALIZED_NAME_USERS
- 另请参阅:
-
openapiFields
-
openapiRequiredFields
-
-
构造器详细资料
-
EMCreateMessage
public EMCreateMessage()
-
-
方法详细资料
-
from
-
getFrom
消息发送方的用户 ID。若不传入该字段,服务器默认设置为管理员,即 “admin”;若传入字段但值为空字符串 (“”),请求失败- 返回:
- from
-
setFrom
-
to
-
addToItem
-
getTo
发送单聊消息 - 消息接收方的用户 ID 数组。每次最多可向 600 个用户发送消息 发送群聊消息 - 消息接收方群组 ID 数组。每次最多可向 3 个群组发送消息 发送聊天室消息 - 消息接收方聊天室 ID 数组。每次最多可向 10 个聊天室发送消息- 返回:
- to
-
setTo
-
type
-
getType
消息类型: - txt:文本消息; - img:图片消息; - audio:语音消息; - video:视频消息; - file:文件消息; - loc:位置消息; - cmd:透传消息; - custom:自定义消息。- 返回:
- type
-
setType
-
body
-
getBody
Get body- 返回:
- body
-
setBody
-
syncDevice
-
getSyncDevice
消息发送成功后,是否将消息同步到发送方 - true:是; - (默认)false:否- 返回:
- syncDevice
-
setSyncDevice
-
routetype
-
getRoutetype
若传入该参数,其值为 ROUTE_ONLINE,表示接收方只有在线时才能收到消息,若接收方离线则无法收到消息。若不传入该参数,无论接收方在线还是离线都能收到消息- 返回:
- routetype
-
setRoutetype
-
ext
-
getExt
消息支持扩展字段,可添加自定义信息。不能对该参数传入 null。同时,推送通知也支持自定义扩展字段,详见 APNs 自定义显示:https://docs-im-beta.easemob.com/document/ios/push.html#_4-%E8%AE%BE%E7%BD%AE%E7%A6%BB%E7%BA%BF%E6%8E%A8%E9%80%81 和 Android 推送字段说明:https://docs-im-beta.easemob.com/document/android/push.html#_5-%E8%A7%A3%E6%9E%90%E6%94%B6%E5%88%B0%E7%9A%84%E6%8E%A8%E9%80%81%E5%AD%97%E6%AE%B5- 返回:
- ext
-
setExt
-
chatroomMsgLevel
-
getChatroomMsgLevel
聊天室消息优先级,仅对发送聊天室消息有效: - high:高; - (默认)normal:普通; - low:低- 返回:
- chatroomMsgLevel
-
setChatroomMsgLevel
-
roamIgnoreUsers
-
addRoamIgnoreUsersItem
-
getRoamIgnoreUsers
设置哪些用户拉漫游消息时拉不到该消息- 返回:
- roamIgnoreUsers
-
setRoamIgnoreUsers
-
users
-
addUsersItem
-
getUsers
接收消息的群成员或聊天室成员的用户 ID 数组。每次最多可传 20 个用户 ID- 返回:
- users
-
setUsers
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- 参数:
jsonElement- JSON Element- 抛出:
IOException- if the JSON Element is invalid with respect to EMCreateMessage
-
fromJson
Create an instance of EMCreateMessage given an JSON string- 参数:
jsonString- JSON string- 返回:
- An instance of EMCreateMessage
- 抛出:
IOException- if the JSON string is invalid with respect to EMCreateMessage
-
toJson
Convert an instance of EMCreateMessage to an JSON string- 返回:
- JSON string
-