Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"` CustomerID uint64 `json:"customer_id" gorm:"type:int8"` Principal bool `json:"principal" gorm:"type:bool;default:false"` PostalCode string `json:"postal_code" gorm:"type:varchar(20)"` StreetName string `json:"street_name" gorm:"type:varchar(250)"` StreetNumber string `json:"street_number" gorm:"type:varchar(5)"` District string `json:"district" gorm:"type:varchar(150)"` City string `json:"city" gorm:"type:varchar(150)"` Country string `json:"country" gorm:"type:varchar(2);default:BR"` }
Address -> Represent a entity customer_address
type Customer ¶
type Customer struct { ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"` Login string `json:"login" gorm:"unique;type:varchar(15)"` FirstName string `json:"firstname" gorm:"type:varchar(150)"` LastName string `json:"lastname" gorm:"type:varchar(150)"` CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` Active bool `json:"active" gorm:"default:true"` Addresses []Address `json:"addresses" gorm:"foreignKey:CustomerID"` Emails []Email `json:"emails" gorm:"foreignKey:CustomerID"` Phones []Phone `json:"phones" gorm:"foreignKey:CustomerID"` }
Customer -> Represent a entity customer
type Email ¶
type Email struct { ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"` CustomerID uint64 `json:"customer_id"` Principal bool `json:"principal" gorm:"default:false"` Email string `json:"email" gorm:"type:varchar(250)"` }
Email -> Represent a entity customer_email
type Phone ¶
type Phone struct { ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"` CustomerID uint64 `json:"customer_id"` Principal bool `json:"principal" gorm:"default:false"` Ddi int `json:"ddi" gorm:"default:55"` Phone string `json:"phone" gorm:"type:varchar(20)"` }
Phone -> Represent a entity customer_phone
type User ¶
type User struct { Email string `json:"email" gorm:"primaryKey"` Password string `json:"password" gorm:"type:varchar(200);not null"` IsAdmin bool `json:"is_admin" gorm:"default:false"` }
User -> represent an user
func (*User) CreateToken ¶
CreateToken -> return jwk user token
func (*User) VerifyPassword ¶
VerifyPassword -> check password
Click to show internal directories.
Click to hide internal directories.