feat: 完成数据库备份列表

This commit is contained in:
ssongliu
2022-10-28 11:02:47 +08:00
committed by ssongliu
parent 8cf9c27f5f
commit 9f1e417c06
8 changed files with 120 additions and 4 deletions

View File

@@ -61,6 +61,25 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
func (b *BaseApi) DownloadRecord(c *gin.Context) {
var req dto.DownloadRecord
if err := c.ShouldBindJSON(&req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
if err := global.VALID.Struct(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
filePath, err := backupService.DownloadRecord(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
c.File(filePath)
}
func (b *BaseApi) DeleteBackupRecord(c *gin.Context) {
var req dto.BatchDeleteReq
if err := c.ShouldBindJSON(&req); err != nil {