Skip to content

Commit

Permalink
fix: msgbody type
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Nov 25, 2024
1 parent 19218e6 commit 7ce172e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you're using Maven, just add the following dependency in `pom.xml`.
<dependency>
<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.4.08</version>
<version>0.4.09</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ https://doocs.github.io/qcloud-im-server-sdk-java
<dependency>
<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.4.08</version>
<version>0.4.09</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 介绍

本文档基于腾讯云 IM Server SDK Java <Badge type="tip" text="v0.4.08" vertical="top" /> 编写。
本文档基于腾讯云 IM Server SDK Java <Badge type="tip" text="v0.4.09" vertical="top" /> 编写。

## 前提条件

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<dependency>
<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.4.08</version>
<version>0.4.09</version>
</dependency>
```

### Gradle

```gradle
implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.4.08'
implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.4.09'
```

### 下载 JAR
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qcloud-im-server-sdk-java",
"version": "0.4.08",
"version": "0.4.09",
"description": "腾讯云 IM 服务端 SDK API 文档 Java 版",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.4.08</version>
<version>0.4.09</version>
<packaging>jar</packaging>

<name>qcloud-im-server-sdk-java</name>
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/io/github/doocs/im/model/response/RspMsgItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io.github.doocs.im.model.message.TIMMsgElement;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
Expand All @@ -28,7 +29,7 @@ public class RspMsgItem implements Serializable {
* 消息内容,详情请参见 消息内容 MsgBody 说明
*/
@JsonProperty("MsgBody")
private List<TIMMsgElement> msgBody;
private Object msgBody;

/**
* 字段为 1 时表示系统消息
Expand Down Expand Up @@ -83,11 +84,18 @@ public void setIsPlaceMsg(Integer isPlaceMsg) {
this.isPlaceMsg = isPlaceMsg;
}

@SuppressWarnings("unchecked")
public List<TIMMsgElement> getMsgBody() {
return msgBody;
if (msgBody instanceof List) {
return (List<TIMMsgElement>) msgBody;
}
if (msgBody instanceof TIMMsgElement) {
return Collections.singletonList((TIMMsgElement) msgBody);
}
return Collections.emptyList();
}

public void setMsgBody(List<TIMMsgElement> msgBody) {
public void setMsgBody(Object msgBody) {
this.msgBody = msgBody;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.4.08
version=0.4.09

0 comments on commit 7ce172e

Please sign in to comment.