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
b99d8837
Unverified
Commit
b99d8837
authored
Jul 31, 2021
by
怡蘅
Committed by
GitHub
Jul 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: implement sns api (#14)
* feat: implement sns api * docs: update readme
parent
4b378a0b
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
1467 additions
and
88 deletions
+1467
-88
README.md
README.md
+15
-15
SNS.java
src/main/java/com/qcloud/im/core/SNS.java
+100
-2
AddFriendItem.java
src/main/java/com/qcloud/im/model/request/AddFriendItem.java
+4
-40
BlackListAddRequest.java
...java/com/qcloud/im/model/request/BlackListAddRequest.java
+43
-0
BlackListCheckRequest.java
...va/com/qcloud/im/model/request/BlackListCheckRequest.java
+55
-0
BlackListDeleteRequest.java
...a/com/qcloud/im/model/request/BlackListDeleteRequest.java
+43
-0
BlackListGetRequest.java
...java/com/qcloud/im/model/request/BlackListGetRequest.java
+65
-0
CustomItem.java
src/main/java/com/qcloud/im/model/request/CustomItem.java
+14
-4
FriendAddRequest.java
...in/java/com/qcloud/im/model/request/FriendAddRequest.java
+67
-0
FriendCheckRequest.java
.../java/com/qcloud/im/model/request/FriendCheckRequest.java
+55
-0
FriendDeleteAllRequest.java
...a/com/qcloud/im/model/request/FriendDeleteAllRequest.java
+41
-0
FriendDeleteRequest.java
...java/com/qcloud/im/model/request/FriendDeleteRequest.java
+55
-0
FriendGetListRequest.java
...ava/com/qcloud/im/model/request/FriendGetListRequest.java
+55
-0
FriendGetRequest.java
...in/java/com/qcloud/im/model/request/FriendGetRequest.java
+65
-0
FriendImportRequest.java
...java/com/qcloud/im/model/request/FriendImportRequest.java
+9
-7
FriendUpdateRequest.java
...java/com/qcloud/im/model/request/FriendUpdateRequest.java
+43
-0
GroupAddRequest.java
...ain/java/com/qcloud/im/model/request/GroupAddRequest.java
+55
-0
GroupDeleteRequest.java
.../java/com/qcloud/im/model/request/GroupDeleteRequest.java
+43
-0
GroupGetRequest.java
...ain/java/com/qcloud/im/model/request/GroupGetRequest.java
+67
-0
ImportFriendItem.java
...in/java/com/qcloud/im/model/request/ImportFriendItem.java
+115
-0
SnsItem.java
src/main/java/com/qcloud/im/model/request/SnsItem.java
+39
-0
UpdateItem.java
src/main/java/com/qcloud/im/model/request/UpdateItem.java
+41
-0
BlackListAddResult.java
...java/com/qcloud/im/model/response/BlackListAddResult.java
+9
-0
BlackListCheckResult.java
...va/com/qcloud/im/model/response/BlackListCheckResult.java
+9
-0
BlackListDeleteResult.java
...a/com/qcloud/im/model/response/BlackListDeleteResult.java
+9
-0
BlackListGetResult.java
...java/com/qcloud/im/model/response/BlackListGetResult.java
+10
-0
FriendAddResult.java
...in/java/com/qcloud/im/model/response/FriendAddResult.java
+10
-1
FriendCheckInfoItem.java
...ava/com/qcloud/im/model/response/FriendCheckInfoItem.java
+10
-0
FriendCheckResult.java
.../java/com/qcloud/im/model/response/FriendCheckResult.java
+9
-0
FriendDeleteAllResult.java
...a/com/qcloud/im/model/response/FriendDeleteAllResult.java
+7
-0
FriendGetListResult.java
...ava/com/qcloud/im/model/response/FriendGetListResult.java
+7
-10
FriendImportResult.java
...java/com/qcloud/im/model/response/FriendImportResult.java
+8
-0
GroupAddResult.java
...ain/java/com/qcloud/im/model/response/GroupAddResult.java
+10
-0
GroupDeleteResult.java
.../java/com/qcloud/im/model/response/GroupDeleteResult.java
+8
-0
GroupGetResult.java
...ain/java/com/qcloud/im/model/response/GroupGetResult.java
+9
-0
ResultItem.java
src/main/java/com/qcloud/im/model/response/ResultItem.java
+9
-0
UserDataItem.java
src/main/java/com/qcloud/im/model/response/UserDataItem.java
+24
-0
ValueItem.java
src/main/java/com/qcloud/im/model/response/ValueItem.java
+11
-3
ProfileTest.java
src/test/java/com/qcloud/im/ProfileTest.java
+3
-6
SNSTest.java
src/test/java/com/qcloud/im/SNSTest.java
+216
-0
No files found.
README.md
View file @
b99d8837
...
...
@@ -43,21 +43,21 @@
### 5. 关系链管理
-
[
]
添加好友
-
[
]
导入好友
-
[
]
更新好友
-
[
]
删除好友
-
[
]
删除所有好友
-
[
]
校验好友
-
[
]
拉取好友
-
[
]
拉取指定好友
-
[
]
添加黑名单
-
[
]
删除黑名单
-
[
]
拉取黑名单
-
[
]
校验黑名单
-
[
]
添加分组
-
[
]
删除分组
-
[
]
拉取分组
-
[
x
]
添加好友
-
[
x
]
导入好友
-
[
x
]
更新好友
-
[
x
]
删除好友
-
[
x
]
删除所有好友
-
[
x
]
校验好友
-
[
x
]
拉取好友
-
[
x
]
拉取指定好友
-
[
x
]
添加黑名单
-
[
x
]
删除黑名单
-
[
x
]
拉取黑名单
-
[
x
]
校验黑名单
-
[
x
]
添加分组
-
[
x
]
删除分组
-
[
x
]
拉取分组
### 6. 群组管理
...
...
src/main/java/com/qcloud/im/core/SNS.java
View file @
b99d8837
package
com
.
qcloud
.
im
.
core
;
import
com.qcloud.im.IMClient
;
import
com.qcloud.im.model.request.
FriendImportRequest
;
import
com.qcloud.im.model.response.
FriendImportResult
;
import
com.qcloud.im.model.request.
*
;
import
com.qcloud.im.model.response.
*
;
import
com.qcloud.im.util.HttpUtil
;
import
com.qcloud.im.util.JsonUtil
;
...
...
@@ -14,16 +14,114 @@ import java.io.IOException;
*/
public
class
SNS
{
private
static
final
String
SERVICE_NAME
=
"sns"
;
private
static
final
String
FRIEND_ADD_COMMAND
=
"friend_add"
;
private
static
final
String
FRIEND_IMPORT_COMMAND
=
"friend_import"
;
private
static
final
String
FRIEND_UPDATE_COMMAND
=
"friend_update"
;
private
static
final
String
FRIEND_DELETE_COMMAND
=
"friend_delete"
;
private
static
final
String
FRIEND_DELETE_ALL_COMMAND
=
"friend_delete_all"
;
private
static
final
String
FRIEND_CHECK_COMMAND
=
"friend_check"
;
private
static
final
String
FRIEND_GET_COMMAND
=
"friend_get"
;
private
static
final
String
FRIEND_GET_LIST_COMMAND
=
"friend_get_list"
;
private
static
final
String
BLACK_LIST_ADD_COMMAND
=
"black_list_add"
;
private
static
final
String
BLACK_LIST_DELETE_COMMAND
=
"black_list_delete"
;
private
static
final
String
BLACK_LIST_GET_COMMAND
=
"black_list_get"
;
private
static
final
String
BLACK_LIST_CHECK_COMMAND
=
"black_list_check"
;
private
static
final
String
GROUP_ADD_COMMAND
=
"group_add"
;
private
static
final
String
GROUP_DELETE_COMMAND
=
"group_delete"
;
private
static
final
String
GROUP_GET_COMMAND
=
"group_get"
;
private
final
IMClient
imClient
;
public
FriendAddResult
friendAdd
(
FriendAddRequest
friendAddRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_ADD_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendAddRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendAddResult
.
class
);
}
public
FriendImportResult
friendImport
(
FriendImportRequest
friendImportRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_IMPORT_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendImportRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendImportResult
.
class
);
}
public
FriendUpdateResult
friendUpdate
(
FriendUpdateRequest
friendUpdateRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_UPDATE_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendUpdateRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendUpdateResult
.
class
);
}
public
FriendDeleteResult
friendDelete
(
FriendDeleteRequest
friendDeleteRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_DELETE_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendDeleteRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendDeleteResult
.
class
);
}
public
FriendDeleteAllResult
friendDeleteAll
(
FriendDeleteAllRequest
friendDeleteAllRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_DELETE_ALL_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendDeleteAllRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendDeleteAllResult
.
class
);
}
public
FriendCheckResult
friendCheck
(
FriendCheckRequest
friendCheckRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_CHECK_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendCheckRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendCheckResult
.
class
);
}
public
FriendGetResult
friendGet
(
FriendGetRequest
friendGetRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_GET_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendGetRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendGetResult
.
class
);
}
public
FriendGetListResult
friendGetList
(
FriendGetListRequest
friendGetListRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
FRIEND_GET_LIST_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
friendGetListRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
FriendGetListResult
.
class
);
}
public
BlackListAddResult
blackListAdd
(
BlackListAddRequest
blackListAddRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
BLACK_LIST_ADD_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
blackListAddRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
BlackListAddResult
.
class
);
}
public
BlackListDeleteResult
blackListDelete
(
BlackListDeleteRequest
blackListDeleteRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
BLACK_LIST_DELETE_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
blackListDeleteRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
BlackListDeleteResult
.
class
);
}
public
BlackListGetResult
blackListGet
(
BlackListGetRequest
blackListGetRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
BLACK_LIST_GET_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
blackListGetRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
BlackListGetResult
.
class
);
}
public
BlackListCheckResult
blackListCheck
(
BlackListCheckRequest
blackListCheckRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
BLACK_LIST_CHECK_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
blackListCheckRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
BlackListCheckResult
.
class
);
}
public
GroupAddResult
groupAdd
(
GroupAddRequest
groupAddRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
GROUP_ADD_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
groupAddRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
GroupAddResult
.
class
);
}
public
GroupDeleteResult
groupDelete
(
GroupDeleteRequest
groupDeleteRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
GROUP_DELETE_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
groupDeleteRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
GroupDeleteResult
.
class
);
}
public
GroupGetResult
groupGet
(
GroupGetRequest
groupGetRequest
)
throws
IOException
{
String
url
=
imClient
.
getUrl
(
SERVICE_NAME
,
GROUP_GET_COMMAND
);
String
result
=
HttpUtil
.
post
(
url
,
JsonUtil
.
obj2Str
(
groupGetRequest
),
null
);
return
JsonUtil
.
str2Obj
(
result
,
GroupGetResult
.
class
);
}
public
SNS
(
IMClient
imClient
)
{
this
.
imClient
=
imClient
;
}
...
...
src/main/java/com/qcloud/im/model/request/AddFriendItem.java
View file @
b99d8837
...
...
@@ -15,11 +15,8 @@ public class AddFriendItem {
@JsonProperty
(
"Remark"
)
private
String
remark
;
@JsonProperty
(
"RemarkTime"
)
private
Integer
remarkTime
;
@JsonProperty
(
"GroupName"
)
private
List
<
String
>
groupName
;
private
String
groupName
;
@JsonProperty
(
"AddSource"
)
private
String
addSource
;
...
...
@@ -27,24 +24,15 @@ public class AddFriendItem {
@JsonProperty
(
"AddWording"
)
private
String
addWording
;
@JsonProperty
(
"AddTime"
)
private
Integer
addTime
;
@JsonProperty
(
"CustomItem"
)
private
List
<
CustomItem
>
CustomItemList
;
public
AddFriendItem
()
{
}
public
AddFriendItem
(
String
toAccount
,
String
remark
,
Integer
remarkTime
,
List
<
String
>
groupName
,
String
addSource
,
String
addWording
,
Integer
addTime
,
List
<
CustomItem
>
customItemList
)
{
public
AddFriendItem
(
String
toAccount
,
String
remark
,
String
groupName
,
String
addSource
,
String
addWording
)
{
this
.
toAccount
=
toAccount
;
this
.
remark
=
remark
;
this
.
remarkTime
=
remarkTime
;
this
.
groupName
=
groupName
;
this
.
addSource
=
addSource
;
this
.
addWording
=
addWording
;
this
.
addTime
=
addTime
;
CustomItemList
=
customItemList
;
}
public
String
getToAccount
()
{
...
...
@@ -63,19 +51,11 @@ public class AddFriendItem {
this
.
remark
=
remark
;
}
public
Integer
getRemarkTime
()
{
return
remarkTime
;
}
public
void
setRemarkTime
(
Integer
remarkTime
)
{
this
.
remarkTime
=
remarkTime
;
}
public
List
<
String
>
getGroupName
()
{
public
String
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
List
<
String
>
groupName
)
{
public
void
setGroupName
(
String
groupName
)
{
this
.
groupName
=
groupName
;
}
...
...
@@ -94,20 +74,4 @@ public class AddFriendItem {
public
void
setAddWording
(
String
addWording
)
{
this
.
addWording
=
addWording
;
}
public
Integer
getAddTime
()
{
return
addTime
;
}
public
void
setAddTime
(
Integer
addTime
)
{
this
.
addTime
=
addTime
;
}
public
List
<
CustomItem
>
getCustomItemList
()
{
return
CustomItemList
;
}
public
void
setCustomItemList
(
List
<
CustomItem
>
customItemList
)
{
CustomItemList
=
customItemList
;
}
}
src/main/java/com/qcloud/im/model/request/BlackListAddRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:44
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BlackListAddRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
public
BlackListAddRequest
()
{
}
public
BlackListAddRequest
(
String
fromAccount
,
List
<
String
>
toAccount
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
}
src/main/java/com/qcloud/im/model/request/BlackListCheckRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 15:29
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BlackListCheckRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
@JsonProperty
(
"CheckType"
)
private
String
checkType
;
public
BlackListCheckRequest
()
{
}
public
BlackListCheckRequest
(
String
fromAccount
,
List
<
String
>
toAccount
,
String
checkType
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
checkType
=
checkType
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
String
getCheckType
()
{
return
checkType
;
}
public
void
setCheckType
(
String
checkType
)
{
this
.
checkType
=
checkType
;
}
}
src/main/java/com/qcloud/im/model/request/BlackListDeleteRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:46
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BlackListDeleteRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
public
BlackListDeleteRequest
()
{
}
public
BlackListDeleteRequest
(
String
fromAccount
,
List
<
String
>
toAccount
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
}
src/main/java/com/qcloud/im/model/request/BlackListGetRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/31 15:27
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BlackListGetRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"StartIndex"
)
private
Integer
startIndex
;
@JsonProperty
(
"MaxLimited"
)
private
Integer
maxLimited
;
@JsonProperty
(
"LastSequence"
)
private
Integer
lastSequence
;
public
BlackListGetRequest
()
{
}
public
BlackListGetRequest
(
String
fromAccount
,
Integer
startIndex
,
Integer
maxLimited
,
Integer
lastSequence
)
{
this
.
fromAccount
=
fromAccount
;
this
.
startIndex
=
startIndex
;
this
.
maxLimited
=
maxLimited
;
this
.
lastSequence
=
lastSequence
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
Integer
getStartIndex
()
{
return
startIndex
;
}
public
void
setStartIndex
(
Integer
startIndex
)
{
this
.
startIndex
=
startIndex
;
}
public
Integer
getMaxLimited
()
{
return
maxLimited
;
}
public
void
setMaxLimited
(
Integer
maxLimited
)
{
this
.
maxLimited
=
maxLimited
;
}
public
Integer
getLastSequence
()
{
return
lastSequence
;
}
public
void
setLastSequence
(
Integer
lastSequence
)
{
this
.
lastSequence
=
lastSequence
;
}
}
src/main/java/com/qcloud/im/model/request/CustomItem.java
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/29 15:45
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
CustomItem
{
@JsonProperty
(
"Tag"
)
private
String
tag
;
@JsonProperty
(
"Value"
)
private
String
value
;
private
Object
value
;
public
CustomItem
()
{
}
public
CustomItem
(
String
tag
,
String
value
)
{
public
CustomItem
(
String
tag
,
Object
value
)
{
this
.
tag
=
tag
;
this
.
value
=
value
;
}
...
...
@@ -29,11 +31,19 @@ public class CustomItem {
this
.
tag
=
tag
;
}
public
String
getValue
()
{
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
@Override
public
String
toString
()
{
return
"CustomItem{"
+
"tag='"
+
tag
+
'\''
+
", value="
+
value
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/request/FriendAddRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:08
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendAddRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"AddFriendItem"
)
private
List
<
AddFriendItem
>
addFriendItemList
;
@JsonProperty
(
"AddType"
)
private
String
addType
;
@JsonProperty
(
"ForceAddFlags"
)
private
Integer
forceAddFlags
;
public
FriendAddRequest
()
{
}
public
FriendAddRequest
(
String
fromAccount
,
List
<
AddFriendItem
>
addFriendItemList
,
String
addType
,
Integer
forceAddFlags
)
{
this
.
fromAccount
=
fromAccount
;
this
.
addFriendItemList
=
addFriendItemList
;
this
.
addType
=
addType
;
this
.
forceAddFlags
=
forceAddFlags
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
AddFriendItem
>
getAddFriendItemList
()
{
return
addFriendItemList
;
}
public
void
setAddFriendItemList
(
List
<
AddFriendItem
>
addFriendItemList
)
{
this
.
addFriendItemList
=
addFriendItemList
;
}
public
String
getAddType
()
{
return
addType
;
}
public
void
setAddType
(
String
addType
)
{
this
.
addType
=
addType
;
}
public
Integer
getForceAddFlags
()
{
return
forceAddFlags
;
}
public
void
setForceAddFlags
(
Integer
forceAddFlags
)
{
this
.
forceAddFlags
=
forceAddFlags
;
}
}
src/main/java/com/qcloud/im/model/request/FriendCheckRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:32
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendCheckRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
@JsonProperty
(
"CheckType"
)
private
String
checkType
;
public
FriendCheckRequest
()
{
}
public
FriendCheckRequest
(
String
fromAccount
,
List
<
String
>
toAccount
,
String
checkType
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
checkType
=
checkType
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
String
getCheckType
()
{
return
checkType
;
}
public
void
setCheckType
(
String
checkType
)
{
this
.
checkType
=
checkType
;
}
}
src/main/java/com/qcloud/im/model/request/FriendDeleteAllRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/31 14:30
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendDeleteAllRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"DeleteType"
)
private
String
deleteType
;
public
FriendDeleteAllRequest
()
{
}
public
FriendDeleteAllRequest
(
String
fromAccount
,
String
deleteType
)
{
this
.
fromAccount
=
fromAccount
;
this
.
deleteType
=
deleteType
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
String
getDeleteType
()
{
return
deleteType
;
}
public
void
setDeleteType
(
String
deleteType
)
{
this
.
deleteType
=
deleteType
;
}
}
src/main/java/com/qcloud/im/model/request/FriendDeleteRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:28
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendDeleteRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
@JsonProperty
(
"DeleteType"
)
private
String
deleteType
;
public
FriendDeleteRequest
()
{
}
public
FriendDeleteRequest
(
String
fromAccount
,
List
<
String
>
toAccount
,
String
deleteType
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
deleteType
=
deleteType
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
String
getDeleteType
()
{
return
deleteType
;
}
public
void
setDeleteType
(
String
deleteType
)
{
this
.
deleteType
=
deleteType
;
}
}
src/main/java/com/qcloud/im/model/request/FriendGetListRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:41
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendGetListRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
@JsonProperty
(
"TagList"
)
private
List
<
String
>
tagList
;
public
FriendGetListRequest
()
{
}
public
FriendGetListRequest
(
String
fromAccount
,
List
<
String
>
toAccount
,
List
<
String
>
tagList
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
tagList
=
tagList
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
List
<
String
>
getTagList
()
{
return
tagList
;
}
public
void
setTagList
(
List
<
String
>
tagList
)
{
this
.
tagList
=
tagList
;
}
}
src/main/java/com/qcloud/im/model/request/FriendGetRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/31 14:34
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendGetRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"StartIndex"
)
private
Integer
startIndex
;
@JsonProperty
(
"StandardSequence"
)
private
Integer
standardSequence
;
@JsonProperty
(
"CustomSequence"
)
private
Integer
customSequence
;
public
FriendGetRequest
()
{
}
public
FriendGetRequest
(
String
fromAccount
,
Integer
startIndex
,
Integer
standardSequence
,
Integer
customSequence
)
{
this
.
fromAccount
=
fromAccount
;
this
.
startIndex
=
startIndex
;
this
.
standardSequence
=
standardSequence
;
this
.
customSequence
=
customSequence
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
Integer
getStartIndex
()
{
return
startIndex
;
}
public
void
setStartIndex
(
Integer
startIndex
)
{
this
.
startIndex
=
startIndex
;
}
public
Integer
getStandardSequence
()
{
return
standardSequence
;
}
public
void
setStandardSequence
(
Integer
standardSequence
)
{
this
.
standardSequence
=
standardSequence
;
}
public
Integer
getCustomSequence
()
{
return
customSequence
;
}
public
void
setCustomSequence
(
Integer
customSequence
)
{
this
.
customSequence
=
customSequence
;
}
}
src/main/java/com/qcloud/im/model/request/FriendImportRequest.java
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
...
...
@@ -8,19 +9,20 @@ import java.util.List;
* @author hyh
* @since 2021/07/29 15:19
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendImportRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"AddFriendItem"
)
private
List
<
AddFriendItem
>
add
FriendItemList
;
private
List
<
ImportFriendItem
>
import
FriendItemList
;
public
FriendImportRequest
()
{
}
public
FriendImportRequest
(
String
fromAccount
,
List
<
AddFriendItem
>
add
FriendItemList
)
{
public
FriendImportRequest
(
String
fromAccount
,
List
<
ImportFriendItem
>
import
FriendItemList
)
{
this
.
fromAccount
=
fromAccount
;
this
.
addFriendItemList
=
add
FriendItemList
;
this
.
importFriendItemList
=
import
FriendItemList
;
}
public
String
getFromAccount
()
{
...
...
@@ -31,11 +33,11 @@ public class FriendImportRequest extends GenericRequest {
this
.
fromAccount
=
fromAccount
;
}
public
List
<
AddFriendItem
>
getAdd
FriendItemList
()
{
return
add
FriendItemList
;
public
List
<
ImportFriendItem
>
getImport
FriendItemList
()
{
return
import
FriendItemList
;
}
public
void
set
AddFriendItemList
(
List
<
AddFriendItem
>
add
FriendItemList
)
{
this
.
addFriendItemList
=
add
FriendItemList
;
public
void
set
ImportFriendItemList
(
List
<
ImportFriendItem
>
import
FriendItemList
)
{
this
.
importFriendItemList
=
import
FriendItemList
;
}
}
src/main/java/com/qcloud/im/model/request/FriendUpdateRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:20
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
FriendUpdateRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"UpdateItem"
)
private
List
<
UpdateItem
>
updateItemList
;
public
FriendUpdateRequest
()
{
}
public
FriendUpdateRequest
(
String
fromAccount
,
List
<
UpdateItem
>
updateItemList
)
{
this
.
fromAccount
=
fromAccount
;
this
.
updateItemList
=
updateItemList
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
UpdateItem
>
getUpdateItemList
()
{
return
updateItemList
;
}
public
void
setUpdateItemList
(
List
<
UpdateItem
>
updateItemList
)
{
this
.
updateItemList
=
updateItemList
;
}
}
src/main/java/com/qcloud/im/model/request/GroupAddRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 15:33
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
GroupAddRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"GroupName"
)
private
List
<
String
>
groupName
;
@JsonProperty
(
"To_Account"
)
private
List
<
String
>
toAccount
;
public
GroupAddRequest
()
{
}
public
GroupAddRequest
(
String
fromAccount
,
List
<
String
>
groupName
,
List
<
String
>
toAccount
)
{
this
.
fromAccount
=
fromAccount
;
this
.
groupName
=
groupName
;
this
.
toAccount
=
toAccount
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
List
<
String
>
groupName
)
{
this
.
groupName
=
groupName
;
}
public
List
<
String
>
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
List
<
String
>
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
}
src/main/java/com/qcloud/im/model/request/GroupDeleteRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 15:41
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
GroupDeleteRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"GroupName"
)
private
List
<
String
>
groupName
;
public
GroupDeleteRequest
()
{
}
public
GroupDeleteRequest
(
String
fromAccount
,
List
<
String
>
groupName
)
{
this
.
fromAccount
=
fromAccount
;
this
.
groupName
=
groupName
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
List
<
String
>
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
List
<
String
>
groupName
)
{
this
.
groupName
=
groupName
;
}
}
src/main/java/com/qcloud/im/model/request/GroupGetRequest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 15:43
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
GroupGetRequest
extends
GenericRequest
{
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
@JsonProperty
(
"NeedFriend"
)
private
String
needFriend
;
@JsonProperty
(
"LastSequence"
)
private
Integer
lastSequence
;
@JsonProperty
(
"GroupName"
)
private
List
<
String
>
groupName
;
public
GroupGetRequest
()
{
}
public
GroupGetRequest
(
String
fromAccount
,
String
needFriend
,
Integer
lastSequence
,
List
<
String
>
groupName
)
{
this
.
fromAccount
=
fromAccount
;
this
.
needFriend
=
needFriend
;
this
.
lastSequence
=
lastSequence
;
this
.
groupName
=
groupName
;
}
public
String
getFromAccount
()
{
return
fromAccount
;
}
public
void
setFromAccount
(
String
fromAccount
)
{
this
.
fromAccount
=
fromAccount
;
}
public
String
getNeedFriend
()
{
return
needFriend
;
}
public
void
setNeedFriend
(
String
needFriend
)
{
this
.
needFriend
=
needFriend
;
}
public
Integer
getLastSequence
()
{
return
lastSequence
;
}
public
void
setLastSequence
(
Integer
lastSequence
)
{
this
.
lastSequence
=
lastSequence
;
}
public
List
<
String
>
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
List
<
String
>
groupName
)
{
this
.
groupName
=
groupName
;
}
}
src/main/java/com/qcloud/im/model/request/ImportFriendItem.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/29 15:37
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
ImportFriendItem
{
@JsonProperty
(
"To_Account"
)
private
String
toAccount
;
@JsonProperty
(
"Remark"
)
private
String
remark
;
@JsonProperty
(
"RemarkTime"
)
private
Integer
remarkTime
;
@JsonProperty
(
"GroupName"
)
private
List
<
String
>
groupName
;
@JsonProperty
(
"AddSource"
)
private
String
addSource
;
@JsonProperty
(
"AddWording"
)
private
String
addWording
;
@JsonProperty
(
"AddTime"
)
private
Integer
addTime
;
@JsonProperty
(
"CustomItem"
)
private
List
<
CustomItem
>
customItemList
;
public
ImportFriendItem
()
{
}
public
ImportFriendItem
(
String
toAccount
,
String
remark
,
Integer
remarkTime
,
List
<
String
>
groupName
,
String
addSource
,
String
addWording
,
Integer
addTime
,
List
<
CustomItem
>
customItemList
)
{
this
.
toAccount
=
toAccount
;
this
.
remark
=
remark
;
this
.
remarkTime
=
remarkTime
;
this
.
groupName
=
groupName
;
this
.
addSource
=
addSource
;
this
.
addWording
=
addWording
;
this
.
addTime
=
addTime
;
this
.
customItemList
=
customItemList
;
}
public
String
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
String
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Integer
getRemarkTime
()
{
return
remarkTime
;
}
public
void
setRemarkTime
(
Integer
remarkTime
)
{
this
.
remarkTime
=
remarkTime
;
}
public
List
<
String
>
getGroupName
()
{
return
groupName
;
}
public
void
setGroupName
(
List
<
String
>
groupName
)
{
this
.
groupName
=
groupName
;
}
public
String
getAddSource
()
{
return
addSource
;
}
public
void
setAddSource
(
String
addSource
)
{
this
.
addSource
=
addSource
;
}
public
String
getAddWording
()
{
return
addWording
;
}
public
void
setAddWording
(
String
addWording
)
{
this
.
addWording
=
addWording
;
}
public
Integer
getAddTime
()
{
return
addTime
;
}
public
void
setAddTime
(
Integer
addTime
)
{
this
.
addTime
=
addTime
;
}
public
List
<
CustomItem
>
getCustomItemList
()
{
return
customItemList
;
}
public
void
setCustomItemList
(
List
<
CustomItem
>
customItemList
)
{
this
.
customItemList
=
customItemList
;
}
}
src/main/java/com/qcloud/im/model/request/SnsItem.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/31 14:24
*/
public
class
SnsItem
{
@JsonProperty
(
"Tag"
)
private
String
tag
;
@JsonProperty
(
"Value"
)
private
Object
value
;
public
SnsItem
()
{
}
public
SnsItem
(
String
tag
,
Object
value
)
{
this
.
tag
=
tag
;
this
.
value
=
value
;
}
public
String
getTag
()
{
return
tag
;
}
public
void
setTag
(
String
tag
)
{
this
.
tag
=
tag
;
}
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
}
src/main/java/com/qcloud/im/model/request/UpdateItem.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.List
;
/**
* @author hyh
* @since 2021/07/31 14:22
*/
public
class
UpdateItem
{
@JsonProperty
(
"To_Account"
)
private
String
toAccount
;
@JsonProperty
(
"SnsItem"
)
private
List
<
SnsItem
>
snsItemList
;
public
UpdateItem
()
{
}
public
UpdateItem
(
String
toAccount
,
List
<
SnsItem
>
snsItemList
)
{
this
.
toAccount
=
toAccount
;
this
.
snsItemList
=
snsItemList
;
}
public
String
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
String
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
List
<
SnsItem
>
getSnsItemList
()
{
return
snsItemList
;
}
public
void
setSnsItemList
(
List
<
SnsItem
>
snsItemList
)
{
this
.
snsItemList
=
snsItemList
;
}
}
src/main/java/com/qcloud/im/model/response/BlackListAddResult.java
View file @
b99d8837
...
...
@@ -41,4 +41,13 @@ public class BlackListAddResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"BlackListAddResult{"
+
"resultItemList="
+
resultItemList
+
", failAccount="
+
failAccount
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/BlackListCheckResult.java
View file @
b99d8837
...
...
@@ -41,4 +41,13 @@ public class BlackListCheckResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"BlackListCheckResult{"
+
"blackListCheckItemList="
+
blackListCheckItemList
+
", failAccount="
+
failAccount
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/BlackListDeleteResult.java
View file @
b99d8837
...
...
@@ -41,4 +41,13 @@ public class BlackListDeleteResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"BlackListDeleteResult{"
+
"resultItemList="
+
resultItemList
+
", failAccount="
+
failAccount
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/BlackListGetResult.java
View file @
b99d8837
...
...
@@ -52,4 +52,14 @@ public class BlackListGetResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"BlackListGetResult{"
+
"blackListItemList="
+
blackListItemList
+
", startIndex="
+
startIndex
+
", currentSequence="
+
currentSequence
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/FriendAddResult.java
View file @
b99d8837
...
...
@@ -8,7 +8,7 @@ import java.util.List;
* @author hyh
* @since 2021/07/30 15:14
*/
public
class
FriendAddResult
extends
GenericResult
{
public
class
FriendAddResult
extends
GenericResult
{
@JsonProperty
(
"ResultItem"
)
private
List
<
ResultItem
>
resultItemList
;
...
...
@@ -43,4 +43,13 @@ public class FriendAddResult extends GenericResult{
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"FriendAddResult{"
+
"resultItemList="
+
resultItemList
+
", actionStatus='"
+
actionStatus
+
'\''
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/FriendCheckInfoItem.java
View file @
b99d8837
...
...
@@ -50,4 +50,14 @@ public class FriendCheckInfoItem {
public
void
setResultInfo
(
String
resultInfo
)
{
this
.
resultInfo
=
resultInfo
;
}
@Override
public
String
toString
()
{
return
"FriendCheckInfoItem{"
+
"toAccount='"
+
toAccount
+
'\''
+
", relation='"
+
relation
+
'\''
+
", resultCode="
+
resultCode
+
", resultInfo='"
+
resultInfo
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/FriendCheckResult.java
View file @
b99d8837
...
...
@@ -41,4 +41,13 @@ public class FriendCheckResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"FriendCheckResult{"
+
"friendCheckInfoItemList="
+
friendCheckInfoItemList
+
", failAccount="
+
failAccount
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/FriendDeleteAllResult.java
View file @
b99d8837
...
...
@@ -17,4 +17,11 @@ public class FriendDeleteAllResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"FriendDeleteAllResult{"
+
"errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/FriendGetListResult.java
View file @
b99d8837
...
...
@@ -8,16 +8,13 @@ import java.util.List;
* @author hyh
* @since 2021/07/30 16:56
*/
public
class
FriendGetListResult
{
public
class
FriendGetListResult
extends
GroupGetResult
{
@JsonProperty
(
"InfoItem"
)
private
List
<
FriendGetListInfoItem
>
infoItemList
;
@JsonProperty
(
"Fail_Account"
)
private
List
<
String
>
failAccount
;
@JsonProperty
(
"ErrorDisplay"
)
private
String
errorDisplay
;
public
List
<
FriendGetListInfoItem
>
getInfoItemList
()
{
return
infoItemList
;
}
...
...
@@ -34,11 +31,11 @@ public class FriendGetListResult {
this
.
failAccount
=
failAccount
;
}
public
String
getErrorDisplay
()
{
return
errorDisplay
;
}
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
@Override
public
String
toString
()
{
return
"FriendGetListResult{"
+
"infoItemList="
+
infoItemList
+
", failAccount="
+
failAccount
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/FriendImportResult.java
View file @
b99d8837
...
...
@@ -30,4 +30,12 @@ public class FriendImportResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"FriendImportResult{"
+
"resultItemList="
+
resultItemList
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/GroupAddResult.java
View file @
b99d8837
...
...
@@ -52,4 +52,14 @@ public class GroupAddResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"GroupAddResult{"
+
"resultItemList="
+
resultItemList
+
", failAccount="
+
failAccount
+
", currentSequence="
+
currentSequence
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/GroupDeleteResult.java
View file @
b99d8837
...
...
@@ -28,4 +28,12 @@ public class GroupDeleteResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"GroupDeleteResult{"
+
"currentSequence="
+
currentSequence
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/GroupGetResult.java
View file @
b99d8837
...
...
@@ -41,4 +41,13 @@ public class GroupGetResult extends GenericResult {
public
void
setErrorDisplay
(
String
errorDisplay
)
{
this
.
errorDisplay
=
errorDisplay
;
}
@Override
public
String
toString
()
{
return
"GroupGetResult{"
+
"resultItemList="
+
resultItemList
+
", currentSequence="
+
currentSequence
+
", errorDisplay='"
+
errorDisplay
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/ResultItem.java
View file @
b99d8837
...
...
@@ -39,4 +39,13 @@ public class ResultItem {
public
void
setResultInfo
(
String
resultInfo
)
{
this
.
resultInfo
=
resultInfo
;
}
@Override
public
String
toString
()
{
return
"ResultItem{"
+
"toAccount='"
+
toAccount
+
'\''
+
", resultCode="
+
resultCode
+
", resultInfo='"
+
resultInfo
+
'\''
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/UserDataItem.java
View file @
b99d8837
...
...
@@ -14,4 +14,28 @@ public class UserDataItem {
@JsonProperty
(
"ValueItem"
)
private
List
<
ValueItem
>
valueItemList
;
public
String
getToAccount
()
{
return
toAccount
;
}
public
void
setToAccount
(
String
toAccount
)
{
this
.
toAccount
=
toAccount
;
}
public
List
<
ValueItem
>
getValueItemList
()
{
return
valueItemList
;
}
public
void
setValueItemList
(
List
<
ValueItem
>
valueItemList
)
{
this
.
valueItemList
=
valueItemList
;
}
@Override
public
String
toString
()
{
return
"UserDataItem{"
+
"toAccount='"
+
toAccount
+
'\''
+
", valueItemList="
+
valueItemList
+
'}'
;
}
}
src/main/java/com/qcloud/im/model/response/ValueItem.java
View file @
b99d8837
...
...
@@ -11,7 +11,7 @@ public class ValueItem {
private
String
tag
;
@JsonProperty
(
"Value"
)
private
String
value
;
private
Object
value
;
public
String
getTag
()
{
return
tag
;
...
...
@@ -21,11 +21,19 @@ public class ValueItem {
this
.
tag
=
tag
;
}
public
String
getValue
()
{
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
@Override
public
String
toString
()
{
return
"ValueItem{"
+
"tag='"
+
tag
+
'\''
+
", value="
+
value
+
'}'
;
}
}
src/test/java/com/qcloud/im/ProfileTest.java
View file @
b99d8837
...
...
@@ -11,6 +11,7 @@ import org.junit.Test;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Properties
;
...
...
@@ -38,9 +39,7 @@ public class ProfileTest {
@Test
public
void
testPortraitSet
()
throws
IOException
{
ProfileItem
profileItem
=
new
ProfileItem
(
"Tag_Profile_IM_Nick"
,
"MyNickName"
);
List
<
ProfileItem
>
profileItemList
=
new
ArrayList
<>();
profileItemList
.
add
(
profileItem
);
PortraitSetRequest
request
=
new
PortraitSetRequest
(
"test1"
,
profileItemList
);
PortraitSetRequest
request
=
new
PortraitSetRequest
(
"test1"
,
Collections
.
singletonList
(
profileItem
));
PortraitSetResult
result
=
client
.
profile
.
portraitSet
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
...
...
@@ -48,11 +47,9 @@ public class ProfileTest {
@Test
public
void
testPortraitGet
()
throws
IOException
{
List
<
String
>
toAccount
=
new
ArrayList
<>();
toAccount
.
add
(
"test1"
);
List
<
String
>
tagList
=
new
ArrayList
<>();
tagList
.
add
(
"Tag_Profile_IM_Nick"
);
PortraitGetRequest
request
=
new
PortraitGetRequest
(
toAccount
,
tagList
);
PortraitGetRequest
request
=
new
PortraitGetRequest
(
Collections
.
singletonList
(
"test1"
)
,
tagList
);
PortraitGetResult
result
=
client
.
profile
.
portraitGet
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
...
...
src/test/java/com/qcloud/im/SNSTest.java
0 → 100644
View file @
b99d8837
package
com
.
qcloud
.
im
;
import
com.qcloud.im.model.request.*
;
import
com.qcloud.im.model.response.*
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.*
;
/**
* @author hyh
* @since 2021/07/31 16:14
*/
public
class
SNSTest
{
private
static
final
Properties
properties
=
new
Properties
();
private
static
final
IMClient
client
;
static
{
InputStream
resourceAsStream
=
AccountTest
.
class
.
getClassLoader
().
getResourceAsStream
(
"app.properties"
);
try
{
properties
.
load
(
resourceAsStream
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
String
key
=
properties
.
getProperty
(
"key"
);
String
identifier
=
properties
.
getProperty
(
"identifier"
);
Long
appId
=
Long
.
parseLong
(
properties
.
getProperty
(
"appId"
));
client
=
IMClient
.
getInstance
(
appId
,
identifier
,
key
);
}
@Test
public
void
testFriendAdd
()
throws
IOException
{
AddFriendItem
addFriendItem
=
new
AddFriendItem
();
addFriendItem
.
setToAccount
(
"test2"
);
addFriendItem
.
setRemark
(
"Mr.A"
);
addFriendItem
.
setGroupName
(
"schoolmate"
);
addFriendItem
.
setAddSource
(
"AddSource_Type_XXXXXXXX"
);
addFriendItem
.
setAddWording
(
"Hi"
);
FriendAddRequest
request
=
new
FriendAddRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setAddFriendItemList
(
Collections
.
singletonList
(
addFriendItem
));
request
.
setAddType
(
"Add_Type_Both"
);
request
.
setForceAddFlags
(
1
);
FriendAddResult
result
=
client
.
sns
.
friendAdd
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendImport
()
throws
IOException
{
ImportFriendItem
importFriendItem
=
new
ImportFriendItem
();
importFriendItem
.
setToAccount
(
"test2"
);
importFriendItem
.
setAddSource
(
"AddSource_Type_XXXXXXXX"
);
FriendImportRequest
request
=
new
FriendImportRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setImportFriendItemList
(
Collections
.
singletonList
(
importFriendItem
));
FriendImportResult
result
=
client
.
sns
.
friendImport
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendUpdate
()
throws
IOException
{
SnsItem
snsItem
=
new
SnsItem
();
snsItem
.
setTag
(
"Tag_SNS_Custom_testTag"
);
snsItem
.
setValue
(
"Tag_SNS_IM_AddWording"
);
UpdateItem
updateItem
=
new
UpdateItem
();
updateItem
.
setToAccount
(
"test2"
);
updateItem
.
setSnsItemList
(
Collections
.
singletonList
(
snsItem
));
FriendUpdateRequest
request
=
new
FriendUpdateRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setUpdateItemList
(
Collections
.
singletonList
(
updateItem
));
FriendUpdateResult
result
=
client
.
sns
.
friendUpdate
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendDelete
()
throws
IOException
{
FriendDeleteRequest
request
=
new
FriendDeleteRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
request
.
setDeleteType
(
"Delete_Type_Both"
);
FriendDeleteResult
result
=
client
.
sns
.
friendDelete
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendDeleteAll
()
throws
IOException
{
FriendDeleteAllRequest
request
=
new
FriendDeleteAllRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setDeleteType
(
"Delete_Type_Both"
);
FriendDeleteAllResult
result
=
client
.
sns
.
friendDeleteAll
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendCheck
()
throws
IOException
{
FriendCheckRequest
request
=
new
FriendCheckRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
request
.
setCheckType
(
"CheckResult_Type_Both"
);
FriendCheckResult
result
=
client
.
sns
.
friendCheck
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendGet
()
throws
IOException
{
FriendGetRequest
request
=
new
FriendGetRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setStartIndex
(
0
);
request
.
setStandardSequence
(
0
);
request
.
setCustomSequence
(
0
);
FriendGetResult
result
=
client
.
sns
.
friendGet
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testFriendGetList
()
throws
IOException
{
FriendGetListRequest
request
=
new
FriendGetListRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
request
.
setTagList
(
Collections
.
singletonList
(
"Tag_SNS_Custom_testTag"
));
FriendGetListResult
result
=
client
.
sns
.
friendGetList
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testBlackListAdd
()
throws
IOException
{
BlackListAddRequest
request
=
new
BlackListAddRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
BlackListAddResult
result
=
client
.
sns
.
blackListAdd
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testBlackListDelete
()
throws
IOException
{
BlackListDeleteRequest
request
=
new
BlackListDeleteRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
BlackListDeleteResult
result
=
client
.
sns
.
blackListDelete
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testBlackListGet
()
throws
IOException
{
BlackListGetRequest
request
=
new
BlackListGetRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setStartIndex
(
0
);
request
.
setMaxLimited
(
10
);
request
.
setLastSequence
(
0
);
BlackListGetResult
result
=
client
.
sns
.
blackListGet
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testBlackListCheck
()
throws
IOException
{
BlackListCheckRequest
request
=
new
BlackListCheckRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
request
.
setCheckType
(
"BlackCheckResult_Type_Both"
);
BlackListCheckResult
result
=
client
.
sns
.
blackListCheck
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testGroupAdd
()
throws
IOException
{
GroupAddRequest
request
=
new
GroupAddRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setToAccount
(
Collections
.
singletonList
(
"test2"
));
request
.
setGroupName
(
Collections
.
singletonList
(
"classmate"
));
GroupAddResult
result
=
client
.
sns
.
groupAdd
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testGroupDelete
()
throws
IOException
{
GroupDeleteRequest
request
=
new
GroupDeleteRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setGroupName
(
Collections
.
singletonList
(
"classmate"
));
GroupDeleteResult
result
=
client
.
sns
.
groupDelete
(
request
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
}
@Test
public
void
testGroupGet
()
throws
IOException
{
GroupGetRequest
request
=
new
GroupGetRequest
();
request
.
setFromAccount
(
"test1"
);
request
.
setGroupName
(
Collections
.
singletonList
(
"schoolmate"
));
request
.
setNeedFriend
(
"Need_Friend_Type_Yes"
);
request
.
setLastSequence
(
0
);
GroupGetResult
result
=
client
.
sns
.
groupGet
(
request
);
System
.
out
.
println
(
result
);
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