import request from '@/utils/request'

/**
 * @description 获取分享信息
 */
export function getShareInfo() {
    return request.get({ url: '/share/getShareInfo' }, { withToken: false })
}

/**
 * @description 创建短链接
 */
export function createShortLink(data: {
    page_type: string
    page_id?: number | string
    path?: string
    invite_code?: string
    title?: string
    description?: string
}) {
    return request.post({ url: '/shortLink/create', data })
}

/**
 * @description 解析短链接并上报指纹
 */
export function resolveShortLink(data: { code: string; fingerprint: string; referer?: string }) {
    return request.post({ url: '/shortLink/resolve', data }, { withToken: false })
}

/**
 * @description 获取邀请列表
 */
export function getInviteList(data: { page?: number; size?: number }) {
    return request.get({ url: '/share/getInviteList', data })
}
