springboot吧 关注:5,093贴子:16,350
  • 6回复贴,共1

spring boot 怎么装载多个控制器类

只看楼主收藏回复

我想让 SpringApplication.run(Application.class, args); 作为入口类。控制器都分散到其它类里面去,目前知道的办法是启动参数一次写上类名
SpringApplication.run(A.class, B.class, C.class, args); 太麻烦了,有渐简便的方法么?


IP属地:北京1楼2017-02-19 15:52回复
    注意包的层级关系,把入口的类放在顶级包里面就可以了


    2楼2017-04-13 11:40
    回复
      额 楼主解决了吗


      IP属地:广东3楼2017-06-22 11:01
      回复
        楼主解决了吗?解决了就分享出来!不要只有问题才想起吧友


        IP属地:河北4楼2017-11-24 10:13
        回复
          由Spring Boot实现的微服务需要有比较好的工具去测试RESTful API,很多REST Client是不支持自动化测试RESTful API,也不支持自动生成API文档.
          之前习惯用一款名字为 WisdomTool REST Client,支持自动化测试RESTful API,输出精美的测试报告,并且自动生成精美的RESTful API文档。
          轻量级的工具,功能却很精悍哦!
          https://github.com/wisdomtool/rest-client
          Most of REST Client tools do not support automated testing.
          Once used a tool called WisdomTool REST Client supports automated testing, output exquisite report, and automatically generating RESTful API document.
          Lightweight tool with very powerful features!
          https://github.com/wisdomtool/rest-client


          5楼2017-11-27 21:39
          回复
            解决了,2楼说的对。https://swagger.io/ 用这个测试api


            IP属地:北京6楼2018-06-20 12:00
            回复


              来自iPhone客户端7楼2019-03-15 00:50
              回复