适配气站工作人员与用户受保护头像
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user