entuser

package
v0.0.0-...-e0bb1f3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 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
	entity.DefaultEntityWithoutDlt
	Phone  string `json:"phone"`
	Name   string `json:"name"`
	Age    int    `json:"age"`
	Gender int    `json:"gender"`
}

type GetResp

type GetResp struct {
	model.BaseUser
	entity.DefaultEntityWithoutDlt
	Phone  string `json:"phone"`
	Name   string `json:"name"`
	Age    int    `json:"age"`
	Gender int    `json:"gender"`
}

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
	entity.DefaultEntity
	Phone    string `json:"phone"`
	Password string `json:"password"`
	Name     string `json:"name"`
	Age      int    `json:"age"`
	Gender   int    `json:"gender"`
}

Jump to

Keyboard shortcuts

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