add some routes

This commit is contained in:
2026-09-03 18:48:23 +08:00
parent 3004676239
commit a1569590bc
18 changed files with 520697 additions and 7 deletions

22
routes/helper.go Normal file
View File

@@ -0,0 +1,22 @@
package routes
import (
"runtime"
"strings"
)
func PathOf() string {
_, file, _, _ := runtime.Caller(1)
// 取 routes/ 之後的部分
idx := strings.Index(file, "routes/")
if idx == -1 {
return "/"
}
path := file[idx+len("routes"):]
// 去掉 .go
path = strings.TrimSuffix(path, ".go")
return path
}