23 lines
439 B
Go
Raw Normal View History

2021-09-14 12:24:35 +03:00
package repository
import (
"math/rand"
"time"
2021-09-14 13:03:47 +03:00
"github.com/Neur0toxine/demo-web-service-go/internal/data/model"
2021-09-14 12:24:35 +03:00
"github.com/brianvoe/gofakeit/v6"
)
func Books() (books []model.Book) {
books = make([]model.Book, 10)
for i := 0; i < 10; i++ {
books[i] = model.Book{
2021-09-14 12:36:52 +03:00
ID: uint64(i + 1),
2021-09-14 12:24:35 +03:00
Name: gofakeit.Phrase(),
PublicationDate: time.Now(),
Rate: uint8(rand.Intn(5)),
}
}
return
}