import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 用户注销提示信息信息 */
export interface WarningMessage {
          id: number; // 主键
          locale: string; // 地区
          content: string; // 正文
          updatedAt: string | Dayjs; // 更新时间
          created: string | Dayjs; // 创建时间
  }

// 用户注销提示信息 API
export const WarningMessageApi = {
  // 查询用户注销提示信息分页
  getWarningMessagePage: async (params: any) => {
    return await request.get({ url: `/keyboard/warning-message/page`, params })
  },

  // 查询用户注销提示信息详情
  getWarningMessage: async (id: number) => {
    return await request.get({ url: `/keyboard/warning-message/get?id=` + id })
  },

  // 新增用户注销提示信息
  createWarningMessage: async (data: WarningMessage) => {
    return await request.post({ url: `/keyboard/warning-message/create`, data })
  },

  // 修改用户注销提示信息
  updateWarningMessage: async (data: WarningMessage) => {
    return await request.put({ url: `/keyboard/warning-message/update`, data })
  },

  // 删除用户注销提示信息
  deleteWarningMessage: async (id: number) => {
    return await request.delete({ url: `/keyboard/warning-message/delete?id=` + id })
  },

  /** 批量删除用户注销提示信息 */
  deleteWarningMessageList: async (ids: number[]) => {
    return await request.delete({ url: `/keyboard/warning-message/delete-list?ids=${ids.join(',')}` })
  },

  // 导出用户注销提示信息 Excel
  exportWarningMessage: async (params) => {
    return await request.download({ url: `/keyboard/warning-message/export-excel`, params })
  }
}