package http_handler import ( "common/net/http/http_resp" "github.com/gin-gonic/gin" ) // 这个模块处理用户登录 type TestReq struct { } type TestResp struct { Info string `json:"info"` } func Test(c *gin.Context) { req := &TestReq{} if err := c.ShouldBindJSON(req); err != nil { http_resp.JsonBadRequest(c) return } http_resp.JsonOK(c, http_resp.Success(&TestResp{ Info: "成功了", })) }