新增获取平台商品列表
This commit is contained in:
@@ -268,3 +268,35 @@ func (r *Product) PutProductStatus(c *gin.Context) {
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
// GetPlatformProductList 获取平台商品列表
|
||||
func (r *Product) GetPlatformProductList(c *gin.Context) {
|
||||
productRequest := requests.ProductRequest{}
|
||||
req := productRequest.GetPlatformProductList
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
productPlatformDao := dao.ProductPlatformDao{}
|
||||
productPlatform, err := productPlatformDao.GetPlatformProductListSearch(req)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
productPlatforms := dto.GetProductPlatformListDto(productPlatform)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.OkWithData(productPlatforms, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user