| | |
| | | package com.flightfeather.uav.common.utils |
| | | |
| | | import com.google.gson.Gson |
| | | import com.google.gson.GsonBuilder |
| | | import com.google.gson.JsonParser |
| | | import java.util.ArrayList |
| | | import java.time.LocalDateTime |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | */ |
| | | object GsonUtils { |
| | | |
| | | val gson: Gson = GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss") |
| | | .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) |
| | | .create() |
| | | |
| | | fun getNoteJsonString(jsonString: String, note: String): String { |
| | | if (jsonString.isEmpty()) { |
| | | throw RuntimeException("getNoteJsonString jsonString empty") |