response

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(c *gin.Context, err error)

Err 返回错误响应。自动识别 *types.Error 类型。

func OK

func OK(c *gin.Context, data any)

OK 返回成功响应。

Types

type Result

type Result struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data,omitempty"`
	Details string `json:"details,omitempty"`
}

Result 统一 JSON 响应结构。

Jump to

Keyboard shortcuts

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