+ DeleteRecipes

This commit is contained in:
gazebo
2019-09-17 18:22:06 +08:00
parent 9a7ab6425f
commit 025b2b0cfd
3 changed files with 50 additions and 0 deletions

View File

@@ -130,3 +130,20 @@ func (c *FoodRecipeController) VoteFoodRecipe() {
return retVal, "", err
})
}
// @Title 删除菜谱
// @Description 删除菜谱
// @Param token header string true "认证token"
// @Param recipeIDs query string true "菜谱ID列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /DeleteRecipes [delete]
func (c *FoodRecipeController) DeleteRecipes() {
c.callDeleteRecipes(func(params *tFoodrecipeDeleteRecipesParams) (retVal interface{}, errCode string, err error) {
var recipeIDs []int
if err = jxutils.Strings2Objs(params.RecipeIDs, &recipeIDs); err == nil {
retVal, err = userstore.DeleteRecipes(params.Ctx, recipeIDs)
}
return retVal, "", err
})
}