-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.go
47 lines (38 loc) · 1.25 KB
/
users.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
package data
import (
"time"
"gitlab.com/distributed_lab/kit/pgdb"
)
type Users interface {
New() Users
Upsert(user User) error
Delete() error
Select() ([]User, error)
Get() (*User, error)
FilterById(id *int64) Users
FilterByMailIds(emailIds ...string) Users
FilterByLowerTime(time time.Time) Users
SearchBy(search string) Users
Count() Users
GetTotalCount() (int64, error)
Page(pageParams pgdb.OffsetPageParams) Users
}
type User struct {
Id *int64 `json:"-" db:"id" structs:"id,omitempty"`
Email string `json:"email" db:"email" structs:"email"`
Name string `json:"name" db:"name" structs:"name"`
MailId string `json:"mail_id" db:"mail_id" structs:"mail_id"`
CreatedAt time.Time `json:"created_at" db:"created_at" structs:"-"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at" structs:"-"`
Submodule *string `json:"-" db:"-" structs:"-"`
}
type UnverifiedUser struct {
CreatedAt time.Time `json:"created_at"`
Module string `json:"module"`
Submodule string `json:"submodule"`
ModuleId string `json:"module_id"`
Email *string `json:"email,omitempty"`
Name *string `json:"name,omitempty"`
Phone *string `json:"phone,omitempty"`
Username *string `json:"username,omitempty"`
}