@@ -6,26 +6,29 @@ import (
66
77// Login ...
88type Login struct {
9- ID uint `gorm:"primary_key" json:"id"`
10- CreatedAt time.Time `json:"created_at"`
11- UpdatedAt time.Time `json:"updated_at"`
12- DeletedAt * time.Time `json:"deleted_at"`
13- Title string `json:"title"`
14- URL string `json:"url"`
15- Username string `json:"username"`
16- Password string `json:"password"`
9+ ID uint `gorm:"primary_key" json:"id" encrypt:"false" `
10+ CreatedAt time.Time `json:"created_at" encrypt:"true" `
11+ UpdatedAt time.Time `json:"updated_at" encrypt:"true" `
12+ DeletedAt * time.Time `json:"deleted_at" encrypt:"true" `
13+ Title string `json:"title" encrypt:"false" `
14+ URL string `json:"url" encrypt:"true" `
15+ Username string `json:"username" encrypt:"true" `
16+ Password string `json:"password" encrypt:"true" `
1717}
1818
1919type LoginDTO struct {
20- ID uint `json:"id"`
21- Title string `json:"title"`
22- URL string `json:"url"`
23- Username string `json:"username"`
24- Password string `json:"password"`
20+ ID uint `json:"id" encrypt:"false" `
21+ Title string `json:"title" encrypt:"false" `
22+ URL string `json:"url" encrypt:"true" `
23+ Username string `json:"username" encrypt:"true" `
24+ Password string `json:"password" encrypt:"true" `
2525}
2626
2727// ToLogin ...
2828func ToLogin (loginDTO * LoginDTO ) * Login {
29+
30+ //*loginDTO = app.EncryptLogin(*loginDTO)
31+
2932 return & Login {
3033 Title : loginDTO .Title ,
3134 URL : loginDTO .URL ,
@@ -42,6 +45,8 @@ func ToLoginDTO(login *Login) *LoginDTO {
4245 // login.URL = strings.TrimPrefix(login.URL, trims[i])
4346 // }
4447
48+ //*login = app.DecryptLogin(*login)
49+
4550 return & LoginDTO {
4651 ID : login .ID ,
4752 Title : login .Title ,
0 commit comments