-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
56 lines (49 loc) · 1.62 KB
/
model.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
package main
import "time"
type User struct {
ID int64 `json:"id"`
Username string `json:"username"`
AuthKey string `json:"auth_key"`
PasswordHash string `json:"password_hash"`
PasswordResetToken string `json:"password_reset_token"`
Email string `json:"email"`
Status int `json:"status"`
Github string `json:"github"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UserLogin struct {
Username string
Password string
}
type News struct {
ID int64 `sql:"type:int";json:"id"`
UserId int64 `sql:"type:int;not null";json:"user_id"`
Title string `sql:"type:varchar(50)";json:"title"`
Text string `sql:"type:text";json:"text"`
Link string `sql:"type:varchar(255)";json:"link"`
Status int `sql:"type:tinyint(1)";json:"status"`
CreatedAt time.Time `sql:"type:datetime";json:"created_at"`
}
type Auth struct {
ID int64 `json:"id"`
UserId int64 `json:"user_id"`
Source string `json:"source"`
SourceId string `json:"source_id"`
}
type Comment struct {
ID int64 `json:"id"`
UserId int64 `json:"user_id"`
NewsId int64 `json:"news_id"`
Text string `json:"text"`
Status int `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type DbConfig struct {
Hostname string `json:"hostname"`
Username string `json:"username"`
Password string `json:"password"`
Port string `json:"port"`
DbName string `json:"db_name"`
}