|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"errors"
|
|
|
"github.com/gin-gonic/gin"
|
|
|
"gorm.io/gorm"
|
|
|
+ "os"
|
|
|
"path"
|
|
|
"speechAnalysis/constvar"
|
|
|
"speechAnalysis/extend/code"
|
|
|
@@ -340,6 +341,13 @@ func (slf AudioCtl) Delete(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ go func() {
|
|
|
+ err = os.Remove(audio.FilePath)
|
|
|
+ if err != nil {
|
|
|
+ logx.Warnf("remove file err:%v, file:%v", err, audio.FilePath)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
util.ResponseFormat(c, code.DeleteSuccess, "成功")
|
|
|
}
|
|
|
|
|
|
@@ -376,6 +384,15 @@ func (slf AudioCtl) BatchDelete(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ go func() {
|
|
|
+ for _, audio := range audioList {
|
|
|
+ err = os.Remove(audio.FilePath)
|
|
|
+ if err != nil {
|
|
|
+ logx.Warnf("remove file err:%v, file:%v", err, audio.FilePath)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
util.ResponseFormat(c, code.DeleteSuccess, "成功")
|
|
|
}
|
|
|
|