model

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

author gmfan date 2023/6/27

author gmfan date 2023/6/27

Index

Constants

View Source
const (
	// ASC 升序
	ASC = "asc"
	// DESC 降序
	DESC = "desc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FailResp

type FailResp struct {
	Code uint32 `json:"code"`
	Msg  string `json:"msg"`
}

func Error

func Error(code uint32, msg string) *FailResp

type Log

type Log struct {
	Start int64 `json:"start"`
	Info  any   `json:"info"`
	IsErr bool  `json:"is_err"`
	End   int64 `json:"end"`
}

func NewLog

func NewLog() *Log

type Page

type Page struct {
	Num   int64  `json:"num"`
	Size  int64  `json:"size"`
	Sorts []Sort `json:"sorts"`
}

Page 分页模型,推荐 Num 从第一页开始

type PageResult

type PageResult struct {
	Rows  []any `json:"rows"`
	Total int64 `json:"total"`
}

type Sort

type Sort struct {
	Condition string `json:"condition"`
	Order     string `json:"order"`
}

type SuccessResp

type SuccessResp struct {
	Code uint32 `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func Success

func Success(code uint32, msg string, data any) *SuccessResp

type TraceLog

type TraceLog struct {
	ID   string `json:"id"`
	Logs []*Log `json:"logs"`
}

TraceLog 链路追踪日志模型

func NewTraceLog

func NewTraceLog() *TraceLog

func (*TraceLog) AddLog

func (t *TraceLog) AddLog(log *Log)

Jump to

Keyboard shortcuts

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