-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
62 lines (54 loc) · 2.08 KB
/
structs.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
53
54
55
56
57
58
59
60
61
62
package tracking
import (
"encoding/json"
"time"
"github.com/joaosoft/web"
)
type ErrorResponse struct {
Code web.Status `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Cause string `json:"cause,omitempty"`
}
type AddEventRequest struct {
Category *string `json:"category" validate:"notzero"`
Action *string `json:"action" validate:"notzero"`
Label *string `json:"label"`
Value *int64 `json:"value"`
Viewer *string `json:"viewer"`
Viewed *string `json:"viewed"`
Latitude *float64 `json:"latitude"`
Longitude *float64 `json:"longitude"`
Street *string `json:"street"`
MetaData *json.RawMessage `json:"meta_data"`
}
type AddEventResponse struct {
Success bool `json:"success"`
}
type Event struct {
IdEvent string `json:"id_event" db:"id_event"`
Category string `json:"category" db:"-" validate:"notzero"`
FkCategory string `json:"-" db:"fk_category"`
Action string `json:"action" db:"-" validate:"notzero"`
FkAction string `json:"-" db:"fk_action"`
Label *string `json:"label" db:"label"`
Value *int64 `json:"value" db:"value"`
Viewer *string `json:"viewer" db:"viewer"`
Viewed *string `json:"viewed" db:"viewed"`
Latitude *float64 `json:"latitude" db:"latitude"`
Longitude *float64 `json:"longitude" db:"longitude"`
Country *string `json:"country" db:"country"`
City *string `json:"city" db:"city"`
Street *string `json:"street" db:"street"`
MetaData *string `json:"meta_data" db:"meta_data"`
CreatedAt time.Time `json:"created_at" db.read:"created_at" db.write:"-"`
}
type Category struct {
IdCategory string `json:"id_category" db:"id_category"`
Name string `json:"name" db:"name"`
CreatedAt time.Time `json:"created_at" db.read:"created_at" db.write:"-"`
}
type Action struct {
IdAction string `json:"id_action" db:"id_action"`
Name string `json:"name" db:"name"`
CreatedAt time.Time `json:"created_at" db.read:"created_at" db.write:"-"`
}