Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
spring-basic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Su Sandi Ko
spring-basic
Commits
a45d4667
Commit
a45d4667
authored
4 weeks ago
by
Su Sandi Ko
Browse files
Options
Downloads
Patches
Plain Diff
mid commit
parent
ab3f2e66
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/example/demo/controller/TestController.java
+11
-7
11 additions, 7 deletions
...main/java/com/example/demo/controller/TestController.java
with
11 additions
and
7 deletions
src/main/java/com/example/demo/controller/TestController.java
+
11
−
7
View file @
a45d4667
...
...
@@ -6,14 +6,18 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.google.gson.JsonObject
;
@RestController
public
class
TestController
{
@GetMapping
(
value
=
"/test"
)
public
UserDto
test
()
{
UserDto
dto
=
new
UserDto
();
dto
.
setAge
(
17
);
dto
.
setName
(
"Jane"
);
return
dto
;
@RequestMapping
(
value
=
"/"
,
method
=
RequestMethod
.
GET
)
public
String
test
(
@RequestParam
(
"id"
)
String
id
)
{
JsonObject
obj
=
new
JsonObject
();
obj
.
addProperty
(
"title"
,
"산사와 아가싸"
);
obj
.
addProperty
(
"content"
,
"로맨틱 코메디"
);
JsonObject
data
=
new
JsonObject
();
data
.
addProperty
(
"time"
,
"토일 8 시"
);
obj
.
add
(
"data"
,
data
);
return
obj
.
toString
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment