json传递数组和列表格式

数组格式:

{
    "product_name": "iphone x14",
    "type_id": "xxxx1",
    "price": 8000,
    "stock": 10000,
    //数组格式
    "pics": [
        "http:localhost:8888/membership/xxx.jpeg",
        "http:localhost:8888/membership/x1x.jpeg"
    ]
}

List<Product>格式:

{
  "products":[{"id":1,"name":"名称"},
              {"id":2,"name":"名称2"}]   
}

 

posted @ 2022-09-17 16:27  曦灰  阅读(225)  评论(0)    收藏  举报