add forget password
This commit is contained in:
+15
-12
@@ -34,6 +34,7 @@ type UserDB struct {
|
||||
DeletedAt *time.Time `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
CreatedBy int64 `gorm:"column:created_by" json:"created_by"`
|
||||
UpdatedBy int64 `gorm:"column:updated_by" json:"updated_by"`
|
||||
ResetPassword bool `gorm:"column:reset_password" json:"reset_password"`
|
||||
}
|
||||
|
||||
func (u *UserDB) ToUser() *User {
|
||||
@@ -42,18 +43,19 @@ func (u *UserDB) ToUser() *User {
|
||||
}
|
||||
|
||||
userEntity := &User{
|
||||
ID: u.ID,
|
||||
Name: u.Name,
|
||||
Email: u.Email,
|
||||
Status: u.Status,
|
||||
CreatedAt: u.CreatedAt,
|
||||
UpdatedAt: u.UpdatedAt,
|
||||
RoleID: role.Role(u.RoleID),
|
||||
RoleName: u.RoleName,
|
||||
PartnerID: u.PartnerID,
|
||||
PartnerName: u.PartnerName,
|
||||
SiteID: u.SiteID,
|
||||
SiteName: u.SiteName,
|
||||
ID: u.ID,
|
||||
Name: u.Name,
|
||||
Email: u.Email,
|
||||
Status: u.Status,
|
||||
CreatedAt: u.CreatedAt,
|
||||
UpdatedAt: u.UpdatedAt,
|
||||
RoleID: role.Role(u.RoleID),
|
||||
RoleName: u.RoleName,
|
||||
PartnerID: u.PartnerID,
|
||||
PartnerName: u.PartnerName,
|
||||
SiteID: u.SiteID,
|
||||
SiteName: u.SiteName,
|
||||
ResetPassword: u.ResetPassword,
|
||||
}
|
||||
|
||||
return userEntity
|
||||
@@ -92,6 +94,7 @@ func (u *UserDB) ToUserAuthenticate(signedToken string) *AuthenticateUser {
|
||||
PartnerStatus: u.PartnerStatus,
|
||||
SiteID: u.SiteID,
|
||||
SiteName: u.SiteName,
|
||||
ResetPassword: u.ResetPassword,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package entity
|
||||
|
||||
type (
|
||||
SendEmailNotificationParam struct {
|
||||
Sender string
|
||||
Recipient string
|
||||
CcEmails []string
|
||||
Subject string
|
||||
TemplateName string
|
||||
TemplatePath string
|
||||
Data interface{}
|
||||
}
|
||||
)
|
||||
+16
-14
@@ -10,20 +10,21 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID int64
|
||||
Name string
|
||||
Email string
|
||||
Password string
|
||||
Status userstatus.UserStatus
|
||||
NIK string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
RoleID role.Role
|
||||
RoleName string
|
||||
PartnerID *int64
|
||||
SiteID *int64
|
||||
SiteName string
|
||||
PartnerName string
|
||||
ID int64
|
||||
Name string
|
||||
Email string
|
||||
Password string
|
||||
Status userstatus.UserStatus
|
||||
NIK string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
RoleID role.Role
|
||||
RoleName string
|
||||
PartnerID *int64
|
||||
SiteID *int64
|
||||
SiteName string
|
||||
PartnerName string
|
||||
ResetPassword bool
|
||||
}
|
||||
|
||||
type AuthenticateUser struct {
|
||||
@@ -36,6 +37,7 @@ type AuthenticateUser struct {
|
||||
PartnerStatus string
|
||||
SiteID *int64
|
||||
SiteName string
|
||||
ResetPassword bool
|
||||
}
|
||||
|
||||
type UserRoleDB struct {
|
||||
|
||||
Reference in New Issue
Block a user