package ferroalloy import ( "mtp2_if/global/app" "mtp2_if/global/e" "mtp2_if/logger" "mtp2_if/models" "net/http" "github.com/gin-gonic/gin" ) // GetSpotGoodsPrice // @Summary 获取现货行情 // @Produce json // @Security ApiKeyAuth // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.GErmcpspotgoodsprice // @Failure 500 {object} app.Response // @Router /Ferroalloy/GetSpotGoodsPrice [get] // @Tags 铁合金 func GetSpotGoodsPrice(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.GErmcpspotgoodsprice{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryTHJProduct // @Summary 获取产品介绍列表 // @Produce json // @Security ApiKeyAuth // @Param userid query int true "用户ID" // @Param favoriteflag query bool false "关注标志 true-已关注 false-未关注" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.THJProduct // @Failure 500 {object} app.Response // @Router /Ferroalloy/QueryTHJProduct [get] // @Tags 铁合金 func QueryTHJProduct(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.THJProduct{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryTHJGoodsDetail // @Summary 查询商品详情 // @Produce json // @Security ApiKeyAuth // @Param wrstandardid query int true "现货商品ID" // @Success 200 {array} models.THJGoodsDetailRsp // @Failure 500 {object} app.Response // @Router /Ferroalloy/QueryTHJGoodsDetail [get] // @Tags 铁合金 func QueryTHJGoodsDetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.THJGoodsDetailReq{} if err := a.C.ShouldBind(&m); err != nil { a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil) return } if rsp, err := m.GetTHJGoodsDetail(); 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) } } // 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) } // QueryTHJListing // @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/QueryTHJListing [get] // @Tags 铁合金 func QueryTHJListing(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.THJWrstandard{GoodsType: 1} 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) } } // QueryTHJPurchaseTransfer // @Summary 查询合同转让列表 // @Produce json // @Security ApiKeyAuth // @Param wrstandardname query string false "现货商品名称(模糊查询)" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.PurchaseTransfer // @Failure 500 {object} app.Response // @Router /Ferroalloy/QueryTHJPurchaseTransfer [get] // @Tags 铁合金 func QueryTHJPurchaseTransfer(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.PurchaseTransfer{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryTHJPurchaseTransferDetail // @Summary 查询合同转让详情 // @Produce json // @Security ApiKeyAuth // @Param wrstandardid query int true "现货商品ID" // @Success 200 {array} models.THJPurchaseTradeDetailRsp // @Failure 500 {object} app.Response // @Router /Ferroalloy/QueryTHJPurchaseTransferDetail [get] // @Tags 铁合金 func QueryTHJPurchaseTransferDetail(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.THJPurchaseTradeDetailReq{} if err := a.C.ShouldBind(&m); err != nil { a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil) return } if rsp, err := m.GetData(); 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) } } // QuerySpotgoodsPrice // @Summary 查询行情-现货列表 // @Produce json // @Security ApiKeyAuth // @Param wrstandardid query int false "现货商品ID" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.Spotgoodsprice // @Failure 500 {object} app.Response // @Router /Ferroalloy/QuerySpotgoodsPrice [get] // @Tags 铁合金 func QuerySpotgoodsPrice(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.Spotgoodsprice{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } // QueryThjSpotQuoteConfig // @Summary 查询现货行情配置表 // @Produce json // @Success 200 {array} models.Thjspotquoteconfig // @Failure 500 {object} app.Response // @Router /Ferroalloy/QueryThjSpotQuoteConfig [get] // @Tags 铁合金 func QueryThjSpotQuoteConfig(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.Thjspotquoteconfig{} a.DoBindReq(&m) a.DoGetDataEx(&m) }