rep

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Err = "9999" // 业务失败
	Ok  = "0000" // 业务成功
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string

type Page

type Page struct {
	Count int64 `json:"count"` //总数
	Rows  any   `json:"rows"`  //数据内容
}

Page 分页数据

func NewPage

func NewPage(count int64, data any) *Page

type Response

type Response struct {
	Code   `json:"code"` // 状态码
	Status int           `json:"status"` // 响应状态码
	Msg    string        `json:"msg"`    // 附加消息
	Data   any           `json:"data"`   // 响应数据
	Err    string        `json:"err"`    // 错误信息
}

Response 请求处理统一返回结果

func Fail

func Fail(e error, message ...string) Response

Fail 业务处理失败

func Success

func Success(data any, message ...string) Response

Success 业务处理成功

func (*Response) String added in v0.0.2

func (msg *Response) String() string

Jump to

Keyboard shortcuts

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