Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Park
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mingyuan Chen
Park
Merge requests
!14
add showPark function and Combined projects,Perfect logic of showComment
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
add showPark function and Combined projects,Perfect logic of showComment
wyl
into
main
Overview
0
Commits
2
Pipelines
0
Changes
23
Merged
add showPark function and Combined projects,Perfect logic of showComment
Yulong Wang
requested to merge
wyl
into
main
10 months ago
Overview
0
Commits
2
Pipelines
0
Changes
23
0
0
Merge request reports
Compare
main
version 1
d23ff817
10 months ago
main (base)
and
latest version
latest version
4798ca3d
2 commits,
10 months ago
version 1
d23ff817
1 commit,
10 months ago
23 files
+
864
−
312
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
23
src/main/java/hackathon/Controller/CommentController.java
+
8
−
9
View file @ 4798ca3d
Edit in single-file editor
Open in Web IDE
Show full file
package
hackathon.Controller
;
import
hackathon.DTO.RecommendDTO
;
import
hackathon.Entity.Comment
;
import
hackathon.Service.CommentService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
@@ -18,17 +18,15 @@ public class CommentController {
@PostMapping
(
"/comment"
)
public
String
GetCommnet
(
@RequestBody
Comment
comment
){
System
.
out
.
println
(
"comment"
+
comment
);
commentService
.
addComment
(
comment
);
return
"Comment added successfully"
;
}
@PostMapping
(
"/showRec"
)
public
ArrayList
show
(
@RequestBody
String
type
){
System
.
out
.
println
(
type
);
ArrayList
arrayList
=
commentService
.
selectByType
(
type
);
System
.
out
.
println
(
arrayList
);
return
arrayList
;
public
RecommendDTO
show
(
@RequestBody
String
type
){
RecommendDTO
recommendDTO
=
commentService
.
selectRecommend
(
type
);
return
recommendDTO
;
}
@GetMapping
(
"/viewComments"
)
public
String
viewComments
(
Model
model
){
@@ -36,6 +34,7 @@ public class CommentController {
model
.
addAttribute
(
"comments"
,
comments
);
return
"viewComments"
;
}
@GetMapping
(
"/comments"
)
public
ArrayList
<
Comment
>
getCommentsByType
(
@RequestParam
String
type
)
{
return
commentService
.
selectByType
(
type
);
Loading