added BatchDelete action

This commit is contained in:
zhangwenjian
2020-05-05 02:02:58 +08:00
parent f116859711
commit 8d844b00dd
9 changed files with 48 additions and 21 deletions
+3 -3
View File
@@ -106,9 +106,9 @@ func UpdatePost(c *gin.Context) {
// @Router /api/v1/post/{postId} [delete]
func DeletePost(c *gin.Context) {
var data models.Post
id, err := tools.StringToInt(c.Param("postId"))
data.UpdateBy = tools.GetUserIdStr(c)
_, err = data.Delete(id)
IDS := tools.IdsStrToIdsIntGroup("postId", c)
result, err := data.BatchDelete(IDS)
tools.HasError(err, "删除失败", 500)
app.OK(c,"","删除成功")
app.OK(c,result,"删除成功")
}