@ -136,9 +136,9 @@ func genRouteImports(parentPkg string, api *spec.ApiSpec) string {
importSet . AddStr ( fmt . Sprintf ( "\"%s\"" , util . JoinPackages ( parentPkg , contextDir ) ) )
importSet . AddStr ( fmt . Sprintf ( "\"%s\"" , util . JoinPackages ( parentPkg , contextDir ) ) )
for _ , group := range api . Service . Groups {
for _ , group := range api . Service . Groups {
for _ , route := range group . Routes {
for _ , route := range group . Routes {
folder , ok := apiutil . GetAnnotationValue ( route . Annotations , "server" , folder Property)
folder , ok := apiutil . GetAnnotationValue ( route . Annotations , "server" , group Property)
if ! ok {
if ! ok {
folder , ok = apiutil . GetAnnotationValue ( group . Annotations , "server" , folder Property)
folder , ok = apiutil . GetAnnotationValue ( group . Annotations , "server" , group Property)
if ! ok {
if ! ok {
continue
continue
}
}
@ -165,11 +165,11 @@ func getRoutes(api *spec.ApiSpec) ([]group, error) {
return nil , fmt . Errorf ( "missing handler annotation for route %q" , r . Path )
return nil , fmt . Errorf ( "missing handler annotation for route %q" , r . Path )
}
}
handler = getHandlerBaseName ( handler ) + "Handler(serverCtx)"
handler = getHandlerBaseName ( handler ) + "Handler(serverCtx)"
folder , ok := apiutil . GetAnnotationValue ( r . Annotations , "server" , folder Property)
folder , ok := apiutil . GetAnnotationValue ( r . Annotations , "server" , group Property)
if ok {
if ok {
handler = folder + "." + strings . ToUpper ( handler [ : 1 ] ) + handler [ 1 : ]
handler = folder + "." + strings . ToUpper ( handler [ : 1 ] ) + handler [ 1 : ]
} else {
} else {
folder , ok = apiutil . GetAnnotationValue ( g . Annotations , "server" , folder Property)
folder , ok = apiutil . GetAnnotationValue ( g . Annotations , "server" , group Property)
if ok {
if ok {
handler = folder + "." + strings . ToUpper ( handler [ : 1 ] ) + handler [ 1 : ]
handler = folder + "." + strings . ToUpper ( handler [ : 1 ] ) + handler [ 1 : ]
}
}