Documentation
¶
Overview ¶
Package types define the structure of request parameters and return results in this package
Index ¶
- type Column
- type Conditions
- type CreateUserExampleReply
- type CreateUserExampleRequest
- type DeleteUserExampleByIDReply
- type GetUserExampleByIDReply
- type ListUserExamplesReply
- type ListUserExamplesRequest
- type Params
- type Result
- type UpdateUserExampleByIDReply
- type UpdateUserExampleByIDRequest
- type UserExampleObjDetail
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, default value is "and", support &, and, ||, or
}
Column information
type Conditions ¶
type Conditions struct {
Columns []Column `json:"columns"` // columns info
}
Conditions query conditions
type CreateUserExampleReply ¶
type CreateUserExampleReply 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
}
CreateUserExampleReply only for api docs
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 DeleteUserExampleByIDReply ¶
type DeleteUserExampleByIDReply struct {
Code int `json:"code"` // return code
Msg string `json:"msg"` // return information description
Data struct{} `json:"data"` // return data
}
DeleteUserExampleByIDReply only for api docs
type GetUserExampleByIDReply ¶
type GetUserExampleByIDReply struct {
Code int `json:"code"` // return code
Msg string `json:"msg"` // return information description
Data struct {
UserExample UserExampleObjDetail `json:"userExample"`
} `json:"data"` // return data
}
GetUserExampleByIDReply only for api docs
type ListUserExamplesReply ¶
type ListUserExamplesReply struct {
Code int `json:"code"` // return code
Msg string `json:"msg"` // return information description
Data struct {
UserExamples []UserExampleObjDetail `json:"userExamples"`
} `json:"data"` // return data
}
ListUserExamplesReply only for api docs
type ListUserExamplesRequest ¶
ListUserExamplesRequest request params
type Params ¶
type Params struct {
Page int `json:"page"` // page number, starting from page 0
Limit int `json:"limit"` // 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 UpdateUserExampleByIDReply ¶
type UpdateUserExampleByIDReply struct {
Code int `json:"code"` // return code
Msg string `json:"msg"` // return information description
Data struct{} `json:"data"` // return data
}
UpdateUserExampleByIDReply only for api docs
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 UserExampleObjDetail ¶
type UserExampleObjDetail struct {
ID uint64 `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
Click to show internal directories.
Click to hide internal directories.