result

package
v0.0.0-...-3e6627e Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] struct {
	Code      int    `json:"code" description:"HTTP 状态码"`
	Message   string `json:"message,omitempty" description:"返回消息"`
	Data      T      `json:"data,omitempty" description:"返回的数据"`
	TheadName string `json:"theadName,omitempty" description:"链路追踪"`
}

Result 定义统一返回对象

func NewErrorResult

func NewErrorResult[T any](code int, message string, c *gin.Context) *Result[T]

func NewErrorResultC

func NewErrorResultC[T any](code int, message string) *Result[T]

func NewOkResult

func NewOkResult[T any](data T, c *gin.Context) *Result[T]

type YdPage

type YdPage[T any] struct {
	Total   any `json:"total" description:"分页总数"`
	Records []T `json:"records" description:"分页数据"`
}

func NewYdPage

func NewYdPage[T any](total any, records []T) *YdPage[T]

NewYdPage 构造函数,用于创建并初始化 YdPage 对象

Jump to

Keyboard shortcuts

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