import com.imdroid.beidou_fwd.entity.KingMaData;
import com.imdroid.common.util.GsonUtil;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

public class DataTest {
    static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:00");

    public static void main(String[] args) {
        List<KingMaData> dataList = new ArrayList<>(3);

        for(int i=0;i<3;i++) {
            KingMaData data = new KingMaData();
            data.setDataTime(LocalDateTime.now().format(dateFormatter));
            data.setProjectId("12345");
            data.setFlag(1);
            data.setPhys(new KingMaData.Phys(100.23+i*3, 1234.56+i*2, 555.66+i));
            dataList.add(data);
        }

        String json = GsonUtil.toJson(dataList);
        System.out.println(json);
    }
}
