Data structures
This commit is contained in:
parent
3985c5a83d
commit
7591a889ec
@ -5,6 +5,88 @@ import "net/http"
|
||||
type Bouquins struct {
|
||||
}
|
||||
|
||||
/*
|
||||
* A book series.
|
||||
*/
|
||||
type Series struct {
|
||||
Id int64
|
||||
Name string
|
||||
}
|
||||
|
||||
/*
|
||||
* A book. Generic data.
|
||||
*/
|
||||
type Book struct {
|
||||
Id int64
|
||||
Title string
|
||||
SeriesIndex int
|
||||
Series *Series
|
||||
}
|
||||
|
||||
/*
|
||||
* An author.
|
||||
*/
|
||||
type Author struct {
|
||||
Id int64
|
||||
Name string
|
||||
}
|
||||
|
||||
/*
|
||||
* Author and number of books.
|
||||
*/
|
||||
type AuthorAdv struct {
|
||||
Author
|
||||
Count int
|
||||
}
|
||||
|
||||
/*
|
||||
* Downloadable book data.
|
||||
*/
|
||||
type BookData struct {
|
||||
Size int64
|
||||
Format string
|
||||
Name string
|
||||
}
|
||||
|
||||
/*
|
||||
* A book. Advanced data: authors, tags.
|
||||
*/
|
||||
type BookAdv struct {
|
||||
Book
|
||||
Authors []Author
|
||||
Tags []string
|
||||
}
|
||||
|
||||
type AuthorFull struct {
|
||||
Author
|
||||
Books []BookAdv
|
||||
}
|
||||
|
||||
type BookFull struct {
|
||||
BookAdv
|
||||
Data []BookData
|
||||
Timestamp int64
|
||||
Pubdate int64
|
||||
Isbn string
|
||||
Lccn string
|
||||
Path string
|
||||
Uuid string
|
||||
Has_cover bool
|
||||
Lang string
|
||||
Publisher string
|
||||
}
|
||||
|
||||
type SeriesAdv struct {
|
||||
Series
|
||||
Books int64
|
||||
Authors []Author
|
||||
}
|
||||
|
||||
type SeriesFull struct {
|
||||
SeriesAdv
|
||||
Bools []Book
|
||||
}
|
||||
|
||||
func (*Bouquins) IndexPage(res http.ResponseWriter, req *http.Request) {
|
||||
http.Redirect(res, req, "/html/index.html", http.StatusSeeOther)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user