update: The code structure is finished, and the project can run successfully
This commit is contained in:
@@ -5,10 +5,10 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type response struct {
|
||||
code int
|
||||
data interface{}
|
||||
msg string
|
||||
type Response struct {
|
||||
Code int `json:"code"`
|
||||
Data interface{} `json:"data"`
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -18,7 +18,7 @@ const (
|
||||
|
||||
func Result(code int, data interface{}, msg string, c *gin.Context) {
|
||||
// 开始时间
|
||||
c.JSON(http.StatusOK, response{
|
||||
c.JSON(http.StatusOK, Response{
|
||||
code,
|
||||
data,
|
||||
msg,
|
||||
|
Reference in New Issue
Block a user