import request from "@/util/oaRequest"

// 查询发件人邮箱账号管理列表
export function listEmailAccount(query) {
  return request({
    url: '/oa/emailAccount/list',
    method: 'get',
    params: query
  })
}

// 查询发件人邮箱账号管理详细
export function getEmailAccount(emailId) {
  return request({
    url: '/oa/emailAccount/' + emailId,
    method: 'get'
  })
}

// 新增发件人邮箱账号管理
export function addEmailAccount(data) {
  return request({
    url: '/oa/emailAccount',
    method: 'post',
    data: data
  })
}

// 修改发件人邮箱账号管理
export function updateEmailAccount(data) {
  return request({
    url: '/oa/emailAccount',
    method: 'put',
    data: data
  })
}

// 删除发件人邮箱账号管理
export function delEmailAccount(emailId) {
  return request({
    url: '/oa/emailAccount/' + emailId,
    method: 'delete'
  })
}

// 发送邮件（单条和批量共用）
export function sendEmail(data) {
  return request({
    url: '/oa/emailAccount/sendBatchEmail',
    method: 'post',
    data
  })
}
