-
Notifications
You must be signed in to change notification settings - Fork 0
/
LibraryApiBase.go
57 lines (39 loc) · 1.2 KB
/
LibraryApiBase.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package library
import (
"github.com/go-ee/schkola/person"
"github.com/go-ee/utils/eh"
"github.com/google/uuid"
"time"
)
type Book struct {
Title string `json:"title" eh:"optional"`
Description string `json:"description" eh:"optional"`
Language string `json:"language" eh:"optional"`
ReleaseDate *time.Time `json:"releaseDate" eh:"optional"`
Edition string `json:"edition" eh:"optional"`
Category string `json:"category" eh:"optional"`
Author *person.PersonName `json:"author" eh:"optional"`
Location *Location `json:"location" eh:"optional"`
Id uuid.UUID `json:"id" eh:"optional"`
}
func NewBook() (ret *Book) {
ret = &Book{}
return
}
func (o *Book) FindByPattern(pattern string) (ret *Book, err error) {
err = eh.QueryNotImplemented("findBookByPattern")
return
}
func (o *Book) FindByTitle(title string) (ret *Book, err error) {
err = eh.QueryNotImplemented("findBookByTitle")
return
}
func (o *Book) EntityID() uuid.UUID { return o.Id }
type Location struct {
Shelf string `json:"shelf" eh:"optional"`
Fold string `json:"fold" eh:"optional"`
}
func NewLocation() (ret *Location) {
ret = &Location{}
return
}