Browse Source

群消息修改

zouxuan 3 years ago
parent
commit
35334c5e30

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImSendGroupMessageServiceImpl.java

@@ -71,6 +71,10 @@ public class ImSendGroupMessageServiceImpl extends BaseServiceImpl<Long, ImSendG
 		if(message.getSendFlag()){
 			throw new BizException("消息已发送");
 		}
+		//如果是图片类型,图片地址不能为空
+		if((imSendGroupMessage.getMessageType() == ImSendTypeEnum.IMG || imSendGroupMessage.getMessageType() == ImSendTypeEnum.FILE) && StringUtils.isBlank(imSendGroupMessage.getFileUrl())){
+			throw new BizException("文件地址不能为空");
+		}
 		imSendGroupMessageDao.update(imSendGroupMessage);
 	}
 

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/ImSendGroupMessageMapper.xml

@@ -79,10 +79,10 @@
 			extra = #{extra},
 			</if>
 			<if test="updateTime != null">
-			update_time_ = #{updateTime},
+				update_time_ = #{updateTime},
 			</if>
-			<if test="fileUrl != null">
-			file_url_ = #{fileUrl},
+			<if test="fileUrl != null and fileUrl != ''">
+				file_url_ = #{fileUrl},
 			</if>
 			</set> WHERE id_ = #{id}
 	</update>