广告平台(站长使用)
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

hdl_index.go 2.1 KiB

2 tygodni temu
2 tygodni temu
2 tygodni temu
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/lib/validate"
  5. "applet/app/md"
  6. "applet/app/svc"
  7. "applet/app/utils"
  8. "github.com/gin-gonic/gin"
  9. )
  10. // Base
  11. // @Summary 右上角基本数据
  12. // @Tags 首页------嘉俊
  13. // @Description 首页-右上角基本数据
  14. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  15. // @Accept json
  16. // @Produce json
  17. // @Success 200 {string} "具体看返回内容 这是data里面的数据"
  18. // @Failure 400 {object} md.Response "具体错误"
  19. // @Router /api/index/base [GET]
  20. func Base(c *gin.Context) {
  21. user := svc.GetUser(c)
  22. name := user.Username
  23. res := map[string]string{
  24. "account_id": utils.IntToStr(user.AdmId),
  25. "name": name,
  26. "account": user.Username,
  27. }
  28. e.OutSuc(c, res, nil)
  29. return
  30. }
  31. // IndexTotal
  32. // @Summary 统计数据
  33. // @Tags 首页------嘉俊
  34. // @Description 首页-统计数据
  35. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  36. // @Accept json
  37. // @Produce json
  38. // @Success 200 {string} "具体看返回内容 这是data里面的数据"
  39. // @Failure 400 {object} md.Response "具体错误"
  40. // @Router /api/index/total [GET]
  41. func IndexTotal(c *gin.Context) {
  42. svc.IndexTotal(c)
  43. }
  44. // IndexAppList
  45. // @Summary 应用数据
  46. // @Tags 首页------嘉俊
  47. // @Description 首页-应用数据
  48. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  49. // @Accept json
  50. // @Produce json
  51. // @Param args body md.IndexAppListReq true "请求参数"
  52. // @Success 200 {object} md.IndexAppListRes "具体看返回内容 这是data里面的数据"
  53. // @Failure 400 {object} md.Response "具体错误"
  54. // @Router /api/index/app/list [POST]
  55. func IndexAppList(c *gin.Context) {
  56. var req md.IndexAppListReq
  57. err := c.ShouldBindJSON(&req)
  58. if err != nil {
  59. err = validate.HandleValidateErr(err)
  60. err1 := err.(e.E)
  61. e.OutErr(c, err1.Code, err1.Error())
  62. return
  63. }
  64. res := svc.IndexAppList(c, req)
  65. e.OutSuc(c, res, nil)
  66. return
  67. }