Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team6-Digital Insight for Health
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chen Liang
Team6-Digital Insight for Health
Merge requests
!51
admin controller and html
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
admin controller and html
19-as-a-commonadmin-i-hope-i-can-hava-page-to-show-the-hospital-and-nursing-staff-information-when
into
main
Overview
1
Commits
1
Pipelines
0
Changes
2
Merged
Mingyuan Chen
requested to merge
19-as-a-commonadmin-i-hope-i-can-hava-page-to-show-the-hospital-and-nursing-staff-information-when
into
main
1 month ago
Overview
1
Commits
1
Pipelines
0
Changes
2
Expand
Closes
#19 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
8e600292
1 commit,
1 month ago
2 files
+
222
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/main/java/com/cardiff/client_project/controller/admin/CommonAdminHospitalController.java
0 → 100644
+
40
−
0
Options
package
com.cardiff.client_project.controller.admin
;
import
com.cardiff.client_project.pojo.dto.HospitalDTO
;
import
com.cardiff.client_project.service.CommonAdminHospitalService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/commonAdmin/hospital"
)
public
class
CommonAdminHospitalController
{
@Autowired
private
CommonAdminHospitalService
commonAdminHospitalService
;
@GetMapping
(
"/all"
)
public
List
<
HospitalDTO
>
getAllHospitals
()
{
return
commonAdminHospitalService
.
getAllHospitals
();
}
@PostMapping
(
"/add"
)
public
ResponseEntity
<
String
>
addHospital
(
@RequestBody
HospitalDTO
hospital
)
{
commonAdminHospitalService
.
addHospital
(
hospital
);
return
ResponseEntity
.
ok
(
"Hospital added successfully!"
);
}
@PutMapping
(
"/update"
)
public
ResponseEntity
<
String
>
updateHospital
(
@RequestBody
HospitalDTO
hospital
)
{
commonAdminHospitalService
.
updateHospital
(
hospital
);
return
ResponseEntity
.
ok
(
"Hospital updated successfully!"
);
}
@DeleteMapping
(
"/delete/{id}"
)
public
ResponseEntity
<
String
>
deleteHospital
(
@PathVariable
int
id
)
{
commonAdminHospitalService
.
deleteHospital
(
id
);
return
ResponseEntity
.
ok
(
"Hospital deleted successfully!"
);
}
}
Loading