QueryFoodRecipes添加skuIDs参数

This commit is contained in:
gazebo
2019-11-06 17:16:35 +08:00
parent 5015620015
commit 5cc9787403
3 changed files with 19 additions and 7 deletions

View File

@@ -75,6 +75,7 @@ func (c *FoodRecipeController) UpdateFoodRecipe() {
// @Param token header string true "认证token"
// @Param keyword query string false "关键字"
// @Param authorID query string false "创建者ID"
// @Param skuIDs query string false "skuID列表"
// @Param offset query int false "菜谱列表起始序号以0开始缺省为0"
// @Param pageSize query int false "菜谱列表页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
@@ -82,7 +83,10 @@ func (c *FoodRecipeController) UpdateFoodRecipe() {
// @router /QueryFoodRecipes [get]
func (c *FoodRecipeController) QueryFoodRecipes() {
c.callQueryFoodRecipes(func(params *tFoodrecipeQueryFoodRecipesParams) (retVal interface{}, errCode string, err error) {
retVal, err = userstore.QueryFoodRecipes(params.Ctx, params.Keyword, params.AuthorID, params.Offset, params.PageSize)
var skuIDs []int
if err = jxutils.Strings2Objs(params.SkuIDs, &skuIDs); err == nil {
retVal, err = userstore.QueryFoodRecipes(params.Ctx, params.Keyword, params.AuthorID, skuIDs, params.Offset, params.PageSize)
}
return retVal, "", err
})
}