蛋蛋星球 后台端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hdl_demo.go 756 B

1 maand geleden
1 maand geleden
1 maand geleden
123456789101112131415161718192021222324252627282930313233
  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/svc"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // Demo
  8. // @Summary Demo测试
  9. // @Tags Demo
  10. // @Description Demo样例测试
  11. // @Accept json
  12. // @Produce json
  13. // @Param req body interface{} true "用户名密码"
  14. // @Success 200 {object} map[string]interface{} "token"
  15. // @Failure 400 {object} md.Response "具体错误"
  16. // @Router /api/demo [post]
  17. func Demo(c *gin.Context) {
  18. var args interface{}
  19. err := c.ShouldBindJSON(&args)
  20. if err != nil {
  21. err = svc.HandleValidateErr(err)
  22. err1 := err.(e.E)
  23. e.OutErr(c, err1.Code, err1.Error())
  24. return
  25. }
  26. e.OutSuc(c, map[string]interface{}{
  27. "args": args,
  28. }, nil)
  29. return
  30. }