diff options
| author | Doog <157747121+doogongithub@users.noreply.github.com> | 2024-02-29 20:13:48 -0500 |
|---|---|---|
| committer | Doog <157747121+doogongithub@users.noreply.github.com> | 2024-02-29 20:13:48 -0500 |
| commit | 9f9a33cbf55d38987a66b709284d2bb4ffea0fe9 (patch) | |
| tree | 1e0539e708983ca05bb4e07d22b9ec10b95d2473 /api/lib | |
| parent | e37c73e33a4aaf7fb8d25b5af03627f20bcda19f (diff) | |
modify api, build additional FE components, add types
Diffstat (limited to 'api/lib')
| -rw-r--r-- | api/lib/models.go | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/api/lib/models.go b/api/lib/models.go index 92e5703..f959519 100644 --- a/api/lib/models.go +++ b/api/lib/models.go | |||
| @@ -1,23 +1,41 @@ | |||
| 1 | package models | 1 | package models |
| 2 | 2 | ||
| 3 | import "time" | 3 | import ( |
| 4 | "time" | ||
| 5 | "github.com/google/uuid" | ||
| 6 | ) | ||
| 4 | 7 | ||
| 5 | type Statistic struct { | 8 | type Statistic struct { |
| 6 | ID int64 `json:"id"` | 9 | ID int64 `json:"-"` |
| 7 | Date time.Time `json:"date"` | 10 | Date time.Time `json:"date"` |
| 8 | UserID int64 `json:"user_id"` | 11 | User User `json:"user"` |
| 9 | Quantity int `json:"quantity"` | 12 | Quantity int `json:"quantity"` |
| 10 | } | 13 | } |
| 11 | 14 | ||
| 12 | type User struct { | 15 | type User struct { |
| 13 | ID int64 | 16 | ID int64 `json:"-"` |
| 14 | Name string | 17 | Name string `json:"name"` |
| 18 | UUID uuid.UUID `json:"uuid"` | ||
| 19 | Password string `json:"-"` | ||
| 15 | } | 20 | } |
| 16 | 21 | ||
| 17 | type Token struct { | 22 | type Token struct { |
| 18 | ID int64 | 23 | ID int64 `json:"-"` |
| 19 | UserID int64 | 24 | UserID int64 `json:"user_id"` |
| 20 | Token string | 25 | Token string `json:"token"` |
| 21 | CreatedAt time.Time | 26 | CreatedAt time.Time `json:"created_at"` |
| 22 | ExpiredAt time.Time | 27 | ExpiredAt time.Time `json:"expired_at"` |
| 28 | } | ||
| 29 | |||
| 30 | type Preference struct { | ||
| 31 | ID int64 `json:"-"` | ||
| 32 | Color string `json:"color"` | ||
| 33 | UserID int64 `json:"-"` | ||
| 34 | Size Size `json:"size"` | ||
| 35 | } | ||
| 36 | |||
| 37 | type Size struct { | ||
| 38 | ID int64 `json:"-"` | ||
| 39 | Size int64 `json:"size"` | ||
| 40 | Unit string `json:"unit"` | ||
| 23 | } | 41 | } |
