response

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Created added in v0.1.1

func Created(c *gin.Context, data any, location string)

Created 返回资源表示及其地址。

func Fail

func Fail(c *gin.Context, status int, message string, args ...any)

func ID

func ID(c *gin.Context) uint

ID 统一解析路由主键, 避免非法值落入无条件查询.

func IDs added in v0.1.1

func IDs(c *gin.Context) []uint

IDs 接受单条路径ID或集合上的显式ID列表,不接受整集合删除。

func Order

func Order(c *gin.Context, fields ...string) clause.OrderByColumn

Order 仅允许列表已公开的字段参与排序.

func Page

func Page(c *gin.Context) (int, int)

Page 保留调用方指定的条数,不设置固定上限。

func Paginated added in v0.1.1

func Paginated(c *gin.Context, data any, total int64, page, size int)

func Report

func Report(c *gin.Context, err error, status ...int)

func Respond

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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