| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- package ferroalloy
- import (
- "mtp2_if/global/app"
- "mtp2_if/global/e"
- "mtp2_if/logger"
- "mtp2_if/models"
- "net/http"
- "github.com/gin-gonic/gin"
- )
- // QueryTHJWrstandard
- // @Summary 查询采购列表
- // @Produce json
- // @Security ApiKeyAuth
- // @Param wrstandardname query string false "现货商品名称(模糊查询)"
- // @Param page query int false "页码"
- // @Param pagesize query int false "每页条数"
- // @Success 200 {array} models.THJWrstandard
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryTHJWrstandard [get]
- // @Tags 铁合金
- func QueryTHJWrstandard(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.THJWrstandard{}
- a.DoBindReq(&m)
- a.DoGetDataByPage(&m)
- }
- // QueryTHJWrstandardDetail
- // @Summary 查询采购详情
- // @Produce json
- // @Security ApiKeyAuth
- // @Param wrstandardid query int true "现货商品ID"
- // @Success 200 {array} models.THJWrstandardDetailRsp
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryTHJWrstandardDetail [get]
- // @Tags 铁合金
- func QueryTHJWrstandardDetail(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.THJWrstandardDetailReq{}
- if err := a.C.ShouldBind(&m); err != nil {
- a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
- return
- }
- if rsp, err := m.GetTHJWrstandardDetail(); 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)
- }
- }
- // QueryTHJPurchaseTradeDetail
- // @Summary 查询我的订单-采购订单
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Param type query int false "类型 - 0:未完成 1:已完成"
- // @Param page query int false "页码"
- // @Param pagesize query int false "每页条数"
- // @Success 200 {array} models.Thjpurchasetradedetail
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryTHJPurchaseTradeDetail [get]
- // @Tags 铁合金
- func QueryTHJPurchaseTradeDetail(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.Thjpurchasetradedetail{}
- a.DoBindReq(&m)
- a.DoGetDataByPage(&m)
- }
- // QueryTHJTradeData
- // @Summary 获取我的推广-交易数据
- // @Produce json
- // @Security ApiKeyAuth
- // @Param userid query int true "用户ID"
- // @Param marketid query int true "市场ID 采购-64201 供求-65201"
- // @Param page query int false "页码"
- // @Param pagesize query int false "每页条数"
- // @Success 200 {array} models.THJTradeData
- // @Failure 500 {object} app.Response
- // @Router /Ferroalloy/QueryTHJTradeData [get]
- // @Tags 铁合金
- func QueryTHJTradeData(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.THJTradeData{}
- a.DoBindReq(&m)
- a.DoGetDataByPage(&m)
- }
|