mirror of
https://gitee.com/many2many/java-web.git
synced 2025-01-11 22:50:54 +08:00
907 B
907 B
使用json-generator生成假数据
website
user
[
'{{repeat(10)}}',
{
id: '{{index(1)}}',
avatar: 'https://loremflickr.com/120/120',
nickName: '{{lorem(1, "word")}}',
name: '{{firstName()}} {{surname()}}',
email: '{{email()}}',
phone: '+86 {{phone()}}',
about: 'Hi, wellcome to my home. I am from {{country()}}. ',
createDate: '{{date(new Date(2024, 0, 1), new Date(), "YYYY-MM-dd hh:mm:ss")}}'
}
]
post
[
'{{repeat(20)}}',
{
id: '{{index(1)}}',
userId: '{{integer(1,10)}}',
coverImage: 'https://loremflickr.com/640/320',
thumbnail: 'https://loremflickr.com/240/320',
title: '{{lorem(1)}}',
body: '{{lorem(integer(1,4), "paragraphs")}}',
comments: '{{integer(1,10)}}',
createDate: '{{date(new Date(2024, 0, 1), new Date(), "YYYY-MM-dd hh:mm:ss")}}'
}
]