mine.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package ferroalloy
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. "mtp2_if/models"
  7. "net/http"
  8. "github.com/gin-gonic/gin"
  9. )
  10. // QueryMyRefer
  11. // @Summary 查询我的推荐列表
  12. // @Produce json
  13. // @Security ApiKeyAuth
  14. // @Param userid query int true "用户ID"
  15. // @Param page query int false "页码"
  16. // @Param pagesize query int false "每页条数"
  17. // @Success 200 {array} models.MyRefer
  18. // @Failure 500 {object} app.Response
  19. // @Router /Ferroalloy/QueryMyRefer [get]
  20. // @Tags 铁合金
  21. func QueryMyRefer(c *gin.Context) {
  22. a := app.GinUtils{Gin: app.Gin{C: c}}
  23. m := models.MyRefer{}
  24. a.DoBindReq(&m)
  25. a.DoGetDataByPage(&m)
  26. }
  27. // QueryMyRegisterMoney
  28. // @Summary 查询我的注册红包
  29. // @Produce json
  30. // @Param accountid query int true "资金账户"
  31. // @Success 200 {array} models.RegisterMoney
  32. // @Failure 500 {object} app.Response
  33. // @Router /Ferroalloy/QueryMyRegisterMoney [get]
  34. // @Tags 铁合金
  35. func QueryMyRegisterMoney(c *gin.Context) {
  36. a := app.GinUtils{Gin: app.Gin{C: c}}
  37. m := models.RegisterMoney{}
  38. a.DoBindReq(&m)
  39. a.DoGetDataEx(&m)
  40. }
  41. // QueryUserLevelInfo
  42. // @Summary 查询用户等级信息
  43. // @Produce json
  44. // @Security ApiKeyAuth
  45. // @Param userid query int true "用户ID"
  46. // @Success 200 {array} models.THJUserLevelInfo
  47. // @Failure 500 {object} app.Response
  48. // @Router /Ferroalloy/QueryUserLevelInfo [get]
  49. // @Tags 铁合金
  50. func QueryUserLevelInfo(c *gin.Context) {
  51. a := app.GinUtils{Gin: app.Gin{C: c}}
  52. m := models.THJUserLevelInfo{}
  53. if err := a.C.ShouldBind(&m); err != nil {
  54. a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  55. return
  56. }
  57. if err := m.Get(); err == nil {
  58. a.Gin.Response(http.StatusOK, e.SUCCESS, m)
  59. } else {
  60. logger.GetLogger().Errorf("query fail, %v", err)
  61. a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  62. }
  63. }