dto

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// 请求id
	// in: body
	// required: false
	RequestID string `json:"requestId" example:"1234567890123456789" format:"string"`
	// 错误码
	// in: body
	// required: true
	Code constants.ICodeType `json:"code" format:"int" validate:"required"`
	// 是否成功
	// in: body
	// required: true
	Success bool `json:"success" example:"true" format:"bool" validate:"required"`
	// 提示信息
	// in: body
	// required: true
	Message string `json:"message" example:"SUCCESS" format:"string" validate:"required"`
	// 服务器时间(毫秒时间戳)
	// in: body
	// required: true
	Timestamp int64 `json:"ts" example:"1670899688591" format:"int64" validate:"required"`
	// 业务数据
	// in: body
	// required: true
	Data interface{} `json:"data" format:"object|array|string" validate:"required"`
}

Base 公共返回参数 swagger: model

type Error400

type Error400 struct {
	// 请求id
	// in: body
	// required: false
	RequestID string `json:"requestId" example:"1234567890123456789" format:"string"`
	// 错误码
	// in: body
	// required: true
	Code int `json:"code" example:"100000" format:"int" validate:"required"`
	// 是否成功
	// in: body
	// required: true
	Success bool `json:"success" example:"false" format:"bool" validate:"required"`
	// 提示信息
	// in: body
	// required: true
	Message string `json:"message" example:"Bad request parameters" format:"string" validate:"required"`
	// 服务器时间(毫秒时间戳)
	// in: body
	// required: true
	Timestamp int64 `json:"ts" example:"1670899688591" format:"int64" validate:"required"`
	// 业务数据
	// in: body
	// required: true
	Data interface{} `json:"data" format:"object|array|string" validate:"required"`
}

Error400 错误返回参数 swagger: model

type Error500

type Error500 struct {
	// 请求id
	// in: body
	// required: false
	RequestID string `json:"requestId" example:"1234567890123456789" format:"string"`
	// 错误码
	// in: body
	// required: true
	Code int `json:"code" example:"999999" format:"int" validate:"required"`
	// 是否成功
	// in: body
	// required: true
	Success bool `json:"success" example:"false" format:"bool" validate:"required"`
	// 提示信息
	// in: body
	// required: true
	Message string `json:"message" example:"Internal server error" format:"string" validate:"required"`
	// 服务器时间(毫秒时间戳)
	// in: body
	// required: true
	Timestamp int64 `json:"ts" example:"1670899688591" format:"int64" validate:"required"`
	// 业务数据
	// in: body
	// required: true
	Data interface{} `json:"data" format:"object|array|string" validate:"required"`
}

Error500 错误返回参数 swagger: model

type IResponse

type IResponse interface {
	//GetData 获取data字段实际数据
	GetData() interface{}
}

IResponse 统一返回接口

type Paginate

type Paginate struct {
	Page       int   `json:"page" format:"int" example:"1" validate:"required"`          //页码,从1开始
	PageSize   int   `json:"pageSize" format:"int" example:"10" validate:"required"`     //页面条数
	TotalCount int64 `json:"totalCount" format:"int64" example:"20" validate:"required"` //总条数
}

Paginate 分页器

Jump to

Keyboard shortcuts

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