resp

package
v0.0.0-...-296515a Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 1 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 {
	Code int    `json:"code"` // 状态码
	Data any    `json:"data"` // 数据
	Msg  string `json:"msg"`  // 提示信息
}

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