feat(api-gateway): 添加 core-edu 服务代理路由

main.go 新增 exams/homework/grades 三组路由(无尾斜杠+通配符)
config.go 新增 CoreEduServiceURL 字段默认 localhost:3004
删除死代码 internal/routing/routing.go(从未被 main 引用)

验证: GET /exams/class/:id 200, POST /exams 201, 链路全通
This commit is contained in:
SpecialX
2026-07-09 08:02:39 +08:00
parent 4533da6484
commit 4f539b50dd
3 changed files with 16 additions and 56 deletions

View File

@@ -13,6 +13,7 @@ type Config struct {
ClassesServiceURL string
IamServiceURL string
TeacherBffURL string
CoreEduServiceURL string
OTLPEndpoint string
LogLevel string
DevMode bool
@@ -27,6 +28,7 @@ func Load() *Config {
ClassesServiceURL: getEnv("CLASSES_SERVICE_URL", "http://localhost:3001"),
IamServiceURL: getEnv("IAM_SERVICE_URL", "http://localhost:3002"),
TeacherBffURL: getEnv("TEACHER_BFF_URL", "http://localhost:3003"),
CoreEduServiceURL: getEnv("CORE_EDU_SERVICE_URL", "http://localhost:3004"),
OTLPEndpoint: getEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4318"),
LogLevel: getEnv("LOG_LEVEL", "info"),
DevMode: getEnvBool("DEV_MODE", false),