Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Student-Marks-Microservice
Project
Project
Details
Activity
Releases
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
Kyle Muldoon
Student-Marks-Microservice
Commits
b080949d
Commit
b080949d
authored
Apr 02, 2021
by
Kyle Muldoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added example code to follow pattern from employeeservice project
parent
4fddf33f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
4 deletions
+59
-4
StudentMarksController.java
...vices/MarksService/controller/StudentMarksController.java
+59
-4
No files found.
src/main/java/com/StudentServices/MarksService/controller/StudentMarksController.java
View file @
b080949d
...
...
@@ -2,10 +2,10 @@ package com.StudentServices.MarksService.controller;
import
com.StudentServices.MarksService.service.StudentService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.
web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.
GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.
http.ResponseEntity
;
import
org.springframework.web.bind.annotation.
*
;
import
java.util.List
;
@CrossOrigin
(
origins
=
"*"
)
@RestController
...
...
@@ -26,6 +26,61 @@ public class StudentMarksController {
// (DELETE) delete studentmark by id
//////////////////////////////////
// EX CODE FROM EMPLOYEE SERVICE
//////////////////////////////////
// // Return all employees
// // GET: http://localhost:8080/api/v1/employees/
// @GetMapping("/employees")
// public List<Employee> getAllEmployees() {
// return employeeService.findAllEmployees();
// }
//
// // Create a new employee
// // POST: http://localhost:8080/api/v1/employees/create
// // send this in postman: {"id": "4", "firstName": "Kyle", "lastName": "Muldoon"}
// @PostMapping("/employees/create")
// public Employee createEmployee(@RequestBody Employee employee) {
// return employeeService.addEmployee(employee);
// }
//
// // Get a particular employee
// // GET: http://localhost:8080/api/v1/employees/__num__
// @GetMapping("/employees/{id}")
// public ResponseEntity<Employee> getEmployeeById(@PathVariable(value = "id") Long employeeId) throws ResourceNotFoundException {
// Employee employee = employeeService.getEmployeeById(employeeId)
// .orElseThrow(() -> new ResourceNotFoundException("Employee by Id Not Found" + employeeId));
// return ResponseEntity.ok().body(employee);
// }
//
// // Update a particular employee
// @PutMapping("/employees/update/")
// public ResponseEntity<Employee> updateEmployeeById(@RequestBody Employee employeeNew) throws ResourceNotFoundException {
// Employee employee = employeeService.getEmployeeById(employeeNew.getId())
// .orElseThrow(() -> new ResourceNotFoundException("Employee by Id Not Found" + employeeNew.getId()));
//
// employee.setLastName(employeeNew.getLastName());
// employee.setFirstName(employeeNew.getFirstName());
//
// employeeService.updateEmployee(employee);
//
// return ResponseEntity.ok().body(employee);
// }
//
//
// // Delete a particular employee
// @DeleteMapping("/employees/remove/{id}")
// public ResponseEntity<Employee> deleteEmployeeById(@PathVariable(value = "id") Long employeeId) throws ResourceNotFoundException {
//
// Employee employee = employeeService.getEmployeeById(employeeId)
// .orElseThrow(() -> new ResourceNotFoundException("Employee by Id Not Found" + employeeId));
// employeeService.deleteEmployeeById(employee.getId());
//
// return ResponseEntity.ok().body(employee);
// }
...
...
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