Browse Source

修复朋友列表报错问题

udream-cxs 4 năm trước cách đây
mục cha
commit
9cb46c243e

+ 7 - 1
lift-ud-service/src/main/java/cn/com/ty/lift/ud/chat/service/impl/ChatSessionServiceImpl.java

@@ -148,7 +148,13 @@ public class ChatSessionServiceImpl extends ServiceImpl<ChatSessionMapper, ChatS
             RoomInfo roomInfo = Optional.ofNullable(JSONObject.parseObject(redis.get("ROOM:" + entity.getSessionid()), RoomInfo.class)).orElseGet(() -> {
                 RoomInfo roomInfo1 = new RoomInfo();
                 List<ChatMsgEntity> msgList = msgService.list(new QueryWrapper<ChatMsgEntity>().eq("sessionid", entity.getSessionid()).last("order by create_time limit 1"));
-                ChatMsgEntity lastMsg = Optional.ofNullable(msgList.get(0)).orElse(new ChatMsgEntity());
+                Optional<List<ChatMsgEntity>> msgListOption = Optional.ofNullable(msgList);
+                ChatMsgEntity lastMsg = null;
+                if (msgListOption.isPresent()){
+                    lastMsg = msgListOption.get().get(0);
+                } else{
+                    lastMsg = new ChatMsgEntity();
+                }
                 Long lastTimeStamp = Optional.ofNullable(lastMsg.getCreateTime()).map(localDateTime -> localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()).orElse(null);
 
                 roomInfo1.setLastTime(lastTimeStamp);

+ 1 - 0
lift-ud-service/src/main/java/cn/com/ty/lift/ud/operation/mapper/entity/VipFeeSettingEntity.java

@@ -70,6 +70,7 @@ public class VipFeeSettingEntity extends BaseEntity {
         /**
          * 体验卡标记1:体验,0:正常卡片 默认是正常卡片
          */
+        @TableField(value = "experience_card")
         @ApiModelProperty("体验卡标记1:体验,0:正常卡片 默认是正常卡片")
         private Integer experienceCard;