Changeset 297bd16 for src/main/java/it/finki/tinki/web
- Timestamp:
- 01/09/21 01:07:09 (4 years ago)
- Branches:
- master
- Children:
- f067338
- Parents:
- bd46dbb
- Location:
- src/main/java/it/finki/tinki/web/controller
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/web/controller/AccountRegisterController.java
rbd46dbb r297bd16 19 19 @CrossOrigin(origins = "http://localhost:3000") 20 20 @RequestMapping("/api/register") 21 public class RegisterController {21 public class AccountRegisterController { 22 22 23 23 AccountService accountService; … … 26 26 MatchmakerService matchmakerService; 27 27 28 public RegisterController(AccountService accountService, SkillService skillService, WorkService workService, MatchmakerService matchmakerService) {28 public AccountRegisterController(AccountService accountService, SkillService skillService, WorkService workService, MatchmakerService matchmakerService) { 29 29 this.accountService = accountService; 30 30 this.skillService = skillService; -
src/main/java/it/finki/tinki/web/controller/WorkRegisterController.java
rbd46dbb r297bd16 1 1 package it.finki.tinki.web.controller; 2 2 3 import it.finki.tinki.model.Work.Internship; 4 import it.finki.tinki.model.Work.Job; 5 import it.finki.tinki.model.Work.Project; 6 import it.finki.tinki.model.dto.register.work.InternshipRegisterDTO; 7 import it.finki.tinki.model.dto.register.work.JobRegisterDTO; 8 import it.finki.tinki.model.dto.register.work.ProjectRegisterDTO; 9 import it.finki.tinki.model.dto.response.work.InternshipResponseDTO; 3 10 import it.finki.tinki.model.dto.response.work.JobResponseDTO; 11 import it.finki.tinki.model.dto.response.work.ProjectResponseDTO; 12 import it.finki.tinki.service.WorkService; 4 13 import org.springframework.web.bind.annotation.PostMapping; 5 14 import org.springframework.web.bind.annotation.RequestBody; … … 11 20 public class WorkRegisterController { 12 21 13 // @PostMapping("/job") 14 // public JobResponseDTO registerJob(@RequestBody JobRegisterDTO body){ 15 // 16 // } 22 WorkService workService; 23 24 public WorkRegisterController(WorkService workService) { 25 this.workService = workService; 26 } 27 28 @PostMapping("/job") 29 public JobResponseDTO registerJob(@RequestBody JobRegisterDTO body){ 30 31 Job j = this.workService.insertJob(body.getTitle(), 32 body.getDescription(), body.getAccountId(), body.getSalary(), body.getSkillsRequired(), body.getType()); 33 34 return new JobResponseDTO(j); 35 } 36 37 @PostMapping("/internship") 38 public InternshipResponseDTO registerInternship(@RequestBody InternshipRegisterDTO body){ 39 40 Internship j = this.workService.insertInternship(body.getTitle(), 41 body.getDescription(), body.getAccountId(), body.getSalary(), body.getSkillsTrained(), body.getOpenSpots(), body.getType()); 42 43 return new InternshipResponseDTO(j); 44 } 45 46 @PostMapping("/project") 47 public ProjectResponseDTO registerProject(@RequestBody ProjectRegisterDTO body){ 48 49 Project j = this.workService.insertProject(body.getTitle(), 50 body.getDescription(), body.getAccountId(), body.getSalary(), body.getSkillsRequired(), body.getValidUntil(), body.getType()); 51 52 return new ProjectResponseDTO(j); 53 } 17 54 }
Note:
See TracChangeset
for help on using the changeset viewer.