-
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
- 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,29 @@ | ||
package common | ||
|
||
import ( | ||
"net/http" | ||
"regexp" | ||
"strings" | ||
) | ||
|
||
func ReserveRequest(r *http.Request) bool { | ||
if strings.HasPrefix(r.URL.Path, "/api/files") { | ||
return true | ||
} | ||
if strings.HasPrefix(r.URL.Path, "/api/import-tasks") { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func ReserveResponse(r *http.Request) bool { | ||
if strings.HasPrefix(r.URL.Path, "/api/import-tasks") { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func IgnoreHandlerBody(r *http.Request) bool { | ||
pattern := regexp.MustCompile(`/api/import-tasks/\d/download.*`) | ||
return pattern.MatchString(r.URL.Path) | ||
} |
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.