|
123456789101112131415161718192021222324252627282930313233 |
- package hdl
-
- import (
- "applet/app/e"
- "applet/app/svc"
- "github.com/gin-gonic/gin"
- )
-
- // Demo
- // @Summary Demo测试
- // @Tags Demo
- // @Description Demo样例测试
- // @Accept json
- // @Produce json
- // @Param req body interface{} true "用户名密码"
- // @Success 200 {object} map[string]interface{} "token"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/demo [post]
- func Demo(c *gin.Context) {
- var args interface{}
- err := c.ShouldBindJSON(&args)
- if err != nil {
- err = svc.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
-
- e.OutSuc(c, map[string]interface{}{
- "args": args,
- }, nil)
- return
- }
|