-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdto.go
39 lines (31 loc) · 1.09 KB
/
dto.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
package main
import "time"
type Room struct {
Serial string `json:"serial"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
CreatedBy string `json:"created_by"`
TotalChannel int `json:"total_channel"`
Tags Tags `json:"tags" gorm:"-"`
Languages Languages `json:"languages" gorm:"-"`
Rate *RatingSummary `json:"rate" gorm:"-"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Rooms []*Room
type Tag struct {
Serial string `json:"serial"`
Name string `json:"name"`
Description string `json:"description"`
}
type Tags []*Tag
type Languages []string
type RatingSummary struct {
Reference string `gorm:"column:reference" json:"reference"`
Rate float64 `gorm:"column:average_rating" json:"average_rating"`
Count int `gorm:"column:rating_count" json:"rating_count"`
}
func (RatingSummary) TableName() string {
return "rating_summary"
}