index.go 702 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package api
  2. import (
  3. "Gwen/http/response"
  4. "github.com/gin-gonic/gin"
  5. "net/http"
  6. )
  7. type Index struct {
  8. }
  9. // Index 首页
  10. // @Tags 首页
  11. // @Summary 首页
  12. // @Description 首页
  13. // @Accept json
  14. // @Produce json
  15. // @Success 200 {object} response.Response
  16. // @Failure 500 {object} response.Response
  17. // @Router / [get]
  18. func (i *Index) Index(c *gin.Context) {
  19. response.Success(
  20. c,
  21. "Hello Gwen",
  22. )
  23. }
  24. // Heartbeat 心跳
  25. // @Tags 首页
  26. // @Summary 心跳
  27. // @Description 心跳
  28. // @Accept json
  29. // @Produce json
  30. // @Success 200 {object} nil
  31. // @Failure 500 {object} response.Response
  32. // @Router /heartbeat [post]
  33. func (i *Index) Heartbeat(c *gin.Context) {
  34. c.JSON(http.StatusOK, gin.H{})
  35. }