hello.go 885 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package controllers
  2. import (
  3. "hongze/hongze_cygxzs/models"
  4. )
  5. type HelloCommonController struct {
  6. BaseCommonController
  7. }
  8. // @Title 路由1
  9. // @Description 路由1
  10. // @Param Url query string true "url地址"
  11. // @router /hello [get]
  12. func (this *HelloCommonController) TesrR1() {
  13. br := new(models.BaseResponse).Init()
  14. defer func() {
  15. this.Data["json"] = br
  16. this.ServeJSON()
  17. }()
  18. getUrl := this.GetString("Url")
  19. br.Ret = 200
  20. br.Success = true
  21. br.Msg = "路由1"
  22. br.Data = getUrl
  23. }
  24. // @Title 路由2
  25. // @Description 路由2
  26. // @Param Url query string true "url地址"
  27. // @router /hello2 [get]
  28. func (this *HelloCommonController) TesrR2() {
  29. br := new(models.BaseResponse).Init()
  30. defer func() {
  31. this.Data["json"] = br
  32. this.ServeJSON()
  33. }()
  34. getUrl := this.GetString("Url")
  35. br.Ret = 200
  36. br.Success = true
  37. br.Msg = "路由2"
  38. br.Data = getUrl
  39. }