import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/bank/keypwd/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getDownloadList = (params) => {
  return request({
    url: '/api/bank/keypwd/getList',
    method: 'get',
    params: {
      ...params,
    }
  })
}


export const getCurrentUserKeepCategory = () => {
  return request({
    url: '/api/bank/keypwd/getCurrentUserKeepCategory',
    method: 'get',
    params: {
    }
  })
}

export const sure = (row) => {
  return request({
    url: '/api/bank/keypwd/sure',
    method: 'post',
    data: row
  })
}

export const getKeepList = (params) => {
  return request({
    url: '/api/bank/keypwd/getKeepList',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/bank/keypwd/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/bank/keypwd/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/bank/keypwd/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/bank/keypwd/submit',
    method: 'post',
    data: row
  })
}

export const getByCategoryAndType = (category, orgNo) => {
  return request({
    url: '/api/bank/keypwd/getByCategoryAndType',
    method: 'get',
    params: {
      category,
      orgNo,
    }
  })
}

export const getKeyType = () => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=key_type',
    method: 'get',
    params: {
    }
  })
}

