entuser

package
v0.0.0-...-c5159e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidPassword

func ValidPassword(fl validator.FieldLevel) bool

func ValidPhone

func ValidPhone(fl validator.FieldLevel) bool

Types

type CreateBody

type CreateBody struct {
	model.BaseUser
	ID        uint
	Phone     string `json:"phone" validate:"required,phone"`
	Password  string `json:"password" validate:"required,password"`
	Name      string `json:"name" validate:"required,max=50"`
	Age       int    `json:"age" validate:"required,max=200"`
	Gender    int    `json:"gender" validate:"required,oneof=0 1 2" oneof_err:"只支持: 0,1,2"`
	CreatedAt time.Time
}

func (*CreateBody) BeforeCreate

func (r *CreateBody) BeforeCreate(_ *gorm.DB) error

type GetListParams

type GetListParams struct {
	model.BaseUser
	Phone  string `form:"phone" validate:"max=11"`
	Name   string `form:"name" validate:"max=50"`
	Age    int    `form:"age" validate:"max=200"`
	Gender int    `form:"gender" validate:"oneof=0 1 2" oneof_err:"只支持: 0,1,2"`
}

type GetListResp

type GetListResp struct {
	model.BaseUser
	ID        uint      `json:"id"`
	Phone     string    `json:"phone"`
	Name      string    `json:"name"`
	Age       int       `json:"age"`
	Gender    int       `json:"gender"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type GetResp

type GetResp struct {
	model.BaseUser
	ID        uint      `json:"id"`
	Phone     string    `json:"phone"`
	Name      string    `json:"name"`
	Age       int       `json:"age"`
	Gender    int       `json:"gender"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type UpdateBody

type UpdateBody struct {
	model.BaseUser
	ID        uint
	Name      string `json:"name" validate:"max=50"`
	Age       int    `json:"age" validate:"max=200"`
	Gender    int    `json:"gender" validate:"oneof=0 1 2" oneof_err:"只支持: 0,1,2"`
	UpdatedAt time.Time
}

type User

type User struct {
	model.BaseUser
	ID        uint         `json:"id"`
	Phone     string       `json:"phone"`
	Password  string       `json:"password"`
	Name      string       `json:"name"`
	Age       int          `json:"age"`
	Gender    int          `json:"gender"`
	CreatedAt time.Time    `json:"created_at"`
	UpdatedAt time.Time    `json:"updated_at"`
	DeletedAt sql.NullTime `json:"deleted_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL