user

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Create

type Create struct {
	Info
}

func (*Create) ParseAndCheckParams

func (r *Create) ParseAndCheckParams(c *gin.Context) (err error)

type Destroy

type Destroy struct {
}

func (*Destroy) ParseAndCheckParams

func (r *Destroy) ParseAndCheckParams(c *gin.Context) (err error)

type Index

type Index struct {
	Page     int     `form:"page" validate:"numeric,min=1"`
	Size     int     `form:"size" validate:"numeric,min=1,max=100"`
	Keywords *string `form:"keywords" validate:"omitempty"`
}

func (*Index) ParseAndCheckParams

func (r *Index) ParseAndCheckParams(c *gin.Context) (err error)

type Info

type Info struct {
	Username string `json:"username" gorm:"column:username" validate:"required,max=100"` // 用户名称
	Password string `json:"password" gorm:"column:password" validate:"required,max=60"`  // 密码
	Avatar   string `json:"avatar" gorm:"column:avatar" validate:"omitempty,max=255"`    // 头像
	Phone    string `json:"phone" gorm:"column:phone" validate:"required,max=11,phone"`  // 电话号码
	Email    string `json:"email" gorm:"column:email" validate:"omitempty,max=255"`      // 邮箱
	Gender   uint8  `json:"gender" gorm:"column:gender" validate:"omitempty,numeric"`    // 性别:0-未知、1-男、2-女
}

type Logic

type Logic struct{}

func NewLogic

func NewLogic() *Logic

func (*Logic) Create

func (l *Logic) Create(c *gin.Context)

Create Save one source

func (*Logic) Destroy

func (l *Logic) Destroy(c *gin.Context)

Destroy Delete a resource

func (*Logic) Index

func (l *Logic) Index(c *gin.Context)

Index Get page list

func (*Logic) Show

func (l *Logic) Show(c *gin.Context)

Show Get info

func (*Logic) Update

func (l *Logic) Update(c *gin.Context)

Update Modifying a resource

type Show

type Show struct {
	Id uint32 `path:"id"`
}

func (*Show) ParseAndCheckParams

func (r *Show) ParseAndCheckParams(c *gin.Context) (err error)

type Update

type Update struct {
}

func (*Update) ParseAndCheckParams

func (r *Update) ParseAndCheckParams(c *gin.Context) (err error)

Jump to

Keyboard shortcuts

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