Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewUserCtrl ¶
Types ¶
type Repository ¶
type Repository interface { Create(*User) error Update(*User) error Delete(uint64) error FindByID(uint64) (*User, error) FindAll() ([]*User, error) UpdatePassword(username string, password string) error }
func NewUserRepository ¶
func NewUserRepository(db *gorm.DB) Repository
type Service ¶
type Service interface { Create(*User) error Update(*User) error Delete(uint64) error FindByID(uint64) (*User, error) FindAll() ([]*User, error) UpdatePassword(string, string) error }
func NewUserService ¶
func NewUserService(repo Repository) Service
type UpdatePasswdReq ¶
type User ¶
type User struct { ID uint64 `json:"id" gorm:"primaryKey,autoIncrement"` Username string `json:"username" binding:"required"` Password string `json:"password" binding:"required"` Deleted db.Deleted `json:"-"` Version db.Version `json:"version" gorm:"default:1"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.