qryBrandModel.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/3/15 10:41
  4. * @Modify : 2021/3/15 10:41
  5. */
  6. package ermcp
  7. import (
  8. "github.com/gin-gonic/gin"
  9. "mtp2_if/global/app"
  10. "mtp2_if/models"
  11. )
  12. // QueryBrandModelReq 查询品牌和型号请求
  13. type QueryBrandModelReq struct {
  14. UserId int64 `form:"userid" binding:"required"` // 用户ID
  15. Wrstandardid int64 `form:"wrstandardid"` // 现货商品ID
  16. }
  17. // QueryGoodsBrand
  18. // @Summary 查询商品品牌
  19. // @Produce json
  20. // @Security ApiKeyAuth
  21. // @Param userid query int true "用户ID"
  22. // @Param wrstandardid query int false "现货商品ID"
  23. // @Success 200 {array} models.ErmcpGoodsBrand
  24. // @Failure 500 {object} app.Response
  25. // @Router /Ermcp/QueryGoodsBrand [get]
  26. // @Tags 企业风险管理(app)
  27. func QueryGoodsBrand(c *gin.Context) {
  28. a := app.GinUtils{Gin: app.Gin{C: c}}
  29. req := QueryBrandModelReq{}
  30. a.DoBindReq(&req)
  31. m := models.ErmcpGoodsBrand{AREAUSERID: req.UserId, WRSTANDARDID: req.Wrstandardid}
  32. a.DoGetDataEx(&m)
  33. }
  34. // QueryGoodsModel
  35. // @Summary 查询商品型号
  36. // @Produce json
  37. // @Security ApiKeyAuth
  38. // @Param userid query int true "用户ID"
  39. // @Success 200 {array} models.ErmcpGoodsModel
  40. // @Failure 500 {object} app.Response
  41. // @Router /Ermcp/QueryGoodsModel [get]
  42. // @Tags 企业风险管理(app)
  43. func QueryGoodsModel(c *gin.Context) {
  44. a := app.GinUtils{Gin: app.Gin{C: c}}
  45. req := QueryBrandModelReq{}
  46. a.DoBindReq(&req)
  47. m := models.ErmcpGoodsModel{AREAUSERID: req.UserId, WRSTANDARDID: req.Wrstandardid}
  48. a.DoGetDataEx(&m)
  49. }