added BatchDelete action
This commit is contained in:
1 parent
f116859711
commit
8d844b00dd
9 files changed
+48
-21
No files matched your search
+3
-3
@@ -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,"删除成功")
|
||||
}
|
||||
Reference in new issue
Block a user