update: The code structure is finished, and the project can run successfully

This commit is contained in:
QM303176530
2020-04-05 16:18:19 +08:00
parent 1891c1bcbc
commit 08ff55ffce
13 changed files with 60 additions and 50 deletions

View File

@@ -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,