/**
* @Author: zou.yingbin
* @Create  : 2021/3/15 10:41
* @Modify  : 2021/3/15 10:41
 */

package ermcp

import (
	"github.com/gin-gonic/gin"
	"mtp2_if/global/app"
	"mtp2_if/models"
)

// QueryBrandModelReq 查询品牌和型号请求
type QueryBrandModelReq struct {
	UserId       int64 `form:"userid" binding:"required"` // 用户ID
	Wrstandardid int64 `form:"wrstandardid"`              // 现货商品ID
}

// QueryGoodsBrand
// @Summary 查询商品品牌
// @Produce json
// @Security ApiKeyAuth
// @Param userid query int true "用户ID"
// @Param wrstandardid query int false "现货商品ID"
// @Success 200 {array} models.ErmcpGoodsBrand
// @Failure 500 {object} app.Response
// @Router /Ermcp/QueryGoodsBrand [get]
// @Tags 企业风险管理(app)
func QueryGoodsBrand(c *gin.Context) {
	a := app.GinUtils{Gin: app.Gin{C: c}}
	req := QueryBrandModelReq{}
	a.DoBindReq(&req)
	m := models.ErmcpGoodsBrand{AREAUSERID: req.UserId, WRSTANDARDID: req.Wrstandardid}
	a.DoGetDataEx(&m)
}

// QueryGoodsModel
// @Summary 查询商品型号
// @Produce json
// @Security ApiKeyAuth
// @Param userid query int true "用户ID"
// @Success 200 {array} models.ErmcpGoodsModel
// @Failure 500 {object} app.Response
// @Router /Ermcp/QueryGoodsModel [get]
// @Tags 企业风险管理(app)
func QueryGoodsModel(c *gin.Context) {
	a := app.GinUtils{Gin: app.Gin{C: c}}
	req := QueryBrandModelReq{}
	a.DoBindReq(&req)
	m := models.ErmcpGoodsModel{AREAUSERID: req.UserId, WRSTANDARDID: req.Wrstandardid}
	a.DoGetDataEx(&m)
}
