类 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
  • 字段详细资料

    • SERIALIZED_NAME_FROM

      public static final String SERIALIZED_NAME_FROM
      另请参阅:
    • SERIALIZED_NAME_TO

      public static final String SERIALIZED_NAME_TO
      另请参阅:
    • SERIALIZED_NAME_TYPE

      public static final String SERIALIZED_NAME_TYPE
      另请参阅:
    • SERIALIZED_NAME_BODY

      public static final String SERIALIZED_NAME_BODY
      另请参阅:
    • SERIALIZED_NAME_SYNC_DEVICE

      public static final String SERIALIZED_NAME_SYNC_DEVICE
      另请参阅:
    • SERIALIZED_NAME_ROUTETYPE

      public static final String SERIALIZED_NAME_ROUTETYPE
      另请参阅:
    • SERIALIZED_NAME_EXT

      public static final String SERIALIZED_NAME_EXT
      另请参阅:
    • SERIALIZED_NAME_CHATROOM_MSG_LEVEL

      public static final String SERIALIZED_NAME_CHATROOM_MSG_LEVEL
      另请参阅:
    • SERIALIZED_NAME_ROAM_IGNORE_USERS

      public static final String SERIALIZED_NAME_ROAM_IGNORE_USERS
      另请参阅:
    • SERIALIZED_NAME_USERS

      public static final String SERIALIZED_NAME_USERS
      另请参阅:
    • openapiFields

      public static HashSet<String> openapiFields
    • openapiRequiredFields

      public static HashSet<String> openapiRequiredFields
  • 构造器详细资料

    • EMCreateMessage

      public EMCreateMessage()
  • 方法详细资料

    • from

      public EMCreateMessage from(String from)
    • getFrom

      @Nullable public String getFrom()
      消息发送方的用户 ID。若不传入该字段,服务器默认设置为管理员,即 “admin”;若传入字段但值为空字符串 (“”),请求失败
      返回:
      from
    • setFrom

      public void setFrom(String from)
    • to

      public EMCreateMessage to(List<String> to)
    • addToItem

      public EMCreateMessage addToItem(String toItem)
    • getTo

      @Nonnull public List<String> getTo()
      发送单聊消息 - 消息接收方的用户 ID 数组。每次最多可向 600 个用户发送消息 发送群聊消息 - 消息接收方群组 ID 数组。每次最多可向 3 个群组发送消息 发送聊天室消息 - 消息接收方聊天室 ID 数组。每次最多可向 10 个聊天室发送消息
      返回:
      to
    • setTo

      public void setTo(List<String> to)
    • type

      public EMCreateMessage type(String type)
    • getType

      @Nonnull public String getType()
      消息类型: - txt:文本消息; - img:图片消息; - audio:语音消息; - video:视频消息; - file:文件消息; - loc:位置消息; - cmd:透传消息; - custom:自定义消息。
      返回:
      type
    • setType

      public void setType(String type)
    • body

      public EMCreateMessage body(EMMessageContent body)
    • getBody

      @Nonnull public EMMessageContent getBody()
      Get body
      返回:
      body
    • setBody

      public void setBody(EMMessageContent body)
    • syncDevice

      public EMCreateMessage syncDevice(Boolean syncDevice)
    • getSyncDevice

      @Nullable public Boolean getSyncDevice()
      消息发送成功后,是否将消息同步到发送方 - true:是; - (默认)false:否
      返回:
      syncDevice
    • setSyncDevice

      public void setSyncDevice(Boolean syncDevice)
    • routetype

      public EMCreateMessage routetype(String routetype)
    • getRoutetype

      @Nullable public String getRoutetype()
      若传入该参数,其值为 ROUTE_ONLINE,表示接收方只有在线时才能收到消息,若接收方离线则无法收到消息。若不传入该参数,无论接收方在线还是离线都能收到消息
      返回:
      routetype
    • setRoutetype

      public void setRoutetype(String routetype)
    • ext

      public EMCreateMessage ext(Object ext)
    • getExt

      @Nullable public Object 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

      public void setExt(Object ext)
    • chatroomMsgLevel

      public EMCreateMessage chatroomMsgLevel(String chatroomMsgLevel)
    • getChatroomMsgLevel

      @Nullable public String getChatroomMsgLevel()
      聊天室消息优先级,仅对发送聊天室消息有效: - high:高; - (默认)normal:普通; - low:低
      返回:
      chatroomMsgLevel
    • setChatroomMsgLevel

      public void setChatroomMsgLevel(String chatroomMsgLevel)
    • roamIgnoreUsers

      public EMCreateMessage roamIgnoreUsers(List<String> roamIgnoreUsers)
    • addRoamIgnoreUsersItem

      public EMCreateMessage addRoamIgnoreUsersItem(String roamIgnoreUsersItem)
    • getRoamIgnoreUsers

      @Nullable public List<String> getRoamIgnoreUsers()
      设置哪些用户拉漫游消息时拉不到该消息
      返回:
      roamIgnoreUsers
    • setRoamIgnoreUsers

      public void setRoamIgnoreUsers(List<String> roamIgnoreUsers)
    • users

      public EMCreateMessage users(List<String> users)
    • addUsersItem

      public EMCreateMessage addUsersItem(String usersItem)
    • getUsers

      @Nullable public List<String> getUsers()
      接收消息的群成员或聊天室成员的用户 ID 数组。每次最多可传 20 个用户 ID
      返回:
      users
    • setUsers

      public void setUsers(List<String> users)
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      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

      public static EMCreateMessage fromJson(String jsonString) throws IOException
      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

      public String toJson()
      Convert an instance of EMCreateMessage to an JSON string
      返回:
      JSON string