github.com/aaabigfish/gopkg@v1.1.0/ginx/gin.go (about)

     1  package ginx
     2  
     3  import "github.com/gin-gonic/gin"
     4  
     5  func Ok(c *gin.Context, data interface{}, errs ...string) {
     6  	c.JSON(200, NewOk(data, errs...))
     7  }
     8  
     9  func Fail(c *gin.Context, code int, data interface{}, errs ...string) {
    10  	c.JSON(200, NewFail(code, data, errs...))
    11  }
    12  
    13  func FailMsg(c *gin.Context, errs ...string) {
    14  	c.JSON(200, NewFailMsg(errs...))
    15  }
    16  
    17  func FailData(c *gin.Context, data interface{}, errs ...string) {
    18  	c.JSON(200, NewFailData(data, errs...))
    19  }