import request from '@/utils/request'

// 查询用户账户列表
export function listAccount(query) {
  return request({
    url: '/ss/account/list',
    method: 'get',
    params: query
  })
}

// 查询用户账户详细
export function getAccount(accountId) {
  return request({
    url: '/ss/account/' + accountId,
    method: 'get'
  })
}

// 查询用户对应类型的账户
export function getUserAccountByType(userId, type) {
  return request({
    url: '/ss/account/getUserAccountByType',
    method: 'get',
    params: {
      userId,
      type
    }
  })
}

// 新增用户账户
export function addAccount(data) {
  return request({
    url: '/ss/account',
    method: 'post',
    data: data
  })
}

// 修改用户账户
export function updateAccount(data) {
  return request({
    url: '/ss/account',
    method: 'put',
    data: data
  })
}

// 删除用户账户
export function delAccount(accountId) {
  return request({
    url: '/ss/account/' + accountId,
    method: 'delete'
  })
}
