fix: 统一文件上传、删除接口

This commit is contained in:
ssongliu
2022-12-01 10:36:49 +08:00
committed by ssongliu
parent c11c3be0de
commit e66ce1a9f2
17 changed files with 304 additions and 195 deletions

View File

@@ -128,24 +128,6 @@ func (b *BaseApi) RedisBackupList(c *gin.Context) {
})
}
func (b *BaseApi) RedisBackupDelete(c *gin.Context) {
var req dto.RedisBackupDelete
if err := c.ShouldBindJSON(&req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
for _, name := range req.Names {
fullPath := fmt.Sprintf("%s/%s", req.FileDir, name)
if err := os.Remove(fullPath); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
}
helper.SuccessWithData(c, nil)
}
func (b *BaseApi) UpdateRedisConfByFile(c *gin.Context) {
var req dto.RedisConfUpdateByFile
if err := c.ShouldBindJSON(&req); err != nil {