Unverified Commit b1c87cb2 authored by Yang Libin's avatar Yang Libin Committed by GitHub

chore: add constants and update unit tests (#59)

parent 8a8ce7ce
......@@ -22,7 +22,7 @@ Add the Maven dependency:
<dependency>
<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.2.5</version>
<version>0.2.6</version>
</dependency>
```
......
# 介绍
本文档基于腾讯云 IM Server SDK Java <Badge type="tip" text="v0.2.5" vertical="top" /> 编写。
本文档基于腾讯云 IM Server SDK Java <Badge type="tip" text="v0.2.6" vertical="top" /> 编写。
## 前提条件
......
......@@ -124,8 +124,8 @@ ModifyGroupBaseInfoRequest request = ModifyGroupBaseInfoRequest.builder()
.notification("hello world!")
.faceUrl("https://avatars.githubusercontent.com/u/43716716?s=200&v=4")
.maxMemberNum(500)
.applyJoinOption("NeedPermission")
.shutUpAllMember("Off")
.applyJoinOption(ApplyJoinOption.NEED_PERMISSION)
.shutUpAllMember(ShutUpAllMember.OFF)
.build();
ModifyGroupBaseInfoResult result = client.group.modifyGroupBaseInfo(request);
......@@ -331,9 +331,10 @@ Private(即新版本中的 Work,好友工作群)类型不支持禁言。
使用示例:
```java
List<String> membersAccount = Collections.singletonList("doocs");
ForbidSendMsgRequest request = ForbidSendMsgRequest.builder()
.groupId("MyFirstGroup")
.membersAccount(Collections.singletonList("doocs"))
.membersAccount(membersAccount)
.shutUpTime(200)
.build();
......
......@@ -102,6 +102,7 @@ AdminGetRoamMsgRequest request = AdminGetRoamMsgRequest.builder()
.minTime(1631934000)
.maxTime(1631934060)
.build();
AdminRoamMsgResult result = client.message.getRoamMsg(request);
List<MsgListItem> msgList = result.getMsgList();
......@@ -173,6 +174,8 @@ App 后台可以通过该接口查询特定账号的单聊总未读数(包含
```java
GetC2cUnreadMsgRequest request = new GetC2cUnreadMsgRequest("test2");
request.setPeerAccount(Arrays.asList("test1", "bingo"));
List<String> peerAccount = Arrays.asList("test1", "bingo");
request.setPeerAccount(peerAccount);
C2cUnreadMsgNumResult result = client.message.getC2cUnreadMsgNum(request);
```
......@@ -10,14 +10,14 @@
<dependency>
<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.2.5</version>
<version>0.2.6</version>
</dependency>
```
### Gradle
```gradle
implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.2.5'
implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.2.6'
```
### 下载 jar
......
......@@ -6,7 +6,7 @@
<groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId>
<version>0.2.5</version>
<version>0.2.6</version>
<packaging>jar</packaging>
<name>qcloud-im-server-sdk-java</name>
......
package io.github.doocs.im.constant;
/**
* 管理员禁止加好友标识
*
* @author bingo
* @since 2021/11/8 15:53
*/
public class AdminForbidType {
/**
* 默认值,允许加好友
*/
public static final String NONE = "AdminForbid_Type_None";
/**
* 禁止该用户发起加好友请求
*/
public static final String SEND_OUT = "AdminForbid_Type_SendOut";
private AdminForbidType() {
}
}
package io.github.doocs.im.constant;
/**
* 加好友验证方式
*
* @author bingo
* @since 2021/11/8 15:50
*/
public class AllowType {
/**
* 需要经过自己确认对方才能添加自己为好友
*/
public static final String NEED_CONFIRM = "AllowType_Type_NeedConfirm";
/**
* 允许任何人添加自己为好友
*/
public static final String ALLOW_ANY = "AllowType_Type_AllowAny";
/**
* 不允许任何人添加自己为好友
*/
public static final String DENY_ANY = "AllowType_Type_DenyAny";
private AllowType() {
}
}
package io.github.doocs.im.constant;
/**
* 性别
*
* @author bingo
* @since 2021/11/8 15:47
*/
public class GenderType {
/**
* 没设置性别
*/
public static final String UNKNOWN = "Gender_Type_Unknown";
/**
* 女性
*/
public static final String FEMALE = "Gender_Type_Female";
/**
* 男性
*/
public static final String MALE = "Gender_Type_Male";
private GenderType() {
}
}
......@@ -182,9 +182,10 @@ public class GroupTest {
@Test
public void testForbidSendMsg() throws IOException {
List<String> membersAccount = Collections.singletonList("doocs");
ForbidSendMsgRequest request = ForbidSendMsgRequest.builder()
.groupId("MyFirstGroup")
.membersAccount(Collections.singletonList("doocs"))
.membersAccount(membersAccount)
.shutUpTime(200)
.build();
......
......@@ -146,7 +146,9 @@ public class MessageTest {
@Test
public void testGetC2CUnreadMsgNum() throws IOException {
GetC2cUnreadMsgRequest request = new GetC2cUnreadMsgRequest("test2");
request.setPeerAccount(Arrays.asList("test1", "bingo"));
List<String> peerAccount = Arrays.asList("test1", "bingo");
request.setPeerAccount(peerAccount);
C2cUnreadMsgNumResult result = client.message.getC2cUnreadMsgNum(request);
System.out.println(result);
Assert.assertEquals("OK", result.getActionStatus());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment