+ DeleteRecipes
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user