Skip to content

[BE] 기업 사용자가 인재(사용자) 북마크 기능 API 구현 #13

Description

@jiva-z

개요

기업 회원이 여러 명의 인재(구직자)를 북마크할 수 있는 기능을 추가합니다.

작업 내용

1. 인재 북마크 엔티티 생성

  • TalentBookmark 엔티티 생성
    • talentBookmarkId: 북마크 ID (PK)
    • company: 기업 (FK)
    • user: 인재(구직자, FK)
    • createdAt: 북마크 생성 시간

2. 인재 북마크 관련 DTO 생성

  • TalentBookmarkRequestDto: 인재 북마크 생성 요청 DTO
  • TalentBookmarkResponseDto: 인재 북마크 응답 DTO
  • TalentBookmarkListResponseDto: 인재 북마크 목록 응답 DTO

3. 인재 북마크 서비스 및 레포지토리 구현

  • TalentBookmarkRepository 인터페이스 생성

    • 기업별 인재 북마크 목록 조회
    • 북마크 존재 여부 확인
    • 북마크 삭제
  • TalentBookmarkService 인터페이스 및 구현체 생성

    • 인재 북마크 생성
    • 인재 북마크 삭제
    • 기업별 인재 북마크 목록 조회

4. 인재 북마크 컨트롤러 구현

  • TalentBookmarkController 생성
    • POST /talent-bookmarks: 인재 북마크 생성
    • DELETE /talent-bookmarks/{talentBookmarkId}: 인재 북마크 삭제
    • GET /talent-bookmarks/my: 내가 북마크한 인재 목록 조회

API 엔드포인트

인재 북마크 생성

POST /talent-bookmarks
Request Body:
{
    "userId": 1
}
Response:
{
    "talentBookmarkId": 1,
    "userId": 1,
    "createdAt": "2024-04-21"
}

인재 북마크 삭제

DELETE /talent-bookmarks/{talentBookmarkId}
Response: 204 No Content

인재 북마크 목록 조회

GET /talent-bookmarks/my
Response:
{
    "talentBookmarks": [
        {
            "talentBookmarkId": 1,
            "userId": 1,
            "userName": "홍길동",
            "userEmail": "hong@test.com",
            "createdAt": "2024-04-21"
        }
    ]
}

예외 처리

  • 이미 북마크한 인재를 다시 북마크하려고 할 때 예외 처리
  • 존재하지 않는 인재를 북마크하려고 할 때 예외 처리
  • 다른 기업의 북마크를 삭제하려고 할 때 예외 처리

테스트

  • 인재 북마크 생성 테스트
  • 인재 북마크 삭제 테스트
  • 인재 북마크 목록 조회 테스트
  • 예외 처리 테스트

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions