| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package ferroalloy
- import (
- "mtp2_if/global/app"
- "mtp2_if/global/e"
- "mtp2_if/logger"
- "mtp2_if/models"
- "net/http"
- "github.com/gin-gonic/gin"
- )
- // QueryMyRefer
- // @Summary 查询我的推荐列表
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Param page query int false "页码"
- // @Param pagesize query int false "每页条数"
- // @Success 200 {array} models.MyRefer
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryMyRefer [get]
- // @Tags 铁合金
- func QueryMyRefer(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.MyRefer{}
- a.DoBindReq(&m)
- a.DoGetDataByPage(&m)
- }
- // QueryMyRegisterMoney
- // @Summary 查询我的注册红包
- // @Produce json
- // @Param accountid query int true "资金账户"
- // @Success 200 {array} models.RegisterMoney
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryMyRegisterMoney [get]
- // @Tags 铁合金
- func QueryMyRegisterMoney(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.RegisterMoney{}
- a.DoBindReq(&m)
- a.DoGetDataEx(&m)
- }
- // QueryUserLevelInfo
- // @Summary 查询用户等级信息
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Success 200 {array} models.THJUserLevelInfo
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryUserLevelInfo [get]
- // @Tags 铁合金
- func QueryUserLevelInfo(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.THJUserLevelInfo{}
- if err := a.C.ShouldBind(&m); err != nil {
- a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
- return
- }
- if err := m.Get(); err == nil {
- a.Gin.Response(http.StatusOK, e.SUCCESS, m)
- } else {
- logger.GetLogger().Errorf("query fail, %v", err)
- a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
- }
- }
|