resp

package
v0.0.0-...-7444d27 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCtx

func ErrorCtx(ctx iris.Context, code int, data any, msg string)

ErrorCtx 响应失败

func OkCtx

func OkCtx(ctx iris.Context, data any)

OkCtx 响应成功

Types

type Resp

type Resp struct {
	Success   bool   `json:"success"`
	Code      int    `json:"code"` // 状态码
	Data      any    `json:"data"` // 数据
	Msg       string `json:"msg"`  // 提示信息
	Timestamp int64  `json:"timestamp"`
}

Resp 响应体结构

func Error

func Error(code int, data any, msg string) Resp

Error 响应失败

func Ok

func Ok(data any) Resp

Ok 响应成功

Jump to

Keyboard shortcuts

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