Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
package router
import (
"testing"
"github.com/gin-gonic/gin"
)
func TestAiMateH5CompatibilityRoutes(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
aiMateRouter(engine.Group("/api/app"))
routes := make(map[string]struct{})
for _, route := range engine.Routes() {
routes[route.Method+" "+route.Path] = struct{}{}
}
expected := []string{
"GET /api/app/aimate/login",
"GET /api/app/aimate/getBalance",
"GET /api/app/aimate/gianBalance",
"GET /api/app/aimate/currencys",
"POST /api/app/aimate/exchange",
}
for _, route := range expected {
if _, ok := routes[route]; !ok {
t.Errorf("route %q is not registered", route)
}
}
}
func TestAiMateV2Route(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
aiMateV2Router(engine.Group("/api/app"))
for _, route := range engine.Routes() {
if route.Method == "POST" && route.Path == "/api/app/aimatev2/url" {
return
}
}
t.Fatal("POST /api/app/aimatev2/url is not registered")
}
func TestContentUpdateMarkerRoute(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
contentMarkerRouter(engine.Group("/api/app"))
for _, route := range engine.Routes() {
if route.Method == "GET" && route.Path == "/api/app/content/update-markers" {
return
}
}
t.Fatal("GET /api/app/content/update-markers is not registered")
}