简体   繁体   中英

how to get the indexed json as response in spring boot?

my current json is like:

{
  "key1":"value1",
  "key2":"value2",
  "key3":"value3",
  "key4":"value4",
  "key5":"value5"
}

i want to make it like

{
   meta:{
      0: key1,
      1: key2,
      2: key3,
      3: key4,
      4: key5,
  },
  data:{
      0: value1,
      1: value2,
      2: value3,
      3: value4,
      4: value5
  }
}

i know it is easy to do in javascript but how can i accomplish my response body in this indexed format in spring boot application.

HashMap<HashMap<String,String>,HashMap<String,String>>

父哈希映射用于您的全局对象,第一个子用于元数据,第二个用于数据。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM