Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YX_IDENT_REFACTORING
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangyusheng
YX_IDENT_REFACTORING
Commits
beb817e4
Commit
beb817e4
authored
Sep 27, 2018
by
liboyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整合jersey
parent
464a5ac6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
YxRefactoringApplication.java
...n/java/com/yx_project/start/YxRefactoringApplication.java
+13
-0
SystemUserApi.java
src/main/java/com/yx_project/start/api/SystemUserApi.java
+8
-5
JerseyConfig.java
src/main/java/com/yx_project/start/config/JerseyConfig.java
+10
-0
No files found.
src/main/java/com/yx_project/start/YxRefactoringApplication.java
View file @
beb817e4
package
com
.
yx_project
.
start
;
import
com.yx_project.start.config.JerseyConfig
;
import
org.glassfish.jersey.servlet.ServletContainer
;
import
org.glassfish.jersey.servlet.ServletProperties
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
@SpringBootApplication
public
class
YxRefactoringApplication
{
@Bean
public
ServletRegistrationBean
jerseyServlet
()
{
ServletRegistrationBean
registration
=
new
ServletRegistrationBean
(
new
ServletContainer
(),
"/rest/*"
);
registration
.
addInitParameter
(
ServletProperties
.
JAXRS_APPLICATION_CLASS
,
JerseyConfig
.
class
.
getName
());
return
registration
;
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
YxRefactoringApplication
.
class
,
args
);
}
...
...
src/main/java/com/yx_project/start/api/SystemUserApi.java
View file @
beb817e4
...
...
@@ -3,19 +3,22 @@ package com.yx_project.start.api;
import
com.yx_project.start.entity.SystemUserEntity
;
import
com.yx_project.start.service.impl.SystemUserServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.MediaType
;
import
java.util.List
;
import
java.util.Map
;
@
RestController
@
Path
(
"user"
)
public
class
SystemUserApi
{
@Autowired
private
SystemUserServiceImpl
userService
;
@RequestMapping
(
"list"
)
@GET
@Path
(
"list"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
List
<
SystemUserEntity
>
list
(){
List
<
SystemUserEntity
>
list
=
userService
.
findAllUser
();
return
list
;
...
...
src/main/java/com/yx_project/start/config/JerseyConfig.java
0 → 100644
View file @
beb817e4
package
com
.
yx_project
.
start
.
config
;
import
com.yx_project.start.api.SystemUserApi
;
import
org.glassfish.jersey.server.ResourceConfig
;
public
class
JerseyConfig
extends
ResourceConfig
{
public
JerseyConfig
()
{
register
(
SystemUserApi
.
class
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment