responsex

package
v0.0.0-...-b32e05d Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLanguage

func GetLanguage(r *http.Request) string

GetLanguage 获取app设置的Language,根据Language返回多语言.

func GetTraceId

func GetTraceId(r *http.Request) string

GetTraceId 获取TraceId.

func Response

func Response(r *http.Request, w http.ResponseWriter, resp interface{}, err error)

Response 统一封装成功响应值.

Types

type Body

type Body struct {
	Code        int         `json:"code"`
	Message     string      `json:"message"`
	Data        interface{} `json:"data,omitempty"`
	EncryptData interface{} `json:"encrypt_data,omitempty"`
	TraceId     string      `json:"trace_id"`
}

Jump to

Keyboard shortcuts

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