types

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package types define the structure of request parameters and respond results in this package

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 information

type Conditions added in v1.5.3

type Conditions struct {
	Columns []Column `json:"columns"` // columns info
}

Conditions query conditions

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 `json:"phone" binding:"e164"`         // phone number, e164 rules, e.g. +8612345678901
	Avatar   string `json:"avatar" binding:"min=5"`       // avatar
	Age      int    `json:"age" binding:"gt=0,lt=120"`    // age
	Gender   int    `json:"gender" binding:"gte=0,lte=2"` // gender, 1:Male, 2:Female, other values:unknown
}

CreateUserExampleRequest request params

type CreateUserExampleRespond added in v1.5.3

type CreateUserExampleRespond struct {
	Code int    `json:"code"` // return code
	Msg  string `json:"msg"`  // return information description
	Data struct {
		ID uint64 `json:"id"` // id
	} `json:"data"` // return data
}

CreateUserExampleRespond only for api docs

type DeleteUserExampleByIDRespond added in v1.5.3

type DeleteUserExampleByIDRespond struct {
	Result
}

DeleteUserExampleByIDRespond only for api docs

type GetUserExampleByIDRespond

type GetUserExampleByIDRespond struct {
	Code int    `json:"code"` // return code
	Msg  string `json:"msg"`  // return information description
	Data struct {
		UserExample UserExampleObjDetail `json:"userExample"`
	} `json:"data"` // return data
}

GetUserExampleByIDRespond only for api docs

type ListUserExamplesRequest added in v1.5.3

type ListUserExamplesRequest struct {
	query.Params
}

ListUserExamplesRequest request params

type ListUserExamplesRespond

type ListUserExamplesRespond struct {
	Code int    `json:"code"` // return code
	Msg  string `json:"msg"`  // return information description
	Data struct {
		UserExamples []UserExampleObjDetail `json:"userExamples"`
	} `json:"data"` // return data
}

ListUserExamplesRespond only for api docs

type Params

type Params struct {
	Page int    `json:"page"`           // page number, starting from page 0
	Size int    `json:"size"`           // lines per page
	Sort string `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 `json:"phone" binding:""`    // phone number
	Avatar   string `json:"avatar" binding:""`   // avatar
	Age      int    `json:"age" binding:""`      // age
	Gender   int    `json:"gender" binding:""`   // gender, 1:Male, 2:Female, other values:unknown
}

UpdateUserExampleByIDRequest request params

type UpdateUserExampleByIDRespond added in v1.5.3

type UpdateUserExampleByIDRespond struct {
	Result
}

UpdateUserExampleByIDRespond only for api docs

type UserExampleObjDetail added in v1.5.3

type UserExampleObjDetail 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:"loginAt"`   // login timestamp
	CreatedAt time.Time `json:"createdAt"` // create time
	UpdatedAt time.Time `json:"updatedAt"` // update time
}

UserExampleObjDetail detail

Jump to

Keyboard shortcuts

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