import request from '@/apps/mobile/utils/request'

// 专家列表
export function queryExpertList(data) {
    return request({
        method: 'post',
        url: '/api/userInfos/listExpert',
        data,
    });
}

// 新增专家
export function addExpert(data) {
    return request({
        method: 'post',
        url: '/api/userInfos/addExpert',
        data,
    });
}

// 修改专家
export function updateExpert(data) {
    return request({
        method: 'post',
        url: '/api/userInfos/updateUser',
        data,
    });
}

// 删除专家
export function deleteExpert(data) {
    return request({
        method: 'post',
        url: '/api/userInfos/deleteUser',
        data,
    });
}

// 踢出专家
export function updateUserExpert(id) {
    return request({
        method: 'get',
        url: `/api/userAccounts/updateUserExpert?userId=${id}`
    });
}

// ------------------------------------------------------
// 专家申请列表
export function queryExpertApplyList(data) {
    return request({
        method: 'post',
        url: '/api/applyExperts/query-page',
        data,
    });
}

// 新增专家审批
export function addApplyExpert(data) {
    return request({
        method: 'post',
        url: '/api/applyExperts/insert',
        data,
    });
}

// 更新专家审批
export function updateApplyExpert(data) {
    return request({
        method: 'put',
        url: '/api/applyExperts/update',
        data,
    });
}


// 单个删除专家审批
export function deleteApplyExpertSingle(id) {
    return request({
        method: 'delete',
        url: `/api/applyExperts/delete/${id}`,
    });
}


// 批量删除专家审批
export function deleteApplyExpertBatch(data) {
    return request({
        method: 'delete',
        url: '/api/applyExperts/delete-batch',
        data
    });
}

// 专家审批
export function expertApproval(data) {
    return request({
        method: 'post',
        url: '/api/applyExperts/examine',
        data,
    });
}


// -------------------------------------------------
// 专家协议列表
export function queryExpertAgreementList(data) {
    return request({
        method: 'post',
        url: '/api/userAgreements/query-page',
        data,
    });
}

// 新增专家协议
export function addExpertAgreement(data) {
    return request({
        method: 'post',
        url: '/api/userAgreements/insert',
        data,
    });
}

// 修改专家协议
export function updateExpertAgreement(data) {
    return request({
        method: 'put',
        url: '/api/userAgreements/update',
        data,
    });
}


// 单个删除专家协议
export function deleteExpertAgreementSingle(data) {
    return request({
        method: 'delete',
        url: `/api/userAgreements/delete`,
        data,
    });
}


// 批量删除专家协议
export function deleteExpertAgreementBatch(data) {
    return request({
        method: 'delete',
        url: '/api/userAgreements/delete-batch',
        data
    });
}


// 批量启用专家协议
export function useExpertAgreementBatch(data) {
    return request({
        method: 'post',
        url: '/api/userAgreements/useBath',
        data,
    });
}



// 查询所有专家
export function queryAllExpert(data) {
    return request({
        method: 'post',
        url: '/api/userInfos/queryAllExpert',
        data,
    });
}


// 发红包
export function sendRedEnvelopes(redEncelopId, userId) {
    return request({
        method: 'get',
        url: `/api/userInfos/sendRedEnvelope?redEncelopId=${redEncelopId}&userId=${userId}`,
    });
}

// 批量发红包
export function batchSendRedEnvelopes(data) {
    return request({
        method: 'post',
        url: `/api/userInfos/batchSendRedEnvelope`,
        data
    });
}


// 惩罚
export function punishment(money, userId) {
    return request({
        method: 'get',
        url: `/api/userInfos/punishment?money=${money}&userId=${userId}`,
    });
}


// 查询红包
export function queryCouponsList(data) {
    return request({
        method: 'post',
        url: '/api/coupons/query-page',
        data,
    });
}


// 专家惩罚提交
export function expertsPunishments(data) {
    return request({
        method: 'post',
        url: '/api/expertsPunishments/insert',
        data,
    });
}


// 专家处罚记录列表
export function queryExpertPunishmentList(data) {
    return request({
        method: 'post',
        url: '/api/expertsPunishments/query-page',
        data,
    });
}


// 撤销专家惩罚
export function cancelPunishment(data) {
    return request({
        method: 'post',
        url: '/api/expertsPunishments/cancelPunishment',
        data,
    });
}