房间心愿单:消息解析异常问题处理

This commit is contained in:
huangjian
2022-10-20 19:11:02 +08:00
parent 79bcb6860b
commit 8167d51fb9

View File

@@ -2,6 +2,7 @@ package com.mango.core.im.custom.bean;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.google.gson.Gson;
import com.mango.core.room.wishlist.WishItemInfo;
import java.util.List;
@@ -39,8 +40,10 @@ public class WishListAttachment extends CustomAttachment {
@Override
protected void parseData(JSONObject data) {
roomUid = data.getLongValue("roomUid");
gifts = data.getObject("gifts", new TypeReference<List<List<Integer>>>() {
}.getType());
gifts = new Gson().fromJson(
data.getJSONArray("gifts").toJSONString(),
new TypeReference<List<WishItemInfo>>() {
}.getType());
}
@Override