| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- 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)
- }
- }
- // QueryInvestorLevelGroup
- // @Summary 查询查询我推荐的好友等级
- // @Produce json
- // @Success 200 {array} models.Thjinvestorlevelgroup
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryInvestorLevelGroup [get]
- // @Tags 铁合金
- func QueryInvestorLevelGroup(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.Thjinvestorlevelgroup{}
- a.DoBindReq(&m)
- a.DoGetDataEx(&m)
- }
- // QueryTHJFriends
- // @Summary 查询好友
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Param customername query string false "客户名称(企业名称),模糊查询"
- // @Param mobile query string false "手机号码(加密存储),加密串精确查询"
- // @Param levelgroupid query int false "等级ID"
- // @Param page query int false "页码"
- // @Param pagesize query int false "每页条数"
- // @Success 200 {array} models.THJFriend
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryTHJFriends [get]
- // @Tags 铁合金
- func QueryTHJFriends(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.THJFriend{}
- a.DoBindReq(&m)
- a.DoGetDataByPage(&m)
- }
- // QueryTHJProfits
- // @Summary 查询收益
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Param marketid query int false "市场ID"
- // @Param accountname query string false "好友名称,模糊查询"
- // @Param goods query string false "商品代码或商品名称,模糊查询"
- // @Param marketid query int false "分润机构角色 - 1:平台 2:经纪会员 3:一级交易商 4:二级交易商(枚举:THJProfitRoleType)"
- // @Param page query int false "页码"
- // @Param pagesize query int false "每页条数"
- // @Success 200 {array} models.THJProfit
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryTHJProfits [get]
- // @Tags 铁合金
- func QueryTHJProfits(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.THJProfit{}
- a.DoBindReq(&m)
- a.DoGetDataByPage(&m)
- }
- // QueryMyDeposit
- // @Summary 查询本人定金比例
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Success 200 {array} models.Thjinvesotrdeposit
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryMyDeposit [get]
- // @Tags 铁合金
- func QueryMyDeposit(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.QueryMyDepositReq{}
- if err := a.C.ShouldBind(&m); err != nil {
- a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
- return
- }
- var r models.Thjinvesotrdeposit
- if rsp, err := r.GetAll(m); err == nil {
- a.Gin.Response(http.StatusOK, e.SUCCESS, rsp)
- } else {
- logger.GetLogger().Errorf("query fail, %v", err)
- a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
- }
- }
|