import { del, get, post } from '../../http'

// 参数类型定义
interface TokenListParams {
  keyword?: string
  page?: number
  size?: number
  status?: string
}

interface TokenData {
  description?: string
  id?: string
  name: string
  status?: number
  token?: string
}

/**
 * @description: 获取token列表
 */
export const getTokenList = async (params: TokenListParams) => {
  return await get<any>('/bootToken/list', params)
}
/**
 * @description: 添加
 */
export const addToken = async (data: TokenData) => {
  return await post<any>('/bootToken/insert', data)
}
/**
 * @description: 更新
 */
export const updateToken = async (data: TokenData) => {
  return await post<any>('/bootToken/update', data)
}

/**
 * @description: 删除
 */
export const delToken = async (id: string) => {
  return await del(`/bootToken/delete/${id}`)
}
