Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package models |
||
2 | |||
3 | import ( |
||
4 | "gorm.io/gorm" |
||
5 | ) |
||
6 | |||
7 | // Answer structure |
||
8 | type Answer struct { |
||
9 | gorm.Model |
||
10 | CardID uint `json:"card_id" example:"1"` |
||
11 | Card Card |
||
12 | Answer string `json:"answer" example:"42"` |
||
13 | } |
||
14 | |||
15 | // DeckResponse structure |
||
16 | type DeckResponse struct { |
||
17 | DeckID uint `json:"deck_id"` |
||
18 | Deck Deck `json:"deck"` |
||
19 | Cards []ResponseCard `json:"cards"` |
||
20 | Count int `json:"count"` |
||
21 | } |
||
22 | |||
23 | type TodayResponse struct { |
||
24 | DecksReponses []DeckResponse `json:"decks_responses"` |
||
25 | Count int `json:"count"` |
||
26 | } |
||
27 | |||
28 | func (today *TodayResponse) AppendDeckResponse(deckResponse DeckResponse) { |
||
29 | today.DecksReponses = append(today.DecksReponses, deckResponse) |
||
30 | } |
||
31 |