import request from '@/utils/request'

// 查询企微sop列表
export function listSop(query) {
  return request({
    url: '/app/sop/list',
    method: 'get',
    params: query
  })
}
export function listMySop(query) {
  return request({
    url: '/app/sop/myList',
    method: 'get',
    params: query
  })
}
export function getTempUserList(id) {
  return request({
    url: '/app/sop/getTempUserList',
    method: 'get',
    params: {id}
  })
}
export function listDeptSop(query) {
  return request({
    url: '/app/sop/deptList',
    method: 'get',
    params: query
  })
}
// 查询企微sop模板列表
export function listAiChatSop(query) {
  return request({
    url: '/app/sop/listAiChatSop',
    method: 'get',
    params: query
  })
}

export function courseList(data) {
  return request({
    url: '/app/course/courseList',
    method: 'get',
    params: data
  })
}
export function videoList(id,query) {

  return request({
    url: '/app/sop/videoList/' + id,
    params: query,
    method: 'get'
  })
}
// 查询企微sop详细
export function getSop(params) {
  return request({
    url: '/app/sop/getById',
    method: 'get',
    params: params
  })
}

// 新增sop
export function addSop(data) {
  return request({
    url: '/app/sop/add',
    method: 'post',
    data: data
  })
}

// 新增企微sop
export function updateTemp(data) {
  return request({
    url: '/app/sop/updateTemp',
    method: 'post',
    data: data
  })
}

// 修改企微sop
export function updateSop(data) {
  return request({
    url: '/app/sop/edit',
    method: 'post',
    data: data
  })
}
//修改sop自动创建时间
export function updateAutoSopTime(data) {
  return request({
    url: '/app/sop/updateAutoSopTime',
    method: 'post',
    data: data
  })
}

//修改状态
export function updateSopStatus(data) {
  return request({
    url: '/app/sop/updateSopStatus',
    method: 'post',
    data: data
  })
}
// 删除sop
export function delSop(id) {
  return request({
    url: '/app/sop/delete/' + id,
    method: 'delete'
  })
}

//批量执行sop
export function executeSop(ids) {
  return request({
    url: '/app/sop/executeSop/' + ids,
    method: 'put'
  })
}
//批量执行企微sop先改状态
export function updateStatus(ids) {
  return request({
    url: '/app/sop/updateStatus/' + ids,
    method: 'get'
  })
}
// 导出企微sop
export function exportSop(query) {
  return request({
    url: '/app/sop/export',
    method: 'get',
    params: query
  })
}

// 导出企微sop
export function getSopVoiceList(params) {
  return request({
    url: '/app/sop/getSopVoiceList',
    method: 'get',
    params
  })
}


// 修改企微sop
export function updateSopQwUser(data) {
  return request({
    url: '/app/sop/updateSopQwUser',
    method: 'post',
    data: data
  })
}
