diff --git a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/controller/recruiter/RecruiterCustomController.java b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/controller/recruiter/RecruiterCustomController.java index 86cf72a7..bab607d2 100644 --- a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/controller/recruiter/RecruiterCustomController.java +++ b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/controller/recruiter/RecruiterCustomController.java @@ -1,16 +1,12 @@ package com.hydraulic.applyforme.controller.recruiter; -import com.hydraulic.applyforme.model.dto.RecruiterCustomDto; import com.hydraulic.applyforme.model.response.RecruiterApplicantDetails; import com.hydraulic.applyforme.model.response.base.ApplyForMeResponse; import com.hydraulic.applyforme.service.RecruiterCustomService; -import org.springframework.format.annotation.DateTimeFormat; import org.springframework.http.MediaType; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import java.util.Date; - import static com.hydraulic.applyforme.constants.PagingConstants.*; import static com.hydraulic.applyforme.constants.PagingConstants.DEFAULT_SORT_DIRECTION; @@ -39,7 +35,10 @@ public ApplyForMeResponse findEntries( @PreAuthorize("hasAnyRole('Recruiter')") @GetMapping("/details") - public RecruiterApplicantDetails getDetail(@RequestBody RecruiterCustomDto recruiterCustomDto){ - return service.getOne(recruiterCustomDto); + public RecruiterApplicantDetails getDetail(@RequestParam(value="memberid") Long memberid, + @RequestParam(value="role") String role, + @RequestParam(value="salary") String salary, + @RequestParam(value="employement") String employement){ + return service.getOne(memberid, role, salary, employement); } } \ No newline at end of file diff --git a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/model/dto/RecruiterCustomDto.java b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/model/dto/RecruiterCustomDto.java deleted file mode 100644 index 4ad5862a..00000000 --- a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/model/dto/RecruiterCustomDto.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hydraulic.applyforme.model.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Builder; -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -@Builder -public class RecruiterCustomDto { - - @JsonProperty("member_id") - private Long memberId; - - @JsonProperty("role") - private String role; - - @JsonProperty("salary") - private String salary; - - @JsonProperty("employement") - private String employement; -} diff --git a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/RecruiterCustomService.java b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/RecruiterCustomService.java index 5ff31117..0bed8200 100644 --- a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/RecruiterCustomService.java +++ b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/RecruiterCustomService.java @@ -1,12 +1,9 @@ package com.hydraulic.applyforme.service; -import com.hydraulic.applyforme.model.dto.RecruiterCustomDto; import com.hydraulic.applyforme.model.response.RecruiterApplicantDetails; import com.hydraulic.applyforme.model.response.base.ApplyForMeResponse; -import java.util.Date; - public interface RecruiterCustomService { - RecruiterApplicantDetails getOne(RecruiterCustomDto recruiterCustomDto); + RecruiterApplicantDetails getOne(Long memberid, String role, String salary, String employement); ApplyForMeResponse getEntries(int pageNo, int pageSize, String sortBy, String sortDir); } diff --git a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/impl/RecruiterCustomServiceImpl.java b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/impl/RecruiterCustomServiceImpl.java index 78baf81f..0a8c9728 100644 --- a/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/impl/RecruiterCustomServiceImpl.java +++ b/Apply-For-Me-Api/src/main/java/com/hydraulic/applyforme/service/impl/RecruiterCustomServiceImpl.java @@ -3,7 +3,6 @@ import com.hydraulic.applyforme.model.domain.Member; import com.hydraulic.applyforme.model.domain.Professional; import com.hydraulic.applyforme.model.domain.Submission; -import com.hydraulic.applyforme.model.dto.RecruiterCustomDto; import com.hydraulic.applyforme.model.dto.submission.SubmissionDto; import com.hydraulic.applyforme.model.exception.MemberNotFoundException; import com.hydraulic.applyforme.model.response.RecruiterApplicantDetails; @@ -98,26 +97,26 @@ private List getMemberResponse(Collection submis } @Override - public RecruiterApplicantDetails getOne(RecruiterCustomDto recruiterCustomDto) { - Member member = memberRepository.getOne(recruiterCustomDto.getMemberId()); + public RecruiterApplicantDetails getOne(Long memberid, String role, String salary, String employement) { + Member member = memberRepository.getOne(memberid); if (member == null) { - throw new MemberNotFoundException(recruiterCustomDto.getMemberId()); + throw new MemberNotFoundException(memberid); } - Professional professional = professionalJpaRepository.getProfessional(recruiterCustomDto.getMemberId()); + Professional professional = professionalJpaRepository.getProfessional(memberid); RecruiterApplicantDetails response = RecruiterApplicantDetails.builder() .name(member.getFirstName()+" "+member.getLastName()) - .role(recruiterCustomDto.getRole()) + .role(role) .joinedOn(member.getCreatedOn()) .email(member.getEmailAddress()) .phoneNumber(member.getPhoneNumber()) .membershipPlan("Basic") .experience(3L) .industry("Tech") - .salaryExpectation(recruiterCustomDto.getSalary()) - .employementType(recruiterCustomDto.getEmployement()) + .salaryExpectation(salary) + .employementType(employement) .cv("Cv of " + member.getFirstName()+".pdf") .coverLetter("Cover letter of "+member.getFirstName()+".pdf") .build();