You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
323 B
26 lines
323 B
package response
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
)
|
|
|
|
type response struct {
|
|
code int
|
|
data interface{}
|
|
msg string
|
|
}
|
|
|
|
const (
|
|
ERROR = 7
|
|
SUCCESS = 0
|
|
)
|
|
|
|
func Result(code int, data interface{}, msg string, c *gin.Context) {
|
|
// 开始时间
|
|
c.JSON(http.StatusOK, response{
|
|
code,
|
|
data,
|
|
msg,
|
|
})
|
|
}
|