购物车 多规格商品返回规格信息

团购卷列表
团购卷退款
员工登录管理
This commit is contained in:
2024-05-24 15:56:41 +08:00
parent c5e337bef3
commit 3e6cb81b46
26 changed files with 1247 additions and 36 deletions

View File

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.List;
@@ -199,6 +200,17 @@ public class JSONUtil {
}
}
public static <T> List<T> parseListTNewList(String json, Class<T> clazz) {
ObjectMapper objectMapper = new ObjectMapper(); // 创建JSON转换器
try {
// 将JSON字符串转换为List<T>
return objectMapper.readValue(json, objectMapper.getTypeFactory().constructCollectionType(List.class, clazz));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static class JSONEntity {
public JSONEntity() {
}