rest

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestResult

type RestResult struct {
	Code    int         `json:"code"`    // 状态码:1=成功,0=失败
	Message string      `json:"message"` // 消息
	Data    interface{} `json:"data"`    // 数据
}

RestResult 通用API响应结构 用于所有云函数的HTTP响应输出

func NewError

func NewError(message string) *RestResult

NewError 创建错误响应

func NewSuccess

func NewSuccess(data interface{}) *RestResult

NewSuccess 创建成功响应

Jump to

Keyboard shortcuts

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