Closed sestegra closed 8 years ago
By adding a scan of a group hierarchy, we could override group behavior.
abstract class ServicesGroup { String name; ServicesGroup(this.name); @Route("/json", methods: const [POST]) Map echoJson(@Body(JSON) Map json) { json["_name"] = name; return json; } @Route("/form", methods: const [POST]) Map echoFormAsJson(@Body(FORM) Map form) { form["_name"] = name; return form; } } @Group("/one") class OneServicesGroup extends ServicesGroup { OneServicesGroup(): super("one"); } @Group("/two") class TwoServicesGroup extends ServicesGroup { TwoServicesGroup(): super("two"); }
Configured target for /two/json [POST]: http_test.ServicesGroup.echoJson (group: http_test.TwoServicesGroup) Configured target for /two/form [POST]: http_test.ServicesGroup.echoFormAsJson (group: http_test.TwoServicesGroup) Configured target for /one/json [POST]: http_test.ServicesGroup.echoJson (group: http_test.OneServicesGroup) Configured target for /one/form [POST]: http_test.ServicesGroup.echoFormAsJson (group: http_test.OneServicesGroup)
Ping me when this gets updated, and I'll merge it
Requested update done
All good, thanks!
By adding a scan of a group hierarchy, we could override group behavior.