1. val mapper = new ObjectMapper() with ScalaObjectMapper
  2. mapper.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"))
  3. mapper.registerModule(DefaultScalaModule)
  4. mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
  5. mapper.registerModule(new JodaModule)

  1. val obj = mapper.readValue(raw, classOf[Map[_, _]]).asInstanceOf[Map[String, Any]]

  1. val json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(res)
文档更新时间: 2019-06-21 20:02