Skip to main content

개요

User 도메인은 사용자 계정 관리, 프로필 수정, 직원 관리, 연락처 관리 등의 기능을 제공합니다.

Types

UserType (Enum)

사용자 권한 레벨을 정의합니다.
  • CUSTOMER: 일반 고객
  • PARTNER: 파트너
  • PARTNERADMIN: 파트너 관리자
  • ADMIN: 관리자
  • SUPERADMIN: 최고 관리자

DuplicateCheckerType (Enum)

중복 확인 필드 타입을 정의합니다.
  • identity: 아이디
  • email: 이메일
  • phone: 휴대폰 번호
  • nickname: 닉네임

Queries

getUsers

사용자 목록을 페이지네이션으로 조회합니다.

GraphQL Signature

query GetUsers($first: Int, $last: Int, $filter: UsersFilter) {
  getUsers(first: $first, last: $last, filter: $filter) {
    edges {
      cursor
      node {
        id
        identity
        phone
        name
        nickname
        email
        accessLevel
        isAuthorizedEmail
        isAuthorizedPhone
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    totalCount
  }
}

파라미터

first
Int
처음부터 가져올 개수
last
Int
끝에서부터 가져올 개수
filter.keyword
String
검색 키워드 (이름, 이메일, 아이디 등)

응답

edges
[UserEdge!]!
사용자 목록
pageInfo
PageInfo!
페이지 정보
totalCount
Int!
전체 사용자 수

findUser

특정 사용자의 상세 정보를 조회합니다.

GraphQL Signature

query FindUser($id: ID!) {
  findUser(id: $id) {
    id
    identity
    phone
    name
    nickname
    email
    accessLevel
    isAuthorizedEmail
    isAuthorizedPhone
  }
}

파라미터

id
ID!
required
사용자 ID

예제

query {
  findUser(id: "01HQKS9V8X2N3P4Q5R6S7T8U9V") {
    id
    name
    email
    accessLevel
  }
}

myInfo

현재 로그인한 사용자의 정보를 조회합니다.

GraphQL Signature

query MyInfo {
  myInfo {
    id
    identity
    phone
    name
    nickname
    email
    accessLevel
    isAuthorizedEmail
    isAuthorizedPhone
  }
}

응답

User
User
현재 사용자 정보
이 API는 인증이 필요하며, JWT 토큰에서 사용자 정보를 추출합니다.

myContacts

현재 로그인한 사용자의 연락처 목록을 조회합니다.

GraphQL Signature

query MyContacts($type: String) {
  myContacts(type: $type) {
    id
    userId
    type
    contact
  }
}

파라미터

type
String
연락처 타입 필터 (예: “email”, “phone”, “kakao”)

getAccommodationContacts

특정 숙박 시설의 직원 연락처 목록을 조회합니다.

GraphQL Signature

query GetAccommodationContacts(
  $accommodationId: ID!
  $type: String
  $authority: String
) {
  getAccommodationContacts(
    accommodationId: $accommodationId
    type: $type
    authority: $authority
  ) {
    id
    userId
    type
    contact
  }
}

파라미터

accommodationId
ID!
required
숙박 시설 ID
type
String
연락처 타입 필터
authority
String
권한 필터

verifyDuplicate

회원가입 시 아이디, 이메일, 닉네임 중복을 확인합니다.

GraphQL Signature

query VerifyDuplicate($input: VerifyDuplicateInput!) {
  verifyDuplicate(input: $input) {
    id
    verified
    error
  }
}

파라미터

input.identity
String
확인할 아이디
input.email
String
확인할 이메일
input.nickname
String
확인할 닉네임

응답

id
ID!
확인 ID
verified
Boolean!
중복 여부 (true: 사용 가능, false: 중복됨)
error
[DuplicateCheckerType]
중복된 필드 목록

예제

query {
  verifyDuplicate(input: {
    identity: "testuser"
    email: "[email protected]"
    nickname: "테스터"
  }) {
    verified
    error
  }
}

getPermanentToken

키오스크용 영구 토큰을 발급받습니다.

GraphQL Signature

query GetPermanentToken($kioskId: ID!) {
  getPermanentToken(kioskId: $kioskId)
}

파라미터

kioskId
ID!
required
키오스크 ID

응답

token
String
영구 토큰

getPermanentTokenForAdmin

숙박 시설 관리자용 영구 토큰을 발급받습니다.

GraphQL Signature

query GetPermanentTokenForAdmin($accommodationId: ID!) {
  getPermanentTokenForAdmin(accommodationId: $accommodationId)
}

파라미터

accommodationId
ID!
required
숙박 시설 ID

getUserLogs

사용자 활동 로그를 조회합니다.

GraphQL Signature

query GetUserLogs(
  $accommodationId: ID!
  $userId: ID
  $relatedId: ID
  $first: Int
  $last: Int
  $after: String
  $before: String
) {
  getUserLogs(
    accommodationId: $accommodationId
    userId: $userId
    relatedId: $relatedId
    first: $first
    last: $last
    after: $after
    before: $before
  ) {
    edges {
      cursor
      node {
        id
        user {
          id
          name
        }
        type
        log
        data
        createdAt
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    totalCount
  }
}

파라미터

accommodationId
ID!
required
숙박 시설 ID
userId
ID
특정 사용자의 로그만 조회
관련 엔티티 ID (예: 예약 ID)
first
Int
처음부터 가져올 개수
after
String
이 커서 이후의 로그

getMyAgreement

특정 약관에 대한 현재 사용자의 동의 여부를 조회합니다.

GraphQL Signature

query GetMyAgreement($type: String!) {
  getMyAgreement(type: $type)
}

파라미터

type
String!
required
약관 타입 (예: “privacy”, “terms”, “marketing”)

응답

agreed
Boolean!
동의 여부

Mutations

signUp

새로운 사용자 계정을 생성합니다.

GraphQL Signature

mutation SignUp($input: SignUpInput!) {
  signUp(input: $input) {
    user {
      id
      identity
      name
      email
    }
  }
}

파라미터

input.identity
String!
required
사용자 아이디
input.phone
String
휴대폰 번호
input.accessLevel
UserType
사용자 권한 레벨 (기본값: CUSTOMER)
input.smsAuthHash
String
SMS 인증 해시 (휴대폰 번호 입력 시 필수)
input.name
String!
required
사용자 이름
input.nickname
String!
required
사용자 닉네임
input.email
String!
required
이메일 주소
input.password
String!
required
비밀번호

응답

user
User
생성된 사용자 정보

예제

mutation {
  signUp(input: {
    identity: "testuser"
    name: "홍길동"
    nickname: "테스터"
    email: "[email protected]"
    password: "password123!"
    phone: "01012345678"
    smsAuthHash: "01HQKS9V8X2N3P4Q5R6S7T8U9V"
  }) {
    user {
      id
      identity
      name
      email
    }
  }
}
휴대폰 번호를 입력하는 경우, 반드시 requestSMSAuthconfirmSMSAuth를 통해 발급받은 smsAuthHash를 제공해야 합니다.

signIn

사용자 로그인을 수행하고 인증 토큰을 발급받습니다.

GraphQL Signature

mutation SignIn($input: SignInInput!) {
  signIn(input: $input) {
    token {
      accessToken
      refreshToken
    }
  }
}

파라미터

input.identity
String!
required
사용자 아이디
input.password
String!
required
비밀번호

응답

token
TokenPayload
인증 토큰 정보

예제

mutation {
  signIn(input: {
    identity: "testuser"
    password: "password123!"
  }) {
    token {
      accessToken
      refreshToken
    }
  }
}

signInByAdmin

관리자가 다른 사용자로 로그인합니다.

GraphQL Signature

mutation SignInByAdmin($identity: String!) {
  signInByAdmin(identity: $identity) {
    token {
      accessToken
      refreshToken
    }
  }
}

파라미터

identity
String!
required
로그인할 사용자 아이디
이 API는 ADMIN 또는 SUPERADMIN 권한이 필요합니다.

disableUser

사용자 계정을 비활성화하거나 활성화합니다.

GraphQL Signature

mutation DisableUser($identity: String!, $disable: Boolean) {
  disableUser(identity: $identity, disable: $disable)
}

파라미터

identity
String!
required
대상 사용자 아이디
disable
Boolean
비활성화 여부 (true: 비활성화, false: 활성화)

addUserContact

사용자 연락처를 추가합니다.

GraphQL Signature

mutation AddUserContact($input: UserContactInput!) {
  addUserContact(input: $input) {
    id
    userId
    type
    contact
  }
}

파라미터

input.userId
ID!
required
사용자 ID
input.type
String!
required
연락처 타입 (예: “email”, “phone”, “kakao”)
input.contact
String!
required
연락처 정보

modifyUserContact

사용자 연락처를 수정합니다.

GraphQL Signature

mutation ModifyUserContact($input: ModifyUserContactInput!) {
  modifyUserContact(input: $input) {
    id
    userId
    type
    contact
  }
}

파라미터

input.id
ID!
required
수정할 연락처 ID
input.type
String
새로운 연락처 타입
input.contact
String
새로운 연락처 정보

deleteUserContact

사용자 연락처를 삭제합니다.

GraphQL Signature

mutation DeleteUserContact($id: ID!) {
  deleteUserContact(id: $id)
}

파라미터

id
ID!
required
삭제할 연락처 ID

updateInfo

현재 로그인한 사용자의 정보를 수정합니다.

GraphQL Signature

mutation UpdateInfo($input: UserInput!) {
  updateInfo(input: $input) {
    id
    phone
    name
    nickname
    accessLevel
  }
}

파라미터

input.id
ID
사용자 ID (관리자가 다른 사용자 수정 시 사용)
input.phone
String
새로운 휴대폰 번호
input.smsAuthHash
String
SMS 인증 해시 (휴대폰 번호 변경 시 필수)
input.name
String
새로운 이름
input.nickname
String
새로운 닉네임
input.accessLevel
UserType
새로운 권한 레벨 (관리자만 가능)

updateEmployee

직원 정보를 수정합니다.

GraphQL Signature

mutation UpdateEmployee($input: EmployeeInput!) {
  updateEmployee(input: $input) {
    id
    name
    email
  }
}

파라미터

input.id
ID!
required
직원 ID
input.accommodationId
ID!
required
숙박 시설 ID
input.phone
String
새로운 휴대폰 번호
input.email
String
새로운 이메일
input.name
String
새로운 이름
input.nickname
String
새로운 닉네임
input.password
String
새로운 비밀번호
input.authority
String
새로운 권한

deleteEmployee

직원 계정을 삭제합니다.

GraphQL Signature

mutation DeleteEmployee($id: ID!) {
  deleteEmployee(id: $id)
}

파라미터

id
ID!
required
삭제할 직원 ID

changePassword

비밀번호를 변경합니다.

GraphQL Signature

mutation ChangePassword($input: ChangePasswordInput!) {
  changePassword(input: $input) {
    id
  }
}

파라미터

input.id
ID
사용자 ID (관리자가 다른 사용자의 비밀번호 변경 시 사용)
input.password
String!
required
새로운 비밀번호
input.currentPassword
String
현재 비밀번호 (본인의 비밀번호 변경 시 필수)

changePasswordBySMSAuth

SMS 인증을 통해 비밀번호를 재설정합니다.

GraphQL Signature

mutation ChangePasswordBySMSAuth($input: ChangePasswordBySMSAuthInput!) {
  changePasswordBySMSAuth(input: $input)
}

파라미터

input.identity
String!
required
사용자 아이디
input.phone
String!
required
등록된 휴대폰 번호
input.password
String!
required
새로운 비밀번호
input.smsAuthHash
String!
required
SMS 인증 해시

예제

mutation {
  changePasswordBySMSAuth(input: {
    identity: "testuser"
    phone: "01012345678"
    password: "newpassword123!"
    smsAuthHash: "01HQKS9V8X2N3P4Q5R6S7T8U9V"
  })
}

changePasswordByEmailAuth

이메일 인증을 통해 비밀번호를 재설정합니다.

GraphQL Signature

mutation ChangePasswordByEmailAuth($input: ChangePasswordByEmailAuthInput!) {
  changePasswordByEmailAuth(input: $input)
}

파라미터

input.email
String!
required
등록된 이메일 주소
input.password
String!
required
새로운 비밀번호
input.emailAuthHash
String!
required
이메일 인증 해시

sendPasswordResetEmail

비밀번호 재설정 이메일을 발송합니다.

GraphQL Signature

mutation SendPasswordResetEmail($email: String!) {
  sendPasswordResetEmail(email: $email)
}

파라미터

email
String!
required
비밀번호를 재설정할 이메일 주소

응답

result
Boolean
이메일 발송 성공 여부

uploadThumbnail

사용자 프로필 이미지를 업로드합니다.

GraphQL Signature

mutation UploadThumbnail($image: Upload!) {
  uploadThumbnail(image: $image)
}

파라미터

image
Upload!
required
업로드할 이미지 파일

응답

url
String
업로드된 이미지 URL

agreeTerms

약관에 동의합니다.

GraphQL Signature

mutation AgreeTerms($type: String!, $isAgreed: Boolean!) {
  agreeTerms(type: $type, isAgreed: $isAgreed)
}

파라미터

type
String!
required
약관 타입 (예: “privacy”, “terms”, “marketing”)
isAgreed
Boolean!
required
동의 여부

응답

result
Boolean!
동의 처리 성공 여부

사용 흐름

회원가입 흐름

  1. 중복 확인: verifyDuplicate로 아이디, 이메일, 닉네임 중복 확인
  2. SMS 인증 (선택): requestSMSAuthconfirmSMSAuth로 휴대폰 인증
  3. 회원가입: signUp으로 계정 생성
  4. 이메일 인증 (선택): requestEmailVerificationverifyEmail

비밀번호 재설정 흐름

방법 1: SMS 인증
  1. requestSMSAuth로 SMS 발송
  2. confirmSMSAuth로 인증 해시 발급
  3. changePasswordBySMSAuth로 비밀번호 변경
방법 2: 이메일 인증
  1. sendPasswordResetEmail로 이메일 발송
  2. 이메일에서 인증 링크 클릭
  3. changePasswordByEmailAuth로 비밀번호 변경

관련 API