refact: modify db config
This commit is contained in:
@@ -3,6 +3,7 @@ package formula
|
||||
import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gitea.com/bitwsd/document_ai/internal/model/formula"
|
||||
"gitea.com/bitwsd/document_ai/internal/service"
|
||||
@@ -46,7 +47,7 @@ func (endpoint *FormulaEndpoint) CreateTask(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
fileExt := filepath.Ext(req.FileName)
|
||||
fileExt := strings.ToLower(filepath.Ext(req.FileName))
|
||||
if !utils.InArray(fileExt, []string{".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".webp"}) {
|
||||
ctx.JSON(http.StatusOK, common.ErrorResponse(ctx, common.CodeParamError, "Invalid file type"))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user