Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GinLogger = gin.LoggerWithFormatter(func(p gin.LogFormatterParams) string { return fmt.Sprintf(`{"time":"%s","client":"%s","method":"%s","path":"%s","latency":"%s","status":%d,"emsg":"%s"}`+"\n", p.TimeStamp.Format(time.DateTime), p.ClientIP, p.Method, p.Path, p.Latency, p.StatusCode, p.ErrorMessage, ) })
Functions ¶
func LaunchServer ¶
func RegisterTimeLogRoutes ¶
func RegisterTimeLogRoutes(group *gin.RouterGroup)
RegisterTimeLogRoutes 注册 TimeLog 相关路由
Types ¶
type ApiResponse ¶
type ApiResponse struct {
Data interface{} `json:"data"`
Message string `json:"message,omitempty"`
Status int `json:"status"`
}
ApiResponse 统一API响应结构
func SuccessResponse ¶
func SuccessResponse(data interface{}, message ...string) ApiResponse
SuccessResponse 成功响应
Click to show internal directories.
Click to hide internal directories.