-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.go
54 lines (45 loc) · 1.3 KB
/
event.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
package dto
import "time"
type CreateEventTypeDTO struct {
Name string `json:"name" validate:"required"`
IsVisible bool `json:"isVisible"`
}
type EditEventTypeDTO struct {
ID int32 `json:"-" validate:"required,gt=0"`
Name string `json:"name" validate:"required"`
IsVisible bool `json:"isVisible"`
}
type CreateEventDTO struct {
EventTypeID int32 `json:"eventTypeId" validate:"required,gt=0"`
Date time.Time `json:"date" validate:"required"`
}
type ListEventDTO struct {
UserID *int32 `json:"userId" validate:"omitempty,gt=0"`
TypeID *int32 `json:"typeId" validate:"omitempty,gt=0"`
PeriodType PeriodType `json:"periodType" validate:"required,gt=0,lt=4"`
Date time.Time `json:"date" validate:"required"`
}
type FeedResponseDTO struct {
EventID int32 `json:"eventId"`
UserID int32 `json:"userId"`
EventTypeID int32 `json:"eventTypeId"`
EventType string `json:"eventType"`
Date time.Time `json:"date"`
CreatedAt time.Time `json:"createdAt"`
}
/*
* internal
*/
type PeriodType int32
const (
PeriodDay PeriodType = 1
PeriodMonth = 2
PeriodYear = 3
)
type ListEventFilter struct {
UserID int32
TypeID *int32
OnlyVisible bool
PeriodType PeriodType
Date time.Time
}