Documentation ¶ Index ¶ func GetLanguage(r *http.Request) string func GetTraceId(r *http.Request) string func Response(r *http.Request, w http.ResponseWriter, resp interface{}, err error) type Body 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"` } Source Files ¶ View all Source files response.go Click to show internal directories. Click to hide internal directories.