package sbyj import ( "mtp2_if/global/app" "mtp2_if/global/e" "mtp2_if/logger" "mtp2_if/models" "net/http" "github.com/gin-gonic/gin" ) // GetMyOrders 获取我的订单列表 // @Summary 获取我的订单列表 // @Produce json // @Security ApiKeyAuth // @Param userId query int true "用户ID" // @Param goodsId query int false "商品ID" // @Success 200 {array} models.RedisTradeHolderDetailEx // @Failure 500 {object} app.Response // @Router /sbyj/GetMyOrders [get] // @Tags 订单系统 func GetMyOrders(c *gin.Context) { appG := app.Gin{C: c} // 获取请求参数 var req GetMyOrdersReq if err := appG.C.ShouldBindQuery(&req); err != nil { logger.GetLogger().Errorf("GetMyOrders failed: %s", err.Error()) appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil) return } // 获取数据 d := models.RedisTradeHolderDetailEx{} rsp, err := d.GetDataEx(req.UserId, req.GoodsId) if err != nil { // 查询失败 logger.GetLogger().Errorf("GetMyOrders failed: %s", err.Error()) appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil) return } // 查询成功返回 appG.Response(http.StatusOK, e.SUCCESS, rsp) } // QueryMyTradegoodsdeliveryoffline 查询我的交收 // @Summary 查询我的交收 // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param status query string false "格式:1,2,3 交收单状态2(52模式使用) - 1:待审核 2:待确认 3:待付款 4:付款中 5:已完成付款 6:处理中 20:交收完成 21:审核拒绝 22:确认过期 23:付款过期 24:财务撤销 -- 枚举deliveryStatus" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.MyTradegoodsdeliveryoffline // @Failure 500 {object} app.Response // @Router /sbyj/QueryMyTradegoodsdeliveryoffline [get] // @Tags 订单系统 func QueryMyTradegoodsdeliveryoffline(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.MyTradegoodsdeliveryoffline{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryMyDeliveryofflinedetail 查询我的交收-订单明细 // @Summary 查询我的交收-订单明细 // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param deliveryorderid query string true "交收单号(905+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.MyDeliveryofflinedetail // @Failure 500 {object} app.Response // @Router /sbyj/QueryMyDeliveryofflinedetail [get] // @Tags 订单系统 func QueryMyDeliveryofflinedetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.MyDeliveryofflinedetail{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryMyDeliveryofflineoperatelog 查询我的交收-操作明细 // @Summary 查询我的交收-操作明细 // @Produce json // @Security ApiKeyAuth // @Param deliveryorderid query string true "交收单号(905+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)" // @Param operatetype query int false "操作类型 - 1:交收流程 2:付款流水" // @Param deliverypaymode query int false "付款方式 - 1:线上支付2:线下支付 - 枚举deliveryPayMode" // @Param confirmstatus query int false "确认状态 - 1:未确认 2:已确认 - 枚举confirmStatus" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.MyDeliveryofflineoperatelog // @Failure 500 {object} app.Response // @Router /sbyj/QueryMyDeliveryofflineoperatelog [get] // @Tags 订单系统 func QueryMyDeliveryofflineoperatelog(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.MyDeliveryofflineoperatelog{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryTradeHolderDetailEx 查询我的订单 // @Summary 查询我的订单 // @Produce json // @Security ApiKeyAuth // @Param accountid query int true "资金账户" // @Param tradedate query string false "交易日(yyyyMMdd)" // @Param goodsid query int false "商品ID" // @Param holderqty query int false "持仓数量" // @Param marketids query string false "目标市场ID列表,格式 1,2,3" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.Tradeholderdetailex // @Failure 500 {object} app.Response // @Router /sbyj/QueryTradeHolderDetailEx [get] // @Tags 订单系统 func QueryTradeHolderDetailEx(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.Tradeholderdetailex{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryTradeCloseDetails 查询我的终止订单 // @Summary 查询我的终止订单 // @Produce json // @Security ApiKeyAuth // @Param accountid query int true "资金账户" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.TradeCloseDetail // @Failure 500 {object} app.Response // @Router /sbyj/QueryTradeCloseDetails [get] // @Tags 订单系统 func QueryTradeCloseDetails(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.TradeCloseDetail{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryMemberPayInfos 查询所属会员的支付信息 // @Summary 查询所属会员的支付信息 // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户id" // @Success 200 {array} models.MemberPayInfo // @Failure 500 {object} app.Response // @Router /sbyj/QueryMemberPayInfos [get] // @Tags 订单系统 func QueryMemberPayInfos(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.MemberPayInfo{} a.DoBindReq(&m) a.DoGetDataEx(&m) } // QueryUserTradeSettings 查询用户交易个性化设置 // @Summary 查询用户交易个性化设置 // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户id" // @Success 200 {array} models.MemberPayInfo // @Failure 500 {object} app.Response // @Router /sbyj/QueryUserTradeSettings [get] // @Tags 订单系统 func QueryUserTradeSettings(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.MemberPayInfo{} a.DoBindReq(&m) a.DoGetDataEx(&m) }