|
39 | 39 | import org.springframework.core.annotation.AnnotationUtils; |
40 | 40 | import org.springframework.data.domain.Pageable; |
41 | 41 | import org.springframework.http.ResponseEntity; |
| 42 | +import org.springframework.stereotype.Component; |
42 | 43 | import org.springframework.web.bind.annotation.PathVariable; |
43 | 44 | import org.springframework.web.bind.annotation.RequestBody; |
44 | 45 | import org.springframework.web.bind.annotation.RequestMapping; |
45 | 46 | import org.springframework.web.bind.annotation.RequestMethod; |
46 | 47 | import org.springframework.web.bind.annotation.RequestParam; |
47 | | -import org.springframework.web.bind.annotation.RestController; |
48 | 48 | import org.springframework.web.bind.annotation.ValueConstants; |
49 | 49 |
|
50 | 50 | public class SpringApplicationParser extends RestApplicationParser { |
@@ -113,9 +113,9 @@ public JaxrsApplicationParser.Result tryParse(SourceType<?> sourceType) { |
113 | 113 | } |
114 | 114 |
|
115 | 115 | // controller |
116 | | - final RestController controller = AnnotationUtils.findAnnotation(cls, RestController.class); |
117 | | - if (controller != null) { |
118 | | - TypeScriptGenerator.getLogger().verbose("Parsing Spring RestController: " + cls.getName()); |
| 116 | + final Component component = AnnotationUtils.findAnnotation(cls, Component.class); |
| 117 | + if (component != null) { |
| 118 | + TypeScriptGenerator.getLogger().verbose("Parsing Spring component: " + cls.getName()); |
119 | 119 | final JaxrsApplicationParser.Result result = new JaxrsApplicationParser.Result(); |
120 | 120 | final RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(cls, RequestMapping.class); |
121 | 121 | final String path = requestMapping != null && requestMapping.path() != null && requestMapping.path().length != 0 ? requestMapping.path()[0] : null; |
@@ -153,7 +153,7 @@ public List<Class<?>> findRestControllers() { |
153 | 153 | throw new RuntimeException(e); |
154 | 154 | } |
155 | 155 | }) |
156 | | - .filter(instance -> AnnotationUtils.findAnnotation(instance, RestController.class) != null) |
| 156 | + .filter(instance -> AnnotationUtils.findAnnotation(instance, Component.class) != null) |
157 | 157 | .collect(Collectors.toList()); |
158 | 158 | return classes; |
159 | 159 | } |
|
0 commit comments