简体   繁体   English

Spring 使用 Swing 本地 GUI 引导 Web 应用程序

[英]Spring Boot Web application with Swing Local GUI

I have developed a Spring Boot Web applications.我开发了一个 Spring Boot Web 应用程序。 I have provided REST API's for users to interact with the server.我提供了 REST API 供用户与服务器交互。

Now i want to write application for admin to interact with server, in the sense change the data in database.现在我想为管理员编写应用程序以与服务器交互,从某种意义上说更改数据库中的数据。 I know i can do REST api with admin role and do a authentication and authorization.我知道我可以使用管理员角色执行 REST api 并进行身份验证和授权。 But currently i have made front end application with python and this i will like to change later on to angular.但是目前我已经使用 python 进行了前端应用程序,我想稍后将其更改为 angular。

So, as of now i don't want to create extra REST api's and the logic around it.所以,到目前为止,我不想创建额外的 REST api 及其周围的逻辑。 Is it possible to create a Swing GUI with the spring boot web application?是否可以使用 spring 引导 web 应用程序创建 Swing GUI? So, admin can directly interact with the database.因此,管理员可以直接与数据库交互。

I can create a separate GUI application for admin, to interact with database, but i have already defined entity and mongorespository in web application.我可以为管理员创建一个单独的 GUI 应用程序来与数据库交互,但我已经在 web 应用程序中定义了实体和 mongorespository。 I would like to use the same and not maintain two copies of same.我想使用相同的,而不是维护相同的两个副本。

Yes, you can call REST APIs from a Swing application using JAX-RS.是的,您可以使用 JAX-RS 从 Swing 应用程序调用 REST API。

There are some resources here.这里有一些资源。 In particular, note the section on RESTful Java clients特别要注意关于 RESTful Java 客户端的部分

https://mkyong.com/tutorials/jax-rs-tutorials/ https://mkyong.com/tutorials/jax-rs-tutorials/

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

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