-
특징
- api 응답은
Result<?>
객체를 사용해 응답 형식 규격화- message 필드 : 응답 결과 등을 전달해 줄 수 있다.
- count 필드 : 목록, 검색 api 요청 시 갯수를 반환해 준다.
- resultData 필드 : 응답 결과를 반환해준다. "result" 프로퍼티로 반환된다.
- api 응답은
- 채용공고 등록
- 요구사항 분석
- 구현과정
JobAdvertisementSaveRequestDto
로 요청받아 처리.toEntity()
메소드를 통해 엔티티 저장
- api 테스트
- 요청
### 등록 POST http://localhost:8080/api/v1/job-advertisements/4 Content-Type: application/json { "position":"백엔드 주니어 개발자", "reward":500000, "content":"원티드랩에서 백엔드 주니어 개발자를 채용합니다. 자격요건은..", "skill":"Java", "nation": "한국", "region": "서울" }
- 응답
{ "message": "채용공고가 등록되었습니다.", "count": null, // 채용 목록 갯수 프로퍼티 "result": null // 결과 반환 프로퍼티 }
- 채용공고 수정
- 요구사항 분석
- 회사는 채용공고를 수정할 수 있다.
- 구현과정
JobAdvertisementUpdateRequestDto
로 요청받아 처리한다.- 채용공고 엔티티 내부에
update
메소드로 값을 전달해 엔티티 값을 변경한다. (더티체킹)
- api 테스트
- 요청
### 수정 PUT http://localhost:8080/api/v1/job-advertisements/3/75 Content-Type: application/json { "position":"백엔드 주니어 개발자", "reward":1000000, "content":"채용내용", "skill":"Python", "nation": "미국", "region": "뉴욕" }
- 응답
{ "message": "채용공고가 수정되었습니다.", "count": null, "result": null }
- 요구사항 분석
- 채용공고 삭제
- 요구사항 분석
- 구현과정
JobAdvertisementDeleteDto
로 요청받아 처리한다.- 요청 값은 채용공고 id 를 받는다. (파라미터 추가되면
JobAdvertisementDeleteDto
에 추가한다.)
- api 테스트
- 요청
### 삭제 DELETE http://localhost:8080/api/v1/job-advertisements Content-Type: application/json { "job_advertisement_id": 45 }
- 응답
{ "message": "채용공고가 삭제되었습니다.", "count": null, "result": null }
- 채용공고 목록
- 요구사항 분석
- 사용자는 전체 채용 공고 목록을 볼 수 있다.
- 구현과정
- api 테스트
- 요청
### 목록보기 GET http://localhost:8080/api/v1/job-advertisements
- 응답
{ "message": "채용공고 목록을 불러왔습니다.", "count": 7, // 채용공고 총 갯수 "result": { "data": [ // data 프로퍼티 안에 반환 { "job_advertisement_id": 81, "company_name": "카카오", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Spring" }, { "job_advertisement_id": 80, "company_name": "카카오", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Java" }, { "job_advertisement_id": 79, "company_name": "네이버", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Java" }, .... ] } }
- 요구사항 분석
- 채용공고 검색
- 요구사항 분석
- 검색 키워드를 받아와 처리한다.
- 구현과정
- api 테스트
- 요청
### 검색 GET http://localhost:8080/api/v1/job-advertisements/search?keyword=ja
- 응답
{ "message": "검색 결과 입니다.", "count": 3, "result": { "data": [ { "job_advertisement_id": 80, "company_name": "카카오", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Java" }, { "job_advertisement_id": 78, "company_name": "네이버", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Java" }, { "job_advertisement_id": 79, "company_name": "네이버", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Java" } ] } }
- 요구사항 분석
- 채용공고 상세
- 요구사항 분석
- 채용내용 필드 추가 응답.
- 해당 회사가 올린 다른 공고 추가 응답.
- 구현과정
- api 테스트
- 요청
### 상세보기 GET http://localhost:8080/api/v1/job-advertisements/detail/81
- 응답
{ "message": "채용 상세 입니다.", "count": null, "result": { "data": { "job_advertisement_id": 81, "company_name": "카카오", "nation": "한국", "region": "서울", "position": "주니어 백엔드 개발자", "reward": 500000, "skill": "Spring", "content": "원티드랩에서 백엔드 주니어 개발자를 채용합니다. 자격요건은..", // 채용 내용 추가 표시 "otherJobAdvertisementIdList": [ // 다른 공고 id 리스트 75, 80 ] } } }
- 요구사항 분석