Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
SpringCloudServer
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
xiachenqi
SpringCloudServer
Commits
6e4d272b
Commit
6e4d272b
authored
Jul 04, 2019
by
XCQi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首次提交
parent
b968b0f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
10 deletions
+74
-10
SpringCloudServerApplication.java
...ngxin/springcloudserver/SpringCloudServerApplication.java
+0
-10
RestApi.java
...ava/com/yingxin/springcloudserver/controller/RestApi.java
+33
-0
User.java
src/main/java/com/yingxin/springcloudserver/entity/User.java
+41
-0
No files found.
src/main/java/com/yingxin/springcloudserver/SpringCloudServerApplication.java
View file @
6e4d272b
...
...
@@ -2,20 +2,10 @@ package com.yingxin.springcloudserver;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@SpringBootApplication
@RestController
public
class
SpringCloudServerApplication
{
@RequestMapping
(
"/"
)
public
String
home
()
{
return
"hello world."
;
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SpringCloudServerApplication
.
class
,
args
);
}
}
src/main/java/com/yingxin/springcloudserver/controller/RestApi.java
0 → 100644
View file @
6e4d272b
package
com
.
yingxin
.
springcloudserver
.
controller
;
import
com.yingxin.springcloudserver.entity.User
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
public
class
RestApi
{
@RequestMapping
(
"/"
)
public
String
home
()
{
return
"hello world."
;
}
@GetMapping
(
"/exampleforget"
)
public
User
getUser
()
{
return
new
User
(
"no1"
,
"张三"
,
25
);
}
@GetMapping
(
"/queryUserList"
)
public
List
<
User
>
getUsers
()
{
List
<
User
>
users
=
new
ArrayList
<>();
User
tom
=
new
User
(
"no1"
,
"tom"
,
25
);
User
amy
=
new
User
(
"no2"
,
"amy"
,
22
);
users
.
add
(
tom
);
users
.
add
(
amy
);
return
users
;
}
}
src/main/java/com/yingxin/springcloudserver/entity/User.java
0 → 100644
View file @
6e4d272b
package
com
.
yingxin
.
springcloudserver
.
entity
;
public
class
User
{
private
String
id
;
private
String
name
;
//姓名
private
Integer
age
;
//年龄
public
User
()
{
}
public
User
(
String
id
,
String
name
,
Integer
age
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
age
=
age
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getAge
()
{
return
age
;
}
public
void
setAge
(
Integer
age
)
{
this
.
age
=
age
;
}
}
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