mirror of
https://github.com/Neur0toxine/demo-web-service-go.git
synced 2025-02-08 17:29:23 +03:00
23 lines
439 B
Go
23 lines
439 B
Go
package repository
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
|
|
"github.com/Neur0toxine/demo-web-service-go/internal/data/model"
|
|
"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{
|
|
ID: uint64(i + 1),
|
|
Name: gofakeit.Phrase(),
|
|
PublicationDate: time.Now(),
|
|
Rate: uint8(rand.Intn(5)),
|
|
}
|
|
}
|
|
return
|
|
}
|