用fastmock帮我模拟一个数组,数组中有6个对象,每个对象有一个用picsum.photos模拟的60×40的车的图片,每个对象有一个车名、现价、过去价,例如路虎揽胜 95.08万 95.80万
时间: 2024-02-22 19:01:12 浏览: 126
车况模拟程序
好的,我可以使用FastMock来模拟一个这样的数组。下面是一个示例JSON数据:
```json
[
{
"carName": "路虎揽胜",
"currentPrice": "95.08万",
"pastPrice": "95.80万",
"carImage": "https://picsum.photos/60/40?random=1"
},
{
"carName": "奥迪A6",
"currentPrice": "49.98万",
"pastPrice": "50.80万",
"carImage": "https://picsum.photos/60/40?random=2"
},
{
"carName": "宝马X5",
"currentPrice": "73.88万",
"pastPrice": "74.80万",
"carImage": "https://picsum.photos/60/40?random=3"
},
{
"carName": "奔驰GLS",
"currentPrice": "95.88万",
"pastPrice": "96.80万",
"carImage": "https://picsum.photos/60/40?random=4"
},
{
"carName": "丰田凯美瑞",
"currentPrice": "22.98万",
"pastPrice": "23.80万",
"carImage": "https://picsum.photos/60/40?random=5"
},
{
"carName": "本田雅阁",
"currentPrice": "22.98万",
"pastPrice": "23.80万",
"carImage": "https://picsum.photos/60/40?random=6"
}
]
```
这个JSON数组中有6个对象,每个对象都包含一个用picsum.photos模拟的60×40的车的图片、一个车名、一个现价和一个过去价。你可以将这个JSON数据复制到FastMock的模拟数据中心中,然后使用FastMock的API来获取这个模拟数组。
阅读全文