apitool

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestBuilder

func NewRequestBuilder[T any](method, urlString string) (*requestBuilder[T], error)

func ResponseApiError

func ResponseApiError(c *gin.Context, statusCode int, msg string, err interface{})

func ResponseApiOk

func ResponseApiOk(c *gin.Context, msg string, data interface{})

func ResponseHtml

func ResponseHtml(c *gin.Context, statusCode int, html string, data interface{})

Types

type ApiResponse

type ApiResponse struct {
	Success bool        `json:"success"`
	Code    int         `json:"code"`
	Msg     string      `json:"msg"`
	Data    interface{} `json:"data,omitempty"`
}

type PaginationResult

type PaginationResult struct {
	Records []interface{} `json:"records"`
	Current int           `json:"current"`
	Size    int           `json:"size"`
	Total   int           `json:"total"`
	Pages   int           `json:"pages"`
}

Jump to

Keyboard shortcuts

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