-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
modify upload and download mody: go mod refine the code update: make check motify api modify return values rename fix
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,6 @@ dist/ | |
!app/**/*.js | ||
tmp | ||
server/data | ||
server-v2/api/*/data | ||
assets/ | ||
bin/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
Name: studio-api | ||
Host: 0.0.0.0 | ||
Port: 9000 | ||
Port: 7002 | ||
MaxBytes: 1073741824 | ||
Debug: | ||
Enable: false | ||
Auth: | ||
AccessSecret: "login_secret" | ||
AccessExpire: 1800 | ||
File: | ||
UploadDir: "./upload/" | ||
UploadDir: "./data/upload/" | ||
TasksDir: "./data/tasks" | ||
SqliteDbFilePath: "./data/tasks.db" | ||
TaskIdPath: "./data/taskId.data" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package common | ||
|
||
import ( | ||
"regexp" | ||
"strings" | ||
) | ||
|
||
var ( | ||
ReserveRequestRoutes = []string{ | ||
"/api/files", | ||
"/api/import-tasks", | ||
} | ||
ReserveResponseRoutes = []string{ | ||
"/api/import-tasks", | ||
} | ||
IgnoreHandlerBodyPatterns = []*regexp.Regexp{ | ||
regexp.MustCompile(`^/api/import-tasks/\d+/download`), | ||
} | ||
) | ||
|
||
func PathHasPrefix(path string, routes []string) bool { | ||
for _, route := range routes { | ||
if strings.HasPrefix(path, route) { | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
func PathMatchPattern(path string, patterns []*regexp.Regexp) bool { | ||
for _, pattern := range patterns { | ||
if pattern.MatchString(path) { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.