繁体   English   中英

如何从另一个新的 Spring 启动项目中调用 Spring 启动项目中的 Spring 启动 api

[英]How to call a Spring boot api present in one Spring boot project from another new Spring boot project

Hi I have 2 spring boot projects A and B,(A is using an SQL Db with MySQL Workbench and Project B is using an MS SQL db,In simple words both use a different type of db )Now A has 2 restcontrollers-

 @RequestMapping( value = "/save_tokens", method = RequestMethod.POST )
    public ResponseEntity<?> storingFcmTokens(@RequestBody FcmTokenBean fcmTokenBean )
    {
      ...
    }

@RequestMapping( value = "/getAllTokens", method = RequestMethod.GET )
    public ResponseEntity<?> getAllTheTokens(  )
    {
      ...
    }

Now I am working on project B(Which uses a different db) and I want to access these to rest apis from project B.Project B has some rest controllers and they show up in Swagger,My goal is that these 2 api's (as shown上面)来自项目 A 的也必须显示在 Swagger 中,我可以随时使用项目 A 中的这两个 api 以及项目 B 的 api。我是 Spring Boot 的初学者,我寻找了类似的问题,但他们与此问题不匹配。任何帮助表示赞赏。在此先感谢!

您可以为此使用RestTemplate

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM