|
@@ -765,10 +765,9 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
String size = jsonObject.getString("size");
|
|
|
int duration = jsonObject.getInteger("duration");
|
|
|
String content = jsonObject.getString("content");
|
|
|
- String name = jsonObject.getString("name");
|
|
|
TencentRequest.MessageBody body1 = null;
|
|
|
try {
|
|
|
- body1 = getTimVideoFileElem(sightUrl,size,duration,content,name);
|
|
|
+ body1 = getTimVideoFileElem(sightUrl,size,duration,content);
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -891,10 +890,9 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
String size = jsonObject.getString("size");
|
|
|
int duration = jsonObject.getInteger("duration");
|
|
|
String content = jsonObject.getString("content");
|
|
|
- String name = jsonObject.getString("name");
|
|
|
TencentRequest.MessageBody body1 = null;
|
|
|
try {
|
|
|
- body1 = getTimVideoFileElem(sightUrl,size,duration,content,name);
|
|
|
+ body1 = getTimVideoFileElem(sightUrl,size,duration,content);
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -938,6 +936,8 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
groupImportMessage.setMsgList(list);
|
|
|
try {
|
|
|
imPluginContext.getPluginService().importGroupMessage(groupImportMessage);
|
|
|
+ //为已导入数据更改标识
|
|
|
+ imGroupService.updateStatus(info);
|
|
|
} catch (Exception e) {
|
|
|
log.error("导入群组IM消息失败 msg:{}",list,e);
|
|
|
}
|
|
@@ -1012,7 +1012,7 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
}
|
|
|
|
|
|
//构建视频请求体
|
|
|
- public TencentRequest.MessageBody getTimVideoFileElem(String sightUrl, String size, int duration, String content,String name) throws IOException {
|
|
|
+ public TencentRequest.MessageBody getTimVideoFileElem(String sightUrl, String size, int duration, String content) throws IOException {
|
|
|
if (StringUtils.isEmpty(sightUrl) && StringUtils.isEmpty(sightUrl) && duration == 0) {
|
|
|
return null;
|
|
|
}
|
|
@@ -1028,26 +1028,9 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
format = "JPG";
|
|
|
}
|
|
|
|
|
|
- //获取JDK8里的解码器Base64.Decoder,将base64字符串转为字节数组
|
|
|
- //byte[] bytes = Base64.getDecoder().decode(content);
|
|
|
- //构建字节数组输入流
|
|
|
- //bais = new ByteArrayInputStream(bytes);
|
|
|
-
|
|
|
- //获取图片类型
|
|
|
- //String suffix = name.substring(name.lastIndexOf(".") + 1);
|
|
|
- //获取JDK8里的解码器Base64.Decoder,将base64字符串转为字节数组
|
|
|
byte[] bytes = Base64.getDecoder().decode(content);
|
|
|
//构建字节数组输入流
|
|
|
bais = new ByteArrayInputStream(bytes);
|
|
|
- /* //通过ImageIO把字节数组输入流转为BufferedImage
|
|
|
- BufferedImage bufferedImage = ImageIO.read(bais);
|
|
|
-
|
|
|
- //构建文件
|
|
|
- File imageFile = new File(name);
|
|
|
- //写入生成文件
|
|
|
- ImageIO.write(bufferedImage, format, imageFile);*/
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -1063,6 +1046,8 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
|
|
|
.suffix(format)
|
|
|
.build();
|
|
|
|
|
|
+ // 获取图片基本信息
|
|
|
+ ImageUtil.imageToBase64(imageReq);
|
|
|
|
|
|
ImHistoryMessageWrapper.TimVideoFileElem timVideoFileElem = new ImHistoryMessageWrapper.TimVideoFileElem();
|
|
|
timVideoFileElem.setVideoUrl(sightUrl);
|