-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.js
More file actions
30 lines (30 loc) · 733 Bytes
/
data.js
File metadata and controls
30 lines (30 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
exports.datas = {
users: function(count = 10) {
const list = [];
for (let i = 1; i < count; i += 1) {
list.push({
id: i,
name: "esun" + i,
email: "esun" + i + "@test.com",
password: "123456",
age: Math.ceil(Math.random() * 50),
height: 175.0,
birthDay: `2019-02-${Math.floor(i / 2) + 1}`
});
}
return list;
},
posts: function(count = 10) {
const list = [];
for (let i = 1; i < count; i += 1) {
list.push({
id: i,
authorId: Math.ceil(Math.random() * 10),
title: "post" + i,
content: "post content " + i,
createdAt: `2019-02-${Math.floor(i / 2) + 1}`
});
}
return list;
}
};