1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| package com.nuvole.util;
|
| import com.alibaba.fastjson.JSON;
| import com.nuvole.common.domain.dataFile.DataFile;
| import org.junit.Test;
|
| import java.util.List;
|
| public class JsonTest {
|
| @Test
| public void TestParse(){
| String image = "[{\"uid\":1562829586751,\"path\":\"/ecosphereBase/2019/7/11/8cc0253719484a768668c35175d57694.jpg\",\"name\":\"90346996.jpg\",\"url\":\"https://echftp.yqzhfw.com/ecosphereBase/2019/7/11/8cc0253719484a768668c35175d57694.jpg\"}]";
| List<DataFile> dataFiles = JSON.parseArray(image, DataFile.class);
| System.out.println(dataFiles.get(0).getPath());
| System.out.println(dataFiles.size());
| }
|
| }
|
|