适配气站工作人员与用户受保护头像

This commit is contained in:
czl231
2026-08-18 20:28:01 +08:00
parent 084eccc3ec
commit fd2a2b38e3
11 changed files with 228 additions and 49 deletions

View File

@@ -81,3 +81,22 @@ func TestGasReadonlyDetailRoutes(t *testing.T) {
}
}
}
// TestGasAvatarRoutes 验证工作人员与用户头像只能通过气站鉴权路由读取。
func TestGasAvatarRoutes(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
RegisterGas("heqi", engine)
routes := map[string]bool{}
for _, route := range engine.Routes() {
routes[route.Method+" "+route.Path] = true
}
for _, path := range []string{
"GET /heqi/gas/v1/staff_account/:identity/avatar",
"GET /heqi/gas/v1/user_account/:identity/avatar",
} {
if !routes[path] {
t.Fatalf("missing gas avatar route %s", path)
}
}
}