2017-02-16 21:47:43 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
func fixtureBlogCreate(i int) *Blog {
|
|
|
|
return &Blog{
|
|
|
|
ID: 1 * i,
|
|
|
|
Title: "Title 1",
|
|
|
|
CreatedAt: time.Now(),
|
|
|
|
Posts: []*Post{
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 1 * i,
|
|
|
|
Title: "Foo",
|
|
|
|
Body: "Bar",
|
|
|
|
Comments: []*Comment{
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 1 * i,
|
|
|
|
Body: "foo",
|
|
|
|
},
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 2 * i,
|
|
|
|
Body: "bar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 2 * i,
|
|
|
|
Title: "Fuubar",
|
|
|
|
Body: "Bas",
|
|
|
|
Comments: []*Comment{
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 1 * i,
|
|
|
|
Body: "foo",
|
|
|
|
},
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 3 * i,
|
|
|
|
Body: "bas",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
CurrentPost: &Post{
|
|
|
|
ID: 1 * i,
|
|
|
|
Title: "Foo",
|
|
|
|
Body: "Bar",
|
|
|
|
Comments: []*Comment{
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 1 * i,
|
|
|
|
Body: "foo",
|
|
|
|
},
|
2017-09-13 15:59:59 -04:00
|
|
|
{
|
2017-02-16 21:47:43 -05:00
|
|
|
ID: 2 * i,
|
|
|
|
Body: "bar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func fixtureBlogsList() (blogs []interface{}) {
|
|
|
|
for i := 0; i < 10; i++ {
|
|
|
|
blogs = append(blogs, fixtureBlogCreate(i))
|
|
|
|
}
|
|
|
|
|
|
|
|
return blogs
|
|
|
|
}
|