import { request } from 'umi';
import { api } from '../api'

/**公众号列表 */
export async function getUserList() {
    return request(`${api}/system/mp/allOfCheckUser `);
}
/**
 * ================================================高级群发================================================
 */
// 列表
export async function getAdvancedList(params: { mpId: any, name: any, executionStatus: any, checkStatus: any }) {
    return request(`${api}/system/msgCheck/msgGroupStrategyList`, {
        method: 'POST',
        data: params
    });
}
// 审查
export async function reviewAdvanced(params: { strategyId: any, checkRemark: any, checkStatus: any }) {
    const { strategyId, ...param } = params
    return request(`${api}/system/msgCheck/msgGroupStrategyCheck/${strategyId}`, {
        method: 'PUT',
        data: param
    });
}
// 预览
export async function seeAdvanced(params: { strategyId: any, mpId: any, fansId: any }) {
    const { strategyId, mpId, fansId } = params
    return request(`${api}/system/mpMsgGroupSendStrategy/preview2/${mpId}/${fansId}/${strategyId}`, {
        method: 'PUT',
    });
}
/**
* ================================================客服消息================================================
*/
// 列表
export async function getAserviceList(params: { mpId: any, taskName: any, status: any, checkStatus: any }) {
    return request(`${api}/system/msgCheck/kefuStrategyList`, {
        method: 'POST',
        data: params
    });
}
// 审查
export async function reviewAservice(params: { strategyId: any, checkRemark: any, checkStatus: any }) {
    const { strategyId, ...param } = params
    return request(`${api}/system/msgCheck/kefuStrategyCheck/${strategyId}`, {
        method: 'PUT',
        data: param
    });
}
// 预览
export async function seeAservice(params: { strategyId: any, mpId: any, fansId: any }) {
    const { strategyId, mpId, fansId } = params
    return request(`${api}/system/mp/kefuMsgStrategy/preview2/${mpId}/${strategyId}/${fansId}`, {
        method: 'PUT',
    });
}

/**
* ================================================模板消息================================================
*/
// 列表
export async function getAtemplateList(params: { mpId: any, taskName: any, executionStatus: any, checkStatus: any }) {
    return request(`${api}/system/msgCheck/templateStrategyList`, {
        method: 'POST',
        data: params
    });
}
// 审查
export async function reviewAtemplate(params: { strategyId: any, checkRemark: any, checkStatus: any }) {
    const { strategyId, ...param } = params
    return request(`${api}/system/msgCheck/templateStrategyCheck/${strategyId}`, {
        method: 'PUT',
        data: param
    });
}
// 预览
export async function seeAtemplate(params: { strategyId: any, fansId: any }) {
    const { strategyId, fansId } = params
    return request(`${api}/system/mp/templateMsg/preview2/${strategyId}/${fansId}`, {
        method: 'PUT',
    });
}
/**
* ================================================立即/延迟================================================
*/
// 列表
export async function getInteractList(params: { mpId: any, eventType: any, checkStatus: any }) {
    return request(`${api}/system/msgCheck/resStrategyList`, {
        method: 'POST',
        data: params
    });
}
//审查
export async function reviewInteract(params: { strategyId: any, checkRemark: any, checkStatus: any }) {
    const { strategyId, ...param } = params
    return request(`${api}/system/msgCheck/resStrategyCheck/${strategyId}`, {
        method: 'PUT',
        data: param
    });
}
// 预览
export async function seeInteract(params: { strategyId: any, fansId: any }) {
    const { strategyId, fansId } = params
    return request(`${api}/system/mp/replyStrategy/preview2/${strategyId}/${fansId}`, {
        method: 'PUT',
    });
}