增加删除完善优化文档

Squashed commit of the following:

commit c0e6400bcd
Author: Sun <95302870@qq.com>
Date:   Fri Nov 10 13:02:35 2023 +0800

    更新说明文档

commit 0a81db157b
Author: Sun <95302870@qq.com>
Date:   Fri Nov 10 13:02:27 2023 +0800

    完善删除图标功能
This commit is contained in:
Sun
2023-11-10 13:08:59 +08:00
parent 211c3071dc
commit 7c939175db
7 changed files with 90 additions and 26 deletions
+17
View File
@@ -98,3 +98,20 @@ func (a *ItemIcon) GetListByGroupId(c *gin.Context) {
apiReturn.SuccessListData(c, itemIcons, 0)
}
func (a *ItemIcon) Deletes(c *gin.Context) {
req := commonApiStructs.RequestDeleteIds[uint]{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
apiReturn.ErrorParamFomat(c, err.Error())
return
}
userInfo, _ := base.GetCurrentUserInfo(c)
if err := global.Db.Debug().Delete(&models.ItemIcon{}, "id in ? AND user_id=?", req.Ids, userInfo.ID).Error; err != nil {
apiReturn.ErrorDatabase(c, err.Error())
return
}
apiReturn.Success(c)
}