refact: modify db config
This commit is contained in:
@@ -3,6 +3,7 @@ package formula
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"gitea.com/bitwsd/document_ai/internal/model/formula"
|
"gitea.com/bitwsd/document_ai/internal/model/formula"
|
||||||
"gitea.com/bitwsd/document_ai/internal/service"
|
"gitea.com/bitwsd/document_ai/internal/service"
|
||||||
@@ -46,7 +47,7 @@ func (endpoint *FormulaEndpoint) CreateTask(ctx *gin.Context) {
|
|||||||
return
|
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"}) {
|
if !utils.InArray(fileExt, []string{".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".webp"}) {
|
||||||
ctx.JSON(http.StatusOK, common.ErrorResponse(ctx, common.CodeParamError, "Invalid file type"))
|
ctx.JSON(http.StatusOK, common.ErrorResponse(ctx, common.CodeParamError, "Invalid file type"))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -4,16 +4,16 @@ server:
|
|||||||
|
|
||||||
database:
|
database:
|
||||||
driver: mysql
|
driver: mysql
|
||||||
host: rm-bp1uh3e1qop18gz4wto.mysql.rds.aliyuncs.com
|
host: 172.31.134.12
|
||||||
port: 3306
|
port: 3006
|
||||||
username: root
|
username: root
|
||||||
password: bitwsdttestESAadb12@3341
|
password: yoge@coder%%%123321!
|
||||||
dbname: doc_ai
|
dbname: doc_ai
|
||||||
max_idle: 10
|
max_idle: 10
|
||||||
max_open: 100
|
max_open: 30
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
addr: 172.31.32.138:6379
|
addr: 172.31.134.12:6399
|
||||||
password: bitwsd@8912WE!
|
password: bitwsd@8912WE!
|
||||||
db: 0
|
db: 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user