types

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name  string      `json:"name"`  // column name
	Exp   string      `json:"exp"`   // expressions, which default to = when the value is null, have =, ! =, >, >=, <, <=, like
	Value interface{} `json:"value"` // column value
	Logic string      `json:"logic"` // logical type, defaults to and when value is null, only &(and), ||(or)
}

Column search information

type CreateUserExampleRequest

type CreateUserExampleRequest struct {
	Name     string `json:"name" binding:"min=2"`         // username
	Email    string `json:"email" binding:"email"`        // email
	Password string `json:"password" binding:"md5"`       // password
	Phone    string `form:"phone" binding:"e164"`         // phone number, e164 means <+ country code> <cell phone number>.
	Avatar   string `form:"avatar" binding:"min=5"`       // avatar
	Age      int    `form:"age" binding:"gt=0,lt=120"`    // age
	Gender   int    `form:"gender" binding:"gte=0,lte=2"` // gender, 1:Male, 2:Female, other values:unknown
}

CreateUserExampleRequest create request parameters, all fields are mandatory and meet binding rules binding instructions for use https://github.com/go-playground/validator

type GetUserExampleByIDRespond

type GetUserExampleByIDRespond struct {
	ID        string    `json:"id"`         // id
	Name      string    `json:"name"`       // username
	Email     string    `json:"email"`      // email
	Phone     string    `json:"phone"`      // phone number
	Avatar    string    `json:"avatar"`     // avatar
	Age       int       `json:"age"`        // age
	Gender    int       `json:"gender"`     // gender, 1:Male, 2:Female, other values:unknown
	Status    int       `json:"status"`     // account status, 1:inactive, 2:activated, 3:blocked
	LoginAt   int64     `json:"login_at"`   // login timestamp
	CreatedAt time.Time `json:"created_at"` // create time
	UpdatedAt time.Time `json:"updated_at"` // update time
}

GetUserExampleByIDRespond response data

type GetUserExamplesByIDsRequest

type GetUserExamplesByIDsRequest struct {
	IDs []uint64 `json:"ids" binding:"min=1"` // id list
}

GetUserExamplesByIDsRequest request form ids

type GetUserExamplesRequest

type GetUserExamplesRequest struct {
	query.Params // query parameters
}

GetUserExamplesRequest request form params

type ListUserExamplesRespond

type ListUserExamplesRespond []struct {
	GetUserExampleByIDRespond
}

ListUserExamplesRespond list data

type Params

type Params struct {
	Page int    `form:"page" binding:"gte=0" json:"page"`      // page number, starting from page 0
	Size int    `form:"size" binding:"gt=0" json:"size"`       // lines per page
	Sort string `form:"sort" binding:"" json:"sort,omitempty"` // sorted fields, multi-column sorting separated by commas

	Columns []Column `json:"columns,omitempty"` // query conditions
}

Params query parameters

type Result

type Result struct {
	Code int         `json:"code"` // return code
	Msg  string      `json:"msg"`  // return information description
	Data interface{} `json:"data"` // return data
}

Result output data format

type UpdateUserExampleByIDRequest

type UpdateUserExampleByIDRequest struct {
	ID       uint64 `json:"id" binding:"-"`      // id
	Name     string `json:"name" binding:""`     // username
	Email    string `json:"email" binding:""`    // email
	Password string `json:"password" binding:""` // password
	Phone    string `form:"phone" binding:""`    // phone number
	Avatar   string `form:"avatar" binding:""`   // avatar
	Age      int    `form:"age" binding:""`      // age
	Gender   int    `form:"gender" binding:""`   // gender, 1:Male, 2:Female, other values:unknown
}

UpdateUserExampleByIDRequest update request parameters, all fields are not required, fields are updated with non-zero values

Jump to

Keyboard shortcuts

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