import { request } from '@/utils/request'
import type { LoveUserItem, LoveListParams, ApiResponse, UnlockUserResult } from './type'

/** 获取我解锁的相亲对象列表 */
export const getMyLoveListAPI = () => request.get<ApiResponse<LoveUserItem[]>>('/love/myList')

/** 获取推荐相亲对象列表 */
export const getLoveListAPI = (params: LoveListParams) =>
  request.post<ApiResponse<LoveUserItem[]>>('/love/list', params)

/** 检查用户是否已解锁 */
export const checkIsLoveAPI = (id: string) =>
  request.get<ApiResponse<boolean>>(`/user/isLove/${id}`)

/** 解锁用户 */
export const unlockUserAPI = (id: string) =>
  request.get<ApiResponse<UnlockUserResult[]>>(`/user/love/${id}`)

/** 获取用户详细信息 */
export const getUserDetailAPI = (id: string) =>
  request.get<ApiResponse<LoveUserItem>>(`/user/detail/${id}`)
