Heim  >  Fragen und Antworten  >  Hauptteil

java - spring boot可以作为app后端接口吗

spring boot可以作为app后端接口吗

巴扎黑巴扎黑2744 Tage vor713

Antworte allen(5)Ich werde antworten

  • 巴扎黑

    巴扎黑2017-04-18 10:50:01

    可以,你需要做的基本都是 SpringMVC 的配置,@ResponseBody 注解,给 @RequestMapping 指定 produce 参数为 application/json。这样方法的返回值会被序列化为 JSON。

    Antwort
    0
  • 巴扎黑

    巴扎黑2017-04-18 10:50:01

    可以,结合springmvc使用restful,也可以使用Jersey,resteasy这些。我前一段时间写过一个,可以参考看下。 https://github.com/jcalaz/xma...

    Antwort
    0
  • 黄舟

    黄舟2017-04-18 10:50:01

    补充一下,如果接口纯属返回json类型的数据,直接使用restcontrol即可

    Antwort
    0
  • PHP中文网

    PHP中文网2017-04-18 10:50:01

    可以的,APP后端返回的一般是restful风格的Json数据,http://www.roncoo.com/article... 这个是使用spring boot 搭建的最简单的RESTfull API 项目,你可以参照一下。

    Antwort
    0
  • 巴扎黑

    巴扎黑2017-04-18 10:50:01

    必须可以啊~都是restful接口就行,最多基于spring-boot开发的接口对接一个API gateway就行了。

    Antwort
    0
  • StornierenAntwort