Commit 21e9de18 by zhengqiuyun86

返回封装优化

parent b3f0438b
......@@ -65,9 +65,10 @@ func SuccessData(c *gin.Context, data interface{}) {
logEnd(c, resp)
}
func SuccessString(c *gin.Context, format string, values ...interface{}) {
c.String(http.StatusOK, format, values)
logEnd(c, fmt.Sprintf(format, values))
func SuccessString(c *gin.Context, data string) {
c.String(http.StatusOK, data)
c.Abort()
logEnd(c, data)
}
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