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
622e5bf1
Unverified
Commit
622e5bf1
authored
Oct 29, 2021
by
Yang Libin
Committed by
GitHub
Oct 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: support multi-type msg (#41)
parent
12e52f86
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1061 additions
and
146 deletions
+1061
-146
MsgType.java
src/main/java/io/github/doocs/im/constant/MsgType.java
+49
-0
TIMCustomMsgElement.java
...io/github/doocs/im/model/message/TIMCustomMsgElement.java
+95
-0
TIMFaceMsgElement.java
...a/io/github/doocs/im/model/message/TIMFaceMsgElement.java
+71
-0
TIMFileMsgElement.java
...a/io/github/doocs/im/model/message/TIMFileMsgElement.java
+107
-0
TIMImageMsgElement.java
.../io/github/doocs/im/model/message/TIMImageMsgElement.java
+154
-0
TIMLocationMsgElement.java
.../github/doocs/im/model/message/TIMLocationMsgElement.java
+83
-0
TIMMsgElement.java
.../java/io/github/doocs/im/model/message/TIMMsgElement.java
+24
-0
TIMSoundMsgElement.java
.../io/github/doocs/im/model/message/TIMSoundMsgElement.java
+107
-0
TIMTextMsgElement.java
...a/io/github/doocs/im/model/message/TIMTextMsgElement.java
+59
-0
TIMVideoFileMsgElement.java
...github/doocs/im/model/message/TIMVideoFileMsgElement.java
+203
-0
BatchSendMsgRequest.java
...io/github/doocs/im/model/request/BatchSendMsgRequest.java
+5
-5
IMPushRequest.java
.../java/io/github/doocs/im/model/request/IMPushRequest.java
+16
-4
ImportGroupMsgListItem.java
...github/doocs/im/model/request/ImportGroupMsgListItem.java
+14
-4
ImportMsgRequest.java
...va/io/github/doocs/im/model/request/ImportMsgRequest.java
+5
-5
MsgGroupItem.java
...n/java/io/github/doocs/im/model/request/MsgGroupItem.java
+5
-5
SendGroupMsgRequest.java
...io/github/doocs/im/model/request/SendGroupMsgRequest.java
+5
-5
SendMsgRequest.java
...java/io/github/doocs/im/model/request/SendMsgRequest.java
+5
-5
MsgBodyItem.java
...n/java/io/github/doocs/im/model/response/MsgBodyItem.java
+0
-39
MsgContentItem.java
...ava/io/github/doocs/im/model/response/MsgContentItem.java
+0
-20
MsgListItem.java
...n/java/io/github/doocs/im/model/response/MsgListItem.java
+19
-3
RspMsgItem.java
...in/java/io/github/doocs/im/model/response/RspMsgItem.java
+17
-16
GroupTest.java
src/test/java/io/github/doocs/im/GroupTest.java
+8
-12
MemberTest.java
src/test/java/io/github/doocs/im/MemberTest.java
+3
-5
MessageTest.java
src/test/java/io/github/doocs/im/MessageTest.java
+7
-18
No files found.
src/main/java/io/github/doocs/im/constant/MsgType.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
constant
;
/**
* 消息元素类别
*
* @author bingo
* @since 2021/10/29 11:19
*/
public
class
MsgType
{
/**
* 文本消息
*/
public
static
final
String
TIM_TEXT_ELEM
=
"TIMTextElem"
;
/**
* 地理位置消息
*/
public
static
final
String
TIM_LOCATION_ELEM
=
"TIMLocationElem"
;
/**
* 表情消息
*/
public
static
final
String
TIM_FACE_ELEM
=
"TIMFaceElem"
;
/**
* 自定义消息,当接收方为 iOS 系统且应用处在后台时,此消息类型可携带除文本以外的字段到 APNs。一条组合消息中只能包含一个 TIMCustomElem 自定义消息元素
*/
public
static
final
String
TIM_CUSTOM_ELEM
=
"TIMCustomElem"
;
/**
* 语音消息
*/
public
static
final
String
TIM_SOUND_ELEM
=
"TIMSoundElem"
;
/**
* 图像消息
*/
public
static
final
String
TIM_IMAGE_ELEM
=
"TIMImageElem"
;
/**
* 文件消息
*/
public
static
final
String
TIM_FILE_ELEM
=
"TIMFileElem"
;
/**
* 视频消息
*/
public
static
final
String
TIM_VIDEO_FILE_ELEM
=
"TIMVideoFileElem"
;
}
src/main/java/io/github/doocs/im/model/message/TIMCustomMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 自定义消息元素
*
* @author bingo
* @since 2021/10/29 16:42
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMCustomMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
CustomMsgContent
msgContent
;
public
TIMCustomMsgElement
()
{
super
(
MsgType
.
TIM_CUSTOM_ELEM
);
}
public
TIMCustomMsgElement
(
CustomMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMCustomMsgElement
(
String
data
,
String
desc
,
String
ext
,
String
sound
)
{
this
(
new
CustomMsgContent
(
data
,
desc
,
ext
,
sound
));
}
public
CustomMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
CustomMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
CustomMsgContent
{
@JsonProperty
(
"Data"
)
private
String
data
;
@JsonProperty
(
"Desc"
)
private
String
desc
;
@JsonProperty
(
"Ext"
)
private
String
ext
;
@JsonProperty
(
"Sound"
)
private
String
sound
;
public
CustomMsgContent
()
{
}
public
CustomMsgContent
(
String
data
,
String
desc
,
String
ext
,
String
sound
)
{
this
.
data
=
data
;
this
.
desc
=
desc
;
this
.
ext
=
ext
;
this
.
sound
=
sound
;
}
public
String
getData
()
{
return
data
;
}
public
void
setData
(
String
data
)
{
this
.
data
=
data
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getExt
()
{
return
ext
;
}
public
void
setExt
(
String
ext
)
{
this
.
ext
=
ext
;
}
public
String
getSound
()
{
return
sound
;
}
public
void
setSound
(
String
sound
)
{
this
.
sound
=
sound
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMFaceMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 表情消息元素
*
* @author bingo
* @since 2021/10/29 16:39
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMFaceMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
FaceMsgContent
msgContent
;
public
TIMFaceMsgElement
()
{
super
(
MsgType
.
TIM_FACE_ELEM
);
}
public
TIMFaceMsgElement
(
FaceMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMFaceMsgElement
(
Integer
index
,
String
data
)
{
this
(
new
FaceMsgContent
(
index
,
data
));
}
public
FaceMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
FaceMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
FaceMsgContent
{
@JsonProperty
(
"Index"
)
private
Integer
index
;
@JsonProperty
(
"Data"
)
private
String
data
;
public
FaceMsgContent
()
{
}
public
FaceMsgContent
(
Integer
index
,
String
data
)
{
this
.
index
=
index
;
this
.
data
=
data
;
}
public
Integer
getIndex
()
{
return
index
;
}
public
void
setIndex
(
Integer
index
)
{
this
.
index
=
index
;
}
public
String
getData
()
{
return
data
;
}
public
void
setData
(
String
data
)
{
this
.
data
=
data
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMFileMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 文件消息元素
*
* @author bingo
* @since 2021/10/29 16:53
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMFileMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
FileMsgContent
msgContent
;
public
TIMFileMsgElement
()
{
super
(
MsgType
.
TIM_FILE_ELEM
);
}
public
TIMFileMsgElement
(
FileMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMFileMsgElement
(
String
url
,
String
uuid
,
Integer
fileSize
,
String
filename
,
Integer
downloadFlag
)
{
this
(
new
FileMsgContent
(
url
,
uuid
,
fileSize
,
filename
,
downloadFlag
));
}
public
FileMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
FileMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
FileMsgContent
{
@JsonProperty
(
"Url"
)
private
String
url
;
@JsonProperty
(
"UUID"
)
private
String
uuid
;
@JsonProperty
(
"FileSize"
)
private
Integer
fileSize
;
@JsonProperty
(
"FileName"
)
private
String
filename
;
@JsonProperty
(
"Download_Flag"
)
private
Integer
downloadFlag
;
public
FileMsgContent
()
{
}
public
FileMsgContent
(
String
url
,
String
uuid
,
Integer
fileSize
,
String
filename
,
Integer
downloadFlag
)
{
this
.
url
=
url
;
this
.
uuid
=
uuid
;
this
.
fileSize
=
fileSize
;
this
.
filename
=
filename
;
this
.
downloadFlag
=
downloadFlag
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
Integer
getFileSize
()
{
return
fileSize
;
}
public
void
setFileSize
(
Integer
fileSize
)
{
this
.
fileSize
=
fileSize
;
}
public
String
getFilename
()
{
return
filename
;
}
public
void
setFilename
(
String
filename
)
{
this
.
filename
=
filename
;
}
public
Integer
getDownloadFlag
()
{
return
downloadFlag
;
}
public
void
setDownloadFlag
(
Integer
downloadFlag
)
{
this
.
downloadFlag
=
downloadFlag
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMImageMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
import
java.util.List
;
/**
* 图像消息元素
*
* @author bingo
* @since 2021/10/29 16:48
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMImageMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
ImageMsgContent
msgContent
;
public
TIMImageMsgElement
()
{
super
(
MsgType
.
TIM_IMAGE_ELEM
);
}
public
TIMImageMsgElement
(
ImageMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMImageMsgElement
(
String
uuid
,
Integer
imageFormat
,
List
<
ImageInfo
>
imageInfoArray
)
{
this
(
new
ImageMsgContent
(
uuid
,
imageFormat
,
imageInfoArray
));
}
public
ImageMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
ImageMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
ImageMsgContent
{
@JsonProperty
(
"UUID"
)
private
String
uuid
;
@JsonProperty
(
"ImageFormat"
)
private
Integer
imageFormat
;
@JsonProperty
(
"ImageInfoArray"
)
private
List
<
ImageInfo
>
imageInfoArray
;
public
ImageMsgContent
()
{
}
public
ImageMsgContent
(
String
uuid
,
Integer
imageFormat
,
List
<
ImageInfo
>
imageInfoArray
)
{
this
.
uuid
=
uuid
;
this
.
imageFormat
=
imageFormat
;
this
.
imageInfoArray
=
imageInfoArray
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
Integer
getImageFormat
()
{
return
imageFormat
;
}
public
void
setImageFormat
(
Integer
imageFormat
)
{
this
.
imageFormat
=
imageFormat
;
}
public
List
<
ImageInfo
>
getImageInfoArray
()
{
return
imageInfoArray
;
}
public
void
setImageInfoArray
(
List
<
ImageInfo
>
imageInfoArray
)
{
this
.
imageInfoArray
=
imageInfoArray
;
}
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
ImageInfo
{
@JsonProperty
(
"Type"
)
private
Integer
type
;
@JsonProperty
(
"Size"
)
private
Integer
size
;
@JsonProperty
(
"Width"
)
private
Integer
width
;
@JsonProperty
(
"Height"
)
private
Integer
height
;
@JsonProperty
(
"URL"
)
private
String
url
;
public
ImageInfo
()
{
}
public
ImageInfo
(
Integer
type
,
Integer
size
,
Integer
width
,
Integer
height
,
String
url
)
{
this
.
type
=
type
;
this
.
size
=
size
;
this
.
width
=
width
;
this
.
height
=
height
;
this
.
url
=
url
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getSize
()
{
return
size
;
}
public
void
setSize
(
Integer
size
)
{
this
.
size
=
size
;
}
public
Integer
getWidth
()
{
return
width
;
}
public
void
setWidth
(
Integer
width
)
{
this
.
width
=
width
;
}
public
Integer
getHeight
()
{
return
height
;
}
public
void
setHeight
(
Integer
height
)
{
this
.
height
=
height
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMLocationMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 地理位置消息元素
*
* @author bingo
* @since 2021/10/29 16:35
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMLocationMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
LocationMsgContent
msgContent
;
public
TIMLocationMsgElement
()
{
super
(
MsgType
.
TIM_LOCATION_ELEM
);
}
public
TIMLocationMsgElement
(
LocationMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMLocationMsgElement
(
String
desc
,
Double
latitude
,
Double
longitude
)
{
this
(
new
LocationMsgContent
(
desc
,
latitude
,
longitude
));
}
public
LocationMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
LocationMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
LocationMsgContent
{
@JsonProperty
(
"Desc"
)
private
String
desc
;
@JsonProperty
(
"Latitude"
)
private
Double
latitude
;
@JsonProperty
(
"Longitude"
)
private
Double
longitude
;
public
LocationMsgContent
()
{
}
public
LocationMsgContent
(
String
desc
,
Double
latitude
,
Double
longitude
)
{
this
.
desc
=
desc
;
this
.
latitude
=
latitude
;
this
.
longitude
=
longitude
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
Double
getLatitude
()
{
return
latitude
;
}
public
void
setLatitude
(
Double
latitude
)
{
this
.
latitude
=
latitude
;
}
public
Double
getLongitude
()
{
return
longitude
;
}
public
void
setLongitude
(
Double
longitude
)
{
this
.
longitude
=
longitude
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* 抽象消息元素
*
* @author bingo
* @since 2021/10/29 16:24
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
abstract
class
TIMMsgElement
{
@JsonProperty
(
"MsgType"
)
private
String
msgType
;
public
TIMMsgElement
(
String
msgType
)
{
this
.
msgType
=
msgType
;
}
public
String
getMsgType
()
{
return
msgType
;
}
}
src/main/java/io/github/doocs/im/model/message/TIMSoundMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 语音消息元素
*
* @author bingo
* @since 2021/10/29 16:44
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMSoundMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
SoundMsgContent
msgContent
;
public
TIMSoundMsgElement
()
{
super
(
MsgType
.
TIM_SOUND_ELEM
);
}
public
TIMSoundMsgElement
(
SoundMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMSoundMsgElement
(
String
url
,
String
uuid
,
Integer
size
,
Integer
second
,
Integer
downloadFlag
)
{
this
(
new
SoundMsgContent
(
url
,
uuid
,
size
,
second
,
downloadFlag
));
}
public
SoundMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
SoundMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
SoundMsgContent
{
@JsonProperty
(
"Url"
)
private
String
url
;
@JsonProperty
(
"UUID"
)
private
String
uuid
;
@JsonProperty
(
"Size"
)
private
Integer
size
;
@JsonProperty
(
"Second"
)
private
Integer
second
;
@JsonProperty
(
"Download_Flag"
)
private
Integer
downloadFlag
;
public
SoundMsgContent
()
{
}
public
SoundMsgContent
(
String
url
,
String
uuid
,
Integer
size
,
Integer
second
,
Integer
downloadFlag
)
{
this
.
url
=
url
;
this
.
uuid
=
uuid
;
this
.
size
=
size
;
this
.
second
=
second
;
this
.
downloadFlag
=
downloadFlag
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
Integer
getSize
()
{
return
size
;
}
public
void
setSize
(
Integer
size
)
{
this
.
size
=
size
;
}
public
Integer
getSecond
()
{
return
second
;
}
public
void
setSecond
(
Integer
second
)
{
this
.
second
=
second
;
}
public
Integer
getDownloadFlag
()
{
return
downloadFlag
;
}
public
void
setDownloadFlag
(
Integer
downloadFlag
)
{
this
.
downloadFlag
=
downloadFlag
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMTextMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 文本消息元素
*
* @author bingo
* @since 2021/10/29 16:25
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMTextMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
TextMsgContent
msgContent
;
public
TIMTextMsgElement
()
{
super
(
MsgType
.
TIM_TEXT_ELEM
);
}
public
TIMTextMsgElement
(
TextMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMTextMsgElement
(
String
text
)
{
this
(
new
TextMsgContent
(
text
));
}
public
TextMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
TextMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
TextMsgContent
{
@JsonProperty
(
"Text"
)
private
String
text
;
public
TextMsgContent
()
{
}
public
TextMsgContent
(
String
text
)
{
this
.
text
=
text
;
}
public
String
getText
()
{
return
text
;
}
public
void
setText
(
String
text
)
{
this
.
text
=
text
;
}
}
}
src/main/java/io/github/doocs/im/model/message/TIMVideoFileMsgElement.java
0 → 100644
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
message
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.constant.MsgType
;
/**
* 视频消息元素
*
* @author bingo
* @since 2021/10/29 16:56
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TIMVideoFileMsgElement
extends
TIMMsgElement
{
@JsonProperty
(
"MsgContent"
)
private
VideoFileMsgContent
msgContent
;
public
TIMVideoFileMsgElement
()
{
super
(
MsgType
.
TIM_VIDEO_FILE_ELEM
);
}
public
TIMVideoFileMsgElement
(
VideoFileMsgContent
msgContent
)
{
this
();
this
.
msgContent
=
msgContent
;
}
public
TIMVideoFileMsgElement
(
String
videoUrl
,
String
videoUuid
,
Integer
videoSize
,
Integer
videoSecond
,
String
videoFormat
,
Integer
videoDownloadFlag
,
String
thumbUrl
,
String
thumbUuid
,
Integer
thumbSize
,
Integer
thumbWidth
,
Integer
thumbHeight
,
String
thumbFormat
,
Integer
thumbDownloadFlag
)
{
this
(
new
VideoFileMsgContent
(
videoUrl
,
videoUuid
,
videoSize
,
videoSecond
,
videoFormat
,
videoDownloadFlag
,
thumbUrl
,
thumbUuid
,
thumbSize
,
thumbWidth
,
thumbHeight
,
thumbFormat
,
thumbDownloadFlag
));
}
public
VideoFileMsgContent
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
VideoFileMsgContent
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
VideoFileMsgContent
{
@JsonProperty
(
"VideoUrl"
)
private
String
videoUrl
;
@JsonProperty
(
"VideoUUID"
)
private
String
videoUuid
;
@JsonProperty
(
"VideoSize"
)
private
Integer
videoSize
;
@JsonProperty
(
"VideoSecond"
)
private
Integer
videoSecond
;
@JsonProperty
(
"VideoFormat"
)
private
String
videoFormat
;
@JsonProperty
(
"VideoDownloadFlag"
)
private
Integer
videoDownloadFlag
;
@JsonProperty
(
"ThumbUrl"
)
private
String
thumbUrl
;
@JsonProperty
(
"ThumbUUID"
)
private
String
thumbUuid
;
@JsonProperty
(
"ThumbSize"
)
private
Integer
thumbSize
;
@JsonProperty
(
"ThumbWidth"
)
private
Integer
thumbWidth
;
@JsonProperty
(
"ThumbHeight"
)
private
Integer
thumbHeight
;
@JsonProperty
(
"ThumbFormat"
)
private
String
thumbFormat
;
@JsonProperty
(
"ThumbDownloadFlag"
)
private
Integer
thumbDownloadFlag
;
public
VideoFileMsgContent
()
{
}
public
VideoFileMsgContent
(
String
videoUrl
,
String
videoUuid
,
Integer
videoSize
,
Integer
videoSecond
,
String
videoFormat
,
Integer
videoDownloadFlag
,
String
thumbUrl
,
String
thumbUuid
,
Integer
thumbSize
,
Integer
thumbWidth
,
Integer
thumbHeight
,
String
thumbFormat
,
Integer
thumbDownloadFlag
)
{
this
.
videoUrl
=
videoUrl
;
this
.
videoUuid
=
videoUuid
;
this
.
videoSize
=
videoSize
;
this
.
videoSecond
=
videoSecond
;
this
.
videoFormat
=
videoFormat
;
this
.
videoDownloadFlag
=
videoDownloadFlag
;
this
.
thumbUrl
=
thumbUrl
;
this
.
thumbUuid
=
thumbUuid
;
this
.
thumbSize
=
thumbSize
;
this
.
thumbWidth
=
thumbWidth
;
this
.
thumbHeight
=
thumbHeight
;
this
.
thumbFormat
=
thumbFormat
;
this
.
thumbDownloadFlag
=
thumbDownloadFlag
;
}
public
String
getVideoUrl
()
{
return
videoUrl
;
}
public
void
setVideoUrl
(
String
videoUrl
)
{
this
.
videoUrl
=
videoUrl
;
}
public
String
getVideoUuid
()
{
return
videoUuid
;
}
public
void
setVideoUuid
(
String
videoUuid
)
{
this
.
videoUuid
=
videoUuid
;
}
public
Integer
getVideoSize
()
{
return
videoSize
;
}
public
void
setVideoSize
(
Integer
videoSize
)
{
this
.
videoSize
=
videoSize
;
}
public
Integer
getVideoSecond
()
{
return
videoSecond
;
}
public
void
setVideoSecond
(
Integer
videoSecond
)
{
this
.
videoSecond
=
videoSecond
;
}
public
String
getVideoFormat
()
{
return
videoFormat
;
}
public
void
setVideoFormat
(
String
videoFormat
)
{
this
.
videoFormat
=
videoFormat
;
}
public
Integer
getVideoDownloadFlag
()
{
return
videoDownloadFlag
;
}
public
void
setVideoDownloadFlag
(
Integer
videoDownloadFlag
)
{
this
.
videoDownloadFlag
=
videoDownloadFlag
;
}
public
String
getThumbUrl
()
{
return
thumbUrl
;
}
public
void
setThumbUrl
(
String
thumbUrl
)
{
this
.
thumbUrl
=
thumbUrl
;
}
public
String
getThumbUuid
()
{
return
thumbUuid
;
}
public
void
setThumbUuid
(
String
thumbUuid
)
{
this
.
thumbUuid
=
thumbUuid
;
}
public
Integer
getThumbSize
()
{
return
thumbSize
;
}
public
void
setThumbSize
(
Integer
thumbSize
)
{
this
.
thumbSize
=
thumbSize
;
}
public
Integer
getThumbWidth
()
{
return
thumbWidth
;
}
public
void
setThumbWidth
(
Integer
thumbWidth
)
{
this
.
thumbWidth
=
thumbWidth
;
}
public
Integer
getThumbHeight
()
{
return
thumbHeight
;
}
public
void
setThumbHeight
(
Integer
thumbHeight
)
{
this
.
thumbHeight
=
thumbHeight
;
}
public
String
getThumbFormat
()
{
return
thumbFormat
;
}
public
void
setThumbFormat
(
String
thumbFormat
)
{
this
.
thumbFormat
=
thumbFormat
;
}
public
Integer
getThumbDownloadFlag
()
{
return
thumbDownloadFlag
;
}
public
void
setThumbDownloadFlag
(
Integer
thumbDownloadFlag
)
{
this
.
thumbDownloadFlag
=
thumbDownloadFlag
;
}
}
}
src/main/java/io/github/doocs/im/model/request/BatchSendMsgRequest.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -28,7 +28,7 @@ public class BatchSendMsgRequest {
...
@@ -28,7 +28,7 @@ public class BatchSendMsgRequest {
private
Integer
msgRandom
;
private
Integer
msgRandom
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"CloudCustomData"
)
@JsonProperty
(
"CloudCustomData"
)
private
String
cloudCustomData
;
private
String
cloudCustomData
;
...
@@ -42,7 +42,7 @@ public class BatchSendMsgRequest {
...
@@ -42,7 +42,7 @@ public class BatchSendMsgRequest {
public
BatchSendMsgRequest
()
{
public
BatchSendMsgRequest
()
{
}
}
public
BatchSendMsgRequest
(
Integer
syncOtherMachine
,
String
fromAccount
,
List
<
String
>
toAccount
,
Integer
msgSeq
,
Integer
msgRandom
,
List
<
MsgBodyItem
>
msgBody
,
String
cloudCustomData
,
List
<
String
>
sendMsgControl
,
OfflinePushInfo
offlinePushInfo
)
{
public
BatchSendMsgRequest
(
Integer
syncOtherMachine
,
String
fromAccount
,
List
<
String
>
toAccount
,
Integer
msgSeq
,
Integer
msgRandom
,
List
<
TIMMsgElement
>
msgBody
,
String
cloudCustomData
,
List
<
String
>
sendMsgControl
,
OfflinePushInfo
offlinePushInfo
)
{
this
.
syncOtherMachine
=
syncOtherMachine
;
this
.
syncOtherMachine
=
syncOtherMachine
;
this
.
fromAccount
=
fromAccount
;
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
toAccount
=
toAccount
;
...
@@ -94,11 +94,11 @@ public class BatchSendMsgRequest {
...
@@ -94,11 +94,11 @@ public class BatchSendMsgRequest {
this
.
msgRandom
=
msgRandom
;
this
.
msgRandom
=
msgRandom
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
...
src/main/java/io/github/doocs/im/model/request/IMPushRequest.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -20,7 +20,7 @@ public class IMPushRequest extends GenericRequest {
...
@@ -20,7 +20,7 @@ public class IMPushRequest extends GenericRequest {
private
Integer
msgRandom
;
private
Integer
msgRandom
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"MsgLifeTime"
)
@JsonProperty
(
"MsgLifeTime"
)
private
Integer
msgLifeTime
;
private
Integer
msgLifeTime
;
...
@@ -31,6 +31,18 @@ public class IMPushRequest extends GenericRequest {
...
@@ -31,6 +31,18 @@ public class IMPushRequest extends GenericRequest {
@JsonProperty
(
"OfflinePushInfo"
)
@JsonProperty
(
"OfflinePushInfo"
)
private
OfflinePushInfo
offlinePushInfo
;
private
OfflinePushInfo
offlinePushInfo
;
public
IMPushRequest
()
{
}
public
IMPushRequest
(
Map
<
String
,
Object
>
condition
,
Integer
msgRandom
,
List
<
TIMMsgElement
>
msgBody
,
Integer
msgLifeTime
,
String
fromAccount
,
OfflinePushInfo
offlinePushInfo
)
{
this
.
condition
=
condition
;
this
.
msgRandom
=
msgRandom
;
this
.
msgBody
=
msgBody
;
this
.
msgLifeTime
=
msgLifeTime
;
this
.
fromAccount
=
fromAccount
;
this
.
offlinePushInfo
=
offlinePushInfo
;
}
public
Map
<
String
,
Object
>
getCondition
()
{
public
Map
<
String
,
Object
>
getCondition
()
{
return
condition
;
return
condition
;
}
}
...
@@ -47,11 +59,11 @@ public class IMPushRequest extends GenericRequest {
...
@@ -47,11 +59,11 @@ public class IMPushRequest extends GenericRequest {
this
.
msgRandom
=
msgRandom
;
this
.
msgRandom
=
msgRandom
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
...
src/main/java/io/github/doocs/im/model/request/ImportGroupMsgListItem.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,7 +22,17 @@ public class ImportGroupMsgListItem {
...
@@ -22,7 +22,17 @@ public class ImportGroupMsgListItem {
private
Integer
random
;
private
Integer
random
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
public
ImportGroupMsgListItem
()
{
}
public
ImportGroupMsgListItem
(
String
fromAccount
,
Integer
sendTime
,
Integer
random
,
List
<
TIMMsgElement
>
msgBody
)
{
this
.
fromAccount
=
fromAccount
;
this
.
sendTime
=
sendTime
;
this
.
random
=
random
;
this
.
msgBody
=
msgBody
;
}
public
String
getFromAccount
()
{
public
String
getFromAccount
()
{
return
fromAccount
;
return
fromAccount
;
...
@@ -48,11 +58,11 @@ public class ImportGroupMsgListItem {
...
@@ -48,11 +58,11 @@ public class ImportGroupMsgListItem {
this
.
random
=
random
;
this
.
random
=
random
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
}
}
src/main/java/io/github/doocs/im/model/request/ImportMsgRequest.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,7 +31,7 @@ public class ImportMsgRequest extends GenericRequest {
...
@@ -31,7 +31,7 @@ public class ImportMsgRequest extends GenericRequest {
private
Integer
msgTimeStamp
;
private
Integer
msgTimeStamp
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"CloudCustomData"
)
@JsonProperty
(
"CloudCustomData"
)
private
String
cloudCustomData
;
private
String
cloudCustomData
;
...
@@ -39,7 +39,7 @@ public class ImportMsgRequest extends GenericRequest {
...
@@ -39,7 +39,7 @@ public class ImportMsgRequest extends GenericRequest {
public
ImportMsgRequest
()
{
public
ImportMsgRequest
()
{
}
}
public
ImportMsgRequest
(
Integer
syncFromOldSystem
,
String
fromAccount
,
String
toAccount
,
Integer
msgSeq
,
Integer
msgRandom
,
Integer
msgTimeStamp
,
List
<
MsgBodyItem
>
msgBody
,
String
cloudCustomData
)
{
public
ImportMsgRequest
(
Integer
syncFromOldSystem
,
String
fromAccount
,
String
toAccount
,
Integer
msgSeq
,
Integer
msgRandom
,
Integer
msgTimeStamp
,
List
<
TIMMsgElement
>
msgBody
,
String
cloudCustomData
)
{
this
.
syncFromOldSystem
=
syncFromOldSystem
;
this
.
syncFromOldSystem
=
syncFromOldSystem
;
this
.
fromAccount
=
fromAccount
;
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
toAccount
=
toAccount
;
...
@@ -98,11 +98,11 @@ public class ImportMsgRequest extends GenericRequest {
...
@@ -98,11 +98,11 @@ public class ImportMsgRequest extends GenericRequest {
this
.
msgTimeStamp
=
msgTimeStamp
;
this
.
msgTimeStamp
=
msgTimeStamp
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
...
src/main/java/io/github/doocs/im/model/request/MsgGroupItem.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,12 +22,12 @@ public class MsgGroupItem {
...
@@ -22,12 +22,12 @@ public class MsgGroupItem {
private
Integer
random
;
private
Integer
random
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
public
MsgGroupItem
()
{
public
MsgGroupItem
()
{
}
}
public
MsgGroupItem
(
String
fromAccount
,
Integer
sendTime
,
Integer
random
,
List
<
MsgBodyItem
>
msgBody
)
{
public
MsgGroupItem
(
String
fromAccount
,
Integer
sendTime
,
Integer
random
,
List
<
TIMMsgElement
>
msgBody
)
{
this
.
fromAccount
=
fromAccount
;
this
.
fromAccount
=
fromAccount
;
this
.
sendTime
=
sendTime
;
this
.
sendTime
=
sendTime
;
this
.
random
=
random
;
this
.
random
=
random
;
...
@@ -58,11 +58,11 @@ public class MsgGroupItem {
...
@@ -58,11 +58,11 @@ public class MsgGroupItem {
this
.
random
=
random
;
this
.
random
=
random
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
}
}
...
...
src/main/java/io/github/doocs/im/model/request/SendGroupMsgRequest.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,7 +22,7 @@ public class SendGroupMsgRequest extends GenericRequest {
...
@@ -22,7 +22,7 @@ public class SendGroupMsgRequest extends GenericRequest {
private
String
msgPriority
;
private
String
msgPriority
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"From_Account"
)
@JsonProperty
(
"From_Account"
)
private
String
fromAccount
;
private
String
fromAccount
;
...
@@ -45,7 +45,7 @@ public class SendGroupMsgRequest extends GenericRequest {
...
@@ -45,7 +45,7 @@ public class SendGroupMsgRequest extends GenericRequest {
public
SendGroupMsgRequest
()
{
public
SendGroupMsgRequest
()
{
}
}
public
SendGroupMsgRequest
(
String
groupId
,
Integer
random
,
String
msgPriority
,
List
<
MsgBodyItem
>
msgBody
,
String
fromAccount
,
OfflinePushInfo
offlinePushInfo
,
List
<
String
>
forbidCallbackControl
,
Integer
onlineOnlyFlag
,
List
<
String
>
sendMsgControl
,
String
cloudCustomData
)
{
public
SendGroupMsgRequest
(
String
groupId
,
Integer
random
,
String
msgPriority
,
List
<
TIMMsgElement
>
msgBody
,
String
fromAccount
,
OfflinePushInfo
offlinePushInfo
,
List
<
String
>
forbidCallbackControl
,
Integer
onlineOnlyFlag
,
List
<
String
>
sendMsgControl
,
String
cloudCustomData
)
{
this
.
groupId
=
groupId
;
this
.
groupId
=
groupId
;
this
.
random
=
random
;
this
.
random
=
random
;
this
.
msgPriority
=
msgPriority
;
this
.
msgPriority
=
msgPriority
;
...
@@ -82,11 +82,11 @@ public class SendGroupMsgRequest extends GenericRequest {
...
@@ -82,11 +82,11 @@ public class SendGroupMsgRequest extends GenericRequest {
this
.
msgPriority
=
msgPriority
;
this
.
msgPriority
=
msgPriority
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
...
src/main/java/io/github/doocs/im/model/request/SendMsgRequest.java
View file @
622e5bf1
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
...
@@ -2,7 +2,7 @@ package io.github.doocs.im.model.request;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.
response.MsgBodyItem
;
import
io.github.doocs.im.model.
message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -40,7 +40,7 @@ public class SendMsgRequest extends GenericRequest {
...
@@ -40,7 +40,7 @@ public class SendMsgRequest extends GenericRequest {
private
List
<
String
>
sendMsgControl
;
private
List
<
String
>
sendMsgControl
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"CloudCustomData"
)
@JsonProperty
(
"CloudCustomData"
)
private
String
cloudCustomData
;
private
String
cloudCustomData
;
...
@@ -51,7 +51,7 @@ public class SendMsgRequest extends GenericRequest {
...
@@ -51,7 +51,7 @@ public class SendMsgRequest extends GenericRequest {
public
SendMsgRequest
()
{
public
SendMsgRequest
()
{
}
}
public
SendMsgRequest
(
Integer
syncOtherMachine
,
String
fromAccount
,
String
toAccount
,
Integer
msgLifeTime
,
Integer
msgSeq
,
Integer
msgRandom
,
Integer
msgTimeStamp
,
List
<
String
>
forbidCallbackControl
,
List
<
String
>
sendMsgControl
,
List
<
MsgBodyItem
>
msgBody
,
String
cloudCustomData
,
OfflinePushInfo
offlinePushInfo
)
{
public
SendMsgRequest
(
Integer
syncOtherMachine
,
String
fromAccount
,
String
toAccount
,
Integer
msgLifeTime
,
Integer
msgSeq
,
Integer
msgRandom
,
Integer
msgTimeStamp
,
List
<
String
>
forbidCallbackControl
,
List
<
String
>
sendMsgControl
,
List
<
TIMMsgElement
>
msgBody
,
String
cloudCustomData
,
OfflinePushInfo
offlinePushInfo
)
{
this
.
syncOtherMachine
=
syncOtherMachine
;
this
.
syncOtherMachine
=
syncOtherMachine
;
this
.
fromAccount
=
fromAccount
;
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
toAccount
=
toAccount
;
...
@@ -138,11 +138,11 @@ public class SendMsgRequest extends GenericRequest {
...
@@ -138,11 +138,11 @@ public class SendMsgRequest extends GenericRequest {
this
.
sendMsgControl
=
sendMsgControl
;
this
.
sendMsgControl
=
sendMsgControl
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
...
src/main/java/io/github/doocs/im/model/response/MsgBodyItem.java
deleted
100644 → 0
View file @
12e52f86
package
io
.
github
.
doocs
.
im
.
model
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/28 20:42
*/
public
class
MsgBodyItem
{
@JsonProperty
(
"MsgType"
)
private
String
msgType
;
@JsonProperty
(
"MsgContent"
)
private
Object
msgContent
;
public
String
getMsgType
()
{
return
msgType
;
}
public
void
setMsgType
(
String
msgType
)
{
this
.
msgType
=
msgType
;
}
public
Object
getMsgContent
()
{
return
msgContent
;
}
public
void
setMsgContent
(
Object
msgContent
)
{
this
.
msgContent
=
msgContent
;
}
@Override
public
String
toString
()
{
return
"MsgBodyItem{"
+
"msgType='"
+
msgType
+
'\''
+
", msgContent="
+
msgContent
+
'}'
;
}
}
src/main/java/io/github/doocs/im/model/response/MsgContentItem.java
deleted
100644 → 0
View file @
12e52f86
package
io
.
github
.
doocs
.
im
.
model
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* @author hyh
* @since 2021/07/28 20:52
*/
public
class
MsgContentItem
{
@JsonProperty
(
"Text"
)
private
String
text
;
public
String
getText
()
{
return
text
;
}
public
void
setText
(
String
text
)
{
this
.
text
=
text
;
}
}
src/main/java/io/github/doocs/im/model/response/MsgListItem.java
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
response
;
package
io
.
github
.
doocs
.
im
.
model
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,11 +32,26 @@ public class MsgListItem {
...
@@ -31,11 +32,26 @@ public class MsgListItem {
private
String
msgKey
;
private
String
msgKey
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"CloudCustomData"
)
@JsonProperty
(
"CloudCustomData"
)
private
String
cloudCustomData
;
private
String
cloudCustomData
;
public
MsgListItem
()
{
}
public
MsgListItem
(
String
fromAccount
,
String
toAccount
,
Integer
msgSeq
,
Integer
msgRandom
,
Integer
msgTimeStamp
,
Integer
msgFlagBits
,
String
msgKey
,
List
<
TIMMsgElement
>
msgBody
,
String
cloudCustomData
)
{
this
.
fromAccount
=
fromAccount
;
this
.
toAccount
=
toAccount
;
this
.
msgSeq
=
msgSeq
;
this
.
msgRandom
=
msgRandom
;
this
.
msgTimeStamp
=
msgTimeStamp
;
this
.
msgFlagBits
=
msgFlagBits
;
this
.
msgKey
=
msgKey
;
this
.
msgBody
=
msgBody
;
this
.
cloudCustomData
=
cloudCustomData
;
}
public
String
getFromAccount
()
{
public
String
getFromAccount
()
{
return
fromAccount
;
return
fromAccount
;
}
}
...
@@ -92,11 +108,11 @@ public class MsgListItem {
...
@@ -92,11 +108,11 @@ public class MsgListItem {
this
.
msgKey
=
msgKey
;
this
.
msgKey
=
msgKey
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
...
src/main/java/io/github/doocs/im/model/response/RspMsgItem.java
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
.
model
.
response
;
package
io
.
github
.
doocs
.
im
.
model
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.github.doocs.im.model.message.TIMMsgElement
;
import
java.util.List
;
import
java.util.List
;
...
@@ -16,7 +17,7 @@ public class RspMsgItem {
...
@@ -16,7 +17,7 @@ public class RspMsgItem {
private
Integer
isPlaceMsg
;
private
Integer
isPlaceMsg
;
@JsonProperty
(
"MsgBody"
)
@JsonProperty
(
"MsgBody"
)
private
List
<
MsgBodyItem
>
msgBody
;
private
List
<
TIMMsgElement
>
msgBody
;
@JsonProperty
(
"MsgPriority"
)
@JsonProperty
(
"MsgPriority"
)
private
Integer
msgPriority
;
private
Integer
msgPriority
;
...
@@ -30,6 +31,19 @@ public class RspMsgItem {
...
@@ -30,6 +31,19 @@ public class RspMsgItem {
@JsonProperty
(
"MsgTimeStamp"
)
@JsonProperty
(
"MsgTimeStamp"
)
private
Integer
msgTimeStamp
;
private
Integer
msgTimeStamp
;
public
RspMsgItem
()
{
}
public
RspMsgItem
(
String
fromAccount
,
Integer
isPlaceMsg
,
List
<
TIMMsgElement
>
msgBody
,
Integer
msgPriority
,
Integer
msgRandom
,
Integer
msgSeq
,
Integer
msgTimeStamp
)
{
this
.
fromAccount
=
fromAccount
;
this
.
isPlaceMsg
=
isPlaceMsg
;
this
.
msgBody
=
msgBody
;
this
.
msgPriority
=
msgPriority
;
this
.
msgRandom
=
msgRandom
;
this
.
msgSeq
=
msgSeq
;
this
.
msgTimeStamp
=
msgTimeStamp
;
}
public
String
getFromAccount
()
{
public
String
getFromAccount
()
{
return
fromAccount
;
return
fromAccount
;
}
}
...
@@ -46,11 +60,11 @@ public class RspMsgItem {
...
@@ -46,11 +60,11 @@ public class RspMsgItem {
this
.
isPlaceMsg
=
isPlaceMsg
;
this
.
isPlaceMsg
=
isPlaceMsg
;
}
}
public
List
<
MsgBodyItem
>
getMsgBody
()
{
public
List
<
TIMMsgElement
>
getMsgBody
()
{
return
msgBody
;
return
msgBody
;
}
}
public
void
setMsgBody
(
List
<
MsgBodyItem
>
msgBody
)
{
public
void
setMsgBody
(
List
<
TIMMsgElement
>
msgBody
)
{
this
.
msgBody
=
msgBody
;
this
.
msgBody
=
msgBody
;
}
}
...
@@ -85,17 +99,4 @@ public class RspMsgItem {
...
@@ -85,17 +99,4 @@ public class RspMsgItem {
public
void
setMsgTimeStamp
(
Integer
msgTimeStamp
)
{
public
void
setMsgTimeStamp
(
Integer
msgTimeStamp
)
{
this
.
msgTimeStamp
=
msgTimeStamp
;
this
.
msgTimeStamp
=
msgTimeStamp
;
}
}
@Override
public
String
toString
()
{
return
"RspMsgItem{"
+
"fromAccount='"
+
fromAccount
+
'\''
+
", isPlaceMsg="
+
isPlaceMsg
+
", msgBody="
+
msgBody
+
", msgPriority="
+
msgPriority
+
", msgRandom="
+
msgRandom
+
", msgSeq="
+
msgSeq
+
", msgTimeStamp="
+
msgTimeStamp
+
'}'
;
}
}
}
src/test/java/io/github/doocs/im/GroupTest.java
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
;
package
io
.
github
.
doocs
.
im
;
import
io.github.doocs.im.model.message.TIMTextMsgElement
;
import
io.github.doocs.im.model.request.*
;
import
io.github.doocs.im.model.request.*
;
import
io.github.doocs.im.model.response.*
;
import
io.github.doocs.im.model.response.*
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
@@ -185,13 +186,12 @@ public class GroupTest {
...
@@ -185,13 +186,12 @@ public class GroupTest {
SendGroupMsgRequest
request
=
new
SendGroupMsgRequest
();
SendGroupMsgRequest
request
=
new
SendGroupMsgRequest
();
request
.
setRandom
(
1212
);
request
.
setRandom
(
1212
);
request
.
setGroupId
(
"MyFirstGroup"
);
request
.
setGroupId
(
"MyFirstGroup"
);
MsgBodyItem
item
=
new
MsgBodyItem
();
item
.
setMsgType
(
"TIMTextElem"
);
TIMTextMsgElement
msg
=
new
TIMTextMsgElement
(
"red packet"
);
MsgContentItem
contentItem
=
new
MsgContentItem
();
request
.
setMsgBody
(
Collections
.
singletonList
(
msg
));
contentItem
.
setText
(
"red packet"
);
item
.
setMsgContent
(
contentItem
);
request
.
setMsgBody
(
Collections
.
singletonList
(
item
));
SendGroupMsgResult
result
=
client
.
group
.
sendGroupMsg
(
request
);
SendGroupMsgResult
result
=
client
.
group
.
sendGroupMsg
(
request
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
0
,
(
int
)
result
.
getErrorCode
());
Assert
.
assertEquals
(
0
,
(
int
)
result
.
getErrorCode
());
}
}
...
@@ -249,12 +249,8 @@ public class GroupTest {
...
@@ -249,12 +249,8 @@ public class GroupTest {
item
.
setFromAccount
(
"bingo"
);
item
.
setFromAccount
(
"bingo"
);
item
.
setSendTime
(
1628062005
);
item
.
setSendTime
(
1628062005
);
MsgBodyItem
bodyItem
=
new
MsgBodyItem
();
TIMTextMsgElement
msg
=
new
TIMTextMsgElement
(
"hello world"
);
MsgContentItem
contentItem
=
new
MsgContentItem
();
item
.
setMsgBody
(
Collections
.
singletonList
(
msg
));
contentItem
.
setText
(
"hello world"
);
bodyItem
.
setMsgContent
(
contentItem
);
bodyItem
.
setMsgType
(
"TIMTextElem"
);
item
.
setMsgBody
(
Collections
.
singletonList
(
bodyItem
));
request
.
setMsgList
(
Collections
.
singletonList
(
item
));
request
.
setMsgList
(
Collections
.
singletonList
(
item
));
ImportGroupMsgResult
result
=
client
.
group
.
importGroupMsg
(
request
);
ImportGroupMsgResult
result
=
client
.
group
.
importGroupMsg
(
request
);
...
...
src/test/java/io/github/doocs/im/MemberTest.java
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
;
package
io
.
github
.
doocs
.
im
;
import
io.github.doocs.im.model.message.TIMTextMsgElement
;
import
io.github.doocs.im.model.request.*
;
import
io.github.doocs.im.model.request.*
;
import
io.github.doocs.im.model.response.*
;
import
io.github.doocs.im.model.response.*
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
@@ -36,11 +37,8 @@ public class MemberTest {
...
@@ -36,11 +37,8 @@ public class MemberTest {
request
.
setFromAccount
(
"admin"
);
request
.
setFromAccount
(
"admin"
);
request
.
setMsgRandom
(
9312457
);
request
.
setMsgRandom
(
9312457
);
request
.
setMsgLifeTime
(
120
);
request
.
setMsgLifeTime
(
120
);
MsgBodyItem
item
=
new
MsgBodyItem
();
TIMTextMsgElement
msg
=
new
TIMTextMsgElement
(
"hi, beauty"
);
MsgContentItem
contentItem
=
new
MsgContentItem
();
request
.
setMsgBody
(
Collections
.
singletonList
(
msg
));
contentItem
.
setText
(
"hi, beauty"
);
item
.
setMsgContent
(
contentItem
);
request
.
setMsgBody
(
Collections
.
singletonList
(
item
));
IMPushResult
result
=
client
.
member
.
imPush
(
request
);
IMPushResult
result
=
client
.
member
.
imPush
(
request
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
...
...
src/test/java/io/github/doocs/im/MessageTest.java
View file @
622e5bf1
package
io
.
github
.
doocs
.
im
;
package
io
.
github
.
doocs
.
im
;
import
io.github.doocs.im.model.message.TIMTextMsgElement
;
import
io.github.doocs.im.model.request.*
;
import
io.github.doocs.im.model.request.*
;
import
io.github.doocs.im.model.response.*
;
import
io.github.doocs.im.model.response.*
;
import
org.junit.Assert
;
import
org.junit.Assert
;
...
@@ -41,12 +42,8 @@ public class MessageTest {
...
@@ -41,12 +42,8 @@ public class MessageTest {
request
.
setMsgRandom
(
123
);
request
.
setMsgRandom
(
123
);
request
.
setMsgTimeStamp
(
1631934058
);
request
.
setMsgTimeStamp
(
1631934058
);
request
.
setMsgLifeTime
(
604800
);
request
.
setMsgLifeTime
(
604800
);
MsgBodyItem
item
=
new
MsgBodyItem
();
TIMTextMsgElement
msg
=
new
TIMTextMsgElement
(
"hello world"
);
item
.
setMsgType
(
"TIMTextElem"
);
request
.
setMsgBody
(
Collections
.
singletonList
(
msg
));
MsgContentItem
contentItem
=
new
MsgContentItem
();
contentItem
.
setText
(
"hello world"
);
item
.
setMsgContent
(
contentItem
);
request
.
setMsgBody
(
Collections
.
singletonList
(
item
));
SendMsgResult
result
=
client
.
message
.
sendMsg
(
request
);
SendMsgResult
result
=
client
.
message
.
sendMsg
(
request
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
...
@@ -59,12 +56,8 @@ public class MessageTest {
...
@@ -59,12 +56,8 @@ public class MessageTest {
request
.
setToAccount
(
Arrays
.
asList
(
"test1"
,
"test2"
));
request
.
setToAccount
(
Arrays
.
asList
(
"test1"
,
"test2"
));
request
.
setMsgSeq
(
28460
);
request
.
setMsgSeq
(
28460
);
request
.
setMsgRandom
(
1992121
);
request
.
setMsgRandom
(
1992121
);
MsgBodyItem
item
=
new
MsgBodyItem
();
TIMTextMsgElement
msg
=
new
TIMTextMsgElement
(
"hi bingo"
);
item
.
setMsgType
(
"TIMTextElem"
);
request
.
setMsgBody
(
Collections
.
singletonList
(
msg
));
MsgContentItem
contentItem
=
new
MsgContentItem
();
contentItem
.
setText
(
"hi bingo"
);
item
.
setMsgContent
(
contentItem
);
request
.
setMsgBody
(
Collections
.
singletonList
(
item
));
BatchSendMsgResult
result
=
client
.
message
.
batchSendMsg
(
request
);
BatchSendMsgResult
result
=
client
.
message
.
batchSendMsg
(
request
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
Assert
.
assertEquals
(
"OK"
,
result
.
getActionStatus
());
...
@@ -79,12 +72,8 @@ public class MessageTest {
...
@@ -79,12 +72,8 @@ public class MessageTest {
request
.
setMsgSeq
(
123
);
request
.
setMsgSeq
(
123
);
request
.
setMsgRandom
(
122
);
request
.
setMsgRandom
(
122
);
request
.
setMsgTimeStamp
(
1557387418
);
request
.
setMsgTimeStamp
(
1557387418
);
MsgBodyItem
item
=
new
MsgBodyItem
();
TIMTextMsgElement
msg
=
new
TIMTextMsgElement
(
"hello bingo"
);
item
.
setMsgType
(
"TIMTextElem"
);
request
.
setMsgBody
(
Collections
.
singletonList
(
msg
));
MsgContentItem
contentItem
=
new
MsgContentItem
();
contentItem
.
setText
(
"hello bingo"
);
item
.
setMsgContent
(
contentItem
);
request
.
setMsgBody
(
Collections
.
singletonList
(
item
));
ImportMsgResult
result
=
client
.
message
.
importMsg
(
request
);
ImportMsgResult
result
=
client
.
message
.
importMsg
(
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