feat 初次提交
This commit is contained in:
27
internal/handler/http_handler/test.go
Normal file
27
internal/handler/http_handler/test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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: "成功了",
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user