-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.go
96 lines (84 loc) · 3.5 KB
/
type.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package hppinjambackend
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Admin struct {
Email string `bson:"email,omitempty" json:"email,omitempty"`
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
PasswordHash string `json:"passwordhash" bson:"passwordhash"`
Role string `json:"role,omitempty" bson:"role,omitempty"`
Token string `json:"token,omitempty" bson:"token,omitempty"`
Private string `json:"private,omitempty" bson:"private,omitempty"`
Public string `json:"public,omitempty" bson:"public,omitempty"`
}
type User struct {
Email string `bson:"email,omitempty" json:"email,omitempty"`
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
PasswordHash string `json:"passwordhash" bson:"passwordhash"`
Role string `json:"role,omitempty" bson:"role,omitempty"`
Token string `json:"token,omitempty" bson:"token,omitempty"`
Private string `json:"private,omitempty" bson:"private,omitempty"`
Public string `json:"public,omitempty" bson:"public,omitempty"`
}
type Credential struct {
Status bool `json:"status" bson:"status"`
Token string `json:"token,omitempty" bson:"token,omitempty"`
Message string `json:"message,omitempty" bson:"message,omitempty"`
}
type Response struct {
Status bool `json:"status" bson:"status"`
Message string `json:"message" bson:"message"`
Data interface{} `json:"data" bson:"data"`
}
type RegisterStruct struct {
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
}
type Hp struct {
ID primitive.ObjectID `bson:"_id,omitempty" `
Nomorid int `json:"nomorid" bson:"nomorid"`
Title string `json:"title" bson:"title"`
Description string `json:"description" bson:"description"`
Image string `json:"image" bson:"image"`
Status bool `json:"status" bson:"status"`
}
type About struct {
ID int `json:"id" bson:"id"`
Title string `json:"title" bson:"title"`
Description string `json:"description" bson:"description"`
Image string `json:"image" bson:"image"`
Status bool `json:"status" bson:"status"`
}
// type Hp struct {
// ID int `json:"id" bson:"id"`
// Title string `json:"title" bson:"title"`
// Description string `json:"description" bson:"description"`
// Cari string `json:"cari" bson:"cari"`
// Tanggal string `json:"tanggal" bson:"tanggal"`
// Image string `json:"image" bson:"image"`
// Harga int `json:"harga" bson:"harga"`
// Hp []Hp `json:"hp" bson:"hp"`
// Rating string `json:"rating" bson:"rating"`
// Status bool `json:"status" bson:"status"`
// }
// type Contact struct {
// ID int `json:"id" bson:"id"`
// Name string `json:"title" bson:"title"`
// Subject string `json:"description" bson:"description"`
// Alamat string `json:"alamat" bson:"alamat"`
// Website string `json:"website" bson:"website"`
// Message string `json:"image" bson:"image"`
// Email string `json:"email" bson:"email"`
// Phone string `json:"phone" bson:"phone"`
// Status bool `json:"status" bson:"status"`
// }
type Payload struct {
Id primitive.ObjectID `json:"id"`
Role string `json:"role"`
Exp time.Time `json:"exp"`
Iat time.Time `json:"iat"`
Nbf time.Time `json:"nbf"`
}