Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
im-common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈永峰
im-common
Commits
b1c87cb2
Unverified
Commit
b1c87cb2
authored
Nov 08, 2021
by
Yang Libin
Committed by
GitHub
Nov 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add constants and update unit tests (#59)
parent
8a8ce7ce
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
99 additions
and
13 deletions
+99
-13
README.md
README.md
+2
-2
README.md
docs/guide/README.md
+1
-1
group.md
docs/guide/group.md
+4
-3
message.md
docs/guide/message.md
+4
-1
quickstart.md
docs/guide/quickstart.md
+2
-2
pom.xml
pom.xml
+1
-1
AdminForbidType.java
...ain/java/io/github/doocs/im/constant/AdminForbidType.java
+23
-0
AllowType.java
src/main/java/io/github/doocs/im/constant/AllowType.java
+28
-0
GenderType.java
src/main/java/io/github/doocs/im/constant/GenderType.java
+28
-0
version.properties
src/main/resources/version.properties
+1
-1
GroupTest.java
src/test/java/io/github/doocs/im/GroupTest.java
+2
-1
MessageTest.java
src/test/java/io/github/doocs/im/MessageTest.java
+3
-1
No files found.
README.md
View file @
b1c87cb2
...
@@ -22,7 +22,7 @@ Add the Maven dependency:
...
@@ -22,7 +22,7 @@ Add the Maven dependency:
<dependency>
<dependency>
<groupId>
io.github.doocs
</groupId>
<groupId>
io.github.doocs
</groupId>
<artifactId>
im-server-sdk-java
</artifactId>
<artifactId>
im-server-sdk-java
</artifactId>
<version>
0.2.
5
</version>
<version>
0.2.
6
</version>
</dependency>
</dependency>
```
```
...
@@ -63,7 +63,7 @@ try {
...
@@ -63,7 +63,7 @@ try {
## Contributing
## Contributing
Contributions are always welcomed!
Contributions are always welcomed!
We use the
`dev`
branch as the development branch, which indicates that this is a unstable branch.
We use the
`dev`
branch as the development branch, which indicates that this is a unstable branch.
...
...
docs/guide/README.md
View file @
b1c87cb2
# 介绍
# 介绍
本文档基于腾讯云 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"
/>
编写。
## 前提条件
## 前提条件
...
...
docs/guide/group.md
View file @
b1c87cb2
...
@@ -124,8 +124,8 @@ ModifyGroupBaseInfoRequest request = ModifyGroupBaseInfoRequest.builder()
...
@@ -124,8 +124,8 @@ ModifyGroupBaseInfoRequest request = ModifyGroupBaseInfoRequest.builder()
.
notification
(
"hello world!"
)
.
notification
(
"hello world!"
)
.
faceUrl
(
"https://avatars.githubusercontent.com/u/43716716?s=200&v=4"
)
.
faceUrl
(
"https://avatars.githubusercontent.com/u/43716716?s=200&v=4"
)
.
maxMemberNum
(
500
)
.
maxMemberNum
(
500
)
.
applyJoinOption
(
"NeedPermission"
)
.
applyJoinOption
(
ApplyJoinOption
.
NEED_PERMISSION
)
.
shutUpAllMember
(
"Off"
)
.
shutUpAllMember
(
ShutUpAllMember
.
OFF
)
.
build
();
.
build
();
ModifyGroupBaseInfoResult
result
=
client
.
group
.
modifyGroupBaseInfo
(
request
);
ModifyGroupBaseInfoResult
result
=
client
.
group
.
modifyGroupBaseInfo
(
request
);
...
@@ -331,9 +331,10 @@ Private(即新版本中的 Work,好友工作群)类型不支持禁言。
...
@@ -331,9 +331,10 @@ Private(即新版本中的 Work,好友工作群)类型不支持禁言。
使用示例:
使用示例:
```
java
```
java
List
<
String
>
membersAccount
=
Collections
.
singletonList
(
"doocs"
);
ForbidSendMsgRequest
request
=
ForbidSendMsgRequest
.
builder
()
ForbidSendMsgRequest
request
=
ForbidSendMsgRequest
.
builder
()
.
groupId
(
"MyFirstGroup"
)
.
groupId
(
"MyFirstGroup"
)
.
membersAccount
(
Collections
.
singletonList
(
"doocs"
)
)
.
membersAccount
(
membersAccount
)
.
shutUpTime
(
200
)
.
shutUpTime
(
200
)
.
build
();
.
build
();
...
...
docs/guide/message.md
View file @
b1c87cb2
...
@@ -102,6 +102,7 @@ AdminGetRoamMsgRequest request = AdminGetRoamMsgRequest.builder()
...
@@ -102,6 +102,7 @@ AdminGetRoamMsgRequest request = AdminGetRoamMsgRequest.builder()
.
minTime
(
1631934000
)
.
minTime
(
1631934000
)
.
maxTime
(
1631934060
)
.
maxTime
(
1631934060
)
.
build
();
.
build
();
AdminRoamMsgResult
result
=
client
.
message
.
getRoamMsg
(
request
);
AdminRoamMsgResult
result
=
client
.
message
.
getRoamMsg
(
request
);
List
<
MsgListItem
>
msgList
=
result
.
getMsgList
();
List
<
MsgListItem
>
msgList
=
result
.
getMsgList
();
...
@@ -173,6 +174,8 @@ App 后台可以通过该接口查询特定账号的单聊总未读数(包含
...
@@ -173,6 +174,8 @@ App 后台可以通过该接口查询特定账号的单聊总未读数(包含
```
java
```
java
GetC2cUnreadMsgRequest
request
=
new
GetC2cUnreadMsgRequest
(
"test2"
);
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
);
C2cUnreadMsgNumResult
result
=
client
.
message
.
getC2cUnreadMsgNum
(
request
);
```
```
docs/guide/quickstart.md
View file @
b1c87cb2
...
@@ -10,14 +10,14 @@
...
@@ -10,14 +10,14 @@
<dependency>
<dependency>
<groupId>
io.github.doocs
</groupId>
<groupId>
io.github.doocs
</groupId>
<artifactId>
im-server-sdk-java
</artifactId>
<artifactId>
im-server-sdk-java
</artifactId>
<version>
0.2.
5
</version>
<version>
0.2.
6
</version>
</dependency>
</dependency>
```
```
### Gradle
### Gradle
```
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
### 下载 jar
...
...
pom.xml
View file @
b1c87cb2
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<groupId>
io.github.doocs
</groupId>
<groupId>
io.github.doocs
</groupId>
<artifactId>
im-server-sdk-java
</artifactId>
<artifactId>
im-server-sdk-java
</artifactId>
<version>
0.2.
5
</version>
<version>
0.2.
6
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
qcloud-im-server-sdk-java
</name>
<name>
qcloud-im-server-sdk-java
</name>
...
...
src/main/java/io/github/doocs/im/constant/AdminForbidType.java
0 → 100644
View file @
b1c87cb2
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
()
{
}
}
src/main/java/io/github/doocs/im/constant/AllowType.java
0 → 100644
View file @
b1c87cb2
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
()
{
}
}
src/main/java/io/github/doocs/im/constant/GenderType.java
0 → 100644
View file @
b1c87cb2
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
()
{
}
}
src/main/resources/version.properties
View file @
b1c87cb2
version
=
0.2.
5
version
=
0.2.
6
src/test/java/io/github/doocs/im/GroupTest.java
View file @
b1c87cb2
...
@@ -182,9 +182,10 @@ public class GroupTest {
...
@@ -182,9 +182,10 @@ public class GroupTest {
@Test
@Test
public
void
testForbidSendMsg
()
throws
IOException
{
public
void
testForbidSendMsg
()
throws
IOException
{
List
<
String
>
membersAccount
=
Collections
.
singletonList
(
"doocs"
);
ForbidSendMsgRequest
request
=
ForbidSendMsgRequest
.
builder
()
ForbidSendMsgRequest
request
=
ForbidSendMsgRequest
.
builder
()
.
groupId
(
"MyFirstGroup"
)
.
groupId
(
"MyFirstGroup"
)
.
membersAccount
(
Collections
.
singletonList
(
"doocs"
)
)
.
membersAccount
(
membersAccount
)
.
shutUpTime
(
200
)
.
shutUpTime
(
200
)
.
build
();
.
build
();
...
...
src/test/java/io/github/doocs/im/MessageTest.java
View file @
b1c87cb2
...
@@ -146,7 +146,9 @@ public class MessageTest {
...
@@ -146,7 +146,9 @@ public class MessageTest {
@Test
@Test
public
void
testGetC2CUnreadMsgNum
()
throws
IOException
{
public
void
testGetC2CUnreadMsgNum
()
throws
IOException
{
GetC2cUnreadMsgRequest
request
=
new
GetC2cUnreadMsgRequest
(
"test2"
);
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
);
C2cUnreadMsgNumResult
result
=
client
.
message
.
getC2cUnreadMsgNum
(
request
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment