httpUtils

package
v0.0.0-...-a97389e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSepIfNeeded

func AddSepIfNeeded(url string) (ret string)

func CrsAuth

func CrsAuth() context.Handler

func Get

func Get(url string) (ret []byte, err error)

func GetCheckForward

func GetCheckForward(url string) (ret []byte, isForward bool, err error)

func IsSuccessCode

func IsSuccessCode(code int) (success bool)

func Post

func Post(url string, data interface{}) (ret []byte, err error)

func PostOrPut

func PostOrPut(url string, method string, data interface{}) (ret []byte, err error)

func Put

func Put(url string, data interface{}) (ret []byte, err error)

Types

type PageResult

type PageResult struct {
	Items interface{} `json:"items"`
	Total int64       `json:"totalPage"`
}

type Request

type Request struct {
	PageSize int `json:"pageSize"`
	PageNo   int `json:"pageNo"`
	Aa       int `json:"aa"`
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Type    string      `json:"type"`
	Message interface{} `json:"message"`
	Result  interface{} `json:"result"`
}

func ApiRes

func ApiRes(code consts.ResultCode, msg string, objects interface{}) (r *Response)

func ApiResPage

func ApiResPage(code consts.ResultCode, msg string, objects interface{}, pageNo, pageSize int, total int64) (r *Response)

Jump to

Keyboard shortcuts

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