// 用户管理
import request from '@/utils/request'


// 用户列
export const groupList = (data) => {
    return request({
        url: `api/groups`,
        method: 'get',
        params: data
    })
}
export const groupMemberList = (data) => {
    return request({
        url: `api/group_members`,
        method: 'get',
        params: data
    })
}


export const syncGroup = (data: any) => {
    return request({
        url: `api/sync/groups`,
        method: 'post',
        data: data

    })
}
export const syncGroupMember = (data: any) => {
    return request({
        url: `api/sync/group_members`,
        method: 'post',
        data: data

    })
}


export const removeMember = (data: any) => {
    return request({
        url: `api/group/remove_member`,
        method: 'post',
        data: data

    })
}
// 邀请好友入群
export const inviteMember = (data: any) => {
    return request({
        url: `api/group/invite_member`,
        method: 'post',
        data: data

    })
}
// 群公告

export const sendTopic = (data: any) => {
    return request({
        url: `api/group/send_topic`,
        method: 'post',
        data: data

    })
}

export const deleteGroup = (data: any) => {
    return request({
        url: `api/group/delete`,
        method: 'post',
        data: data
    })
}

export const createGroup = (data: any) => {
    return request({
        url: `api/group/create_external`,
        method: 'post',
        data: data
    })
}

export const tasks = (data: any) => {
    return request({
        url: `api/group/tasks`,
        method: 'get',
        params: data
    })
}

// 查询群组智能体

export const groupAgent = (data: any) => {
    return request({
        url: `api/group/agent`,
        method: 'get',
        params: data
    })
}

// 配置群组智能体

export const setAgent = (data: any) => {
    return request({
        url: `api/group/set_agent`,
        method: 'post',
        data
    })
}

// 删除智能体

export const deleteAgent = (data: any) => {
    return request({
        url: `api/group/agent`,
        method: 'delete',
        data
    })
}

// 意图管理

export const keyWordArr = (data: any) => {
    return request({
        url: `admin/app/keywords`,
        method: 'get',
        params: data
    })
}

export const deleteKeyword = (id) => {
    return request({
        url: `admin/app/keyword/${id}`,
        method: 'delete'
    })
}

// 获取群组详情
export const groupDetail = (data) => {
    return request({
        url: `api/group_detail`,
        method: 'get',
        params: data
    })
}

// 获取群组聊天记录
export const groupChatRecord = (data) => {
    return request({
        url: `api/group/messages`,
        method: 'get',
        params: data
    })
}
