Commit 21e9de18 by zhengqiuyun86

返回封装优化

parent b3f0438b
...@@ -65,9 +65,10 @@ func SuccessData(c *gin.Context, data interface{}) { ...@@ -65,9 +65,10 @@ func SuccessData(c *gin.Context, data interface{}) {
logEnd(c, resp) logEnd(c, resp)
} }
func SuccessString(c *gin.Context, format string, values ...interface{}) { func SuccessString(c *gin.Context, data string) {
c.String(http.StatusOK, format, values) c.String(http.StatusOK, data)
logEnd(c, fmt.Sprintf(format, values)) c.Abort()
logEnd(c, data)
} }
func logEnd(c *gin.Context, data interface{}) { func logEnd(c *gin.Context, data interface{}) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment