import request from '@/config/axios'

// 用户反馈 VO
export interface FeedbackVO {
  id: number // id
  title: string // 标题
  content: string // 内容
  tags: string // 标签
}

// 用户反馈 API
export const FeedbackApi = {
  // 查询用户反馈分页
  getFeedbackPage: async (params: any) => {
    return await request.get({ url: `/iot/feedback/page`, params })
  },

  // 查询用户反馈详情
  getFeedback: async (id: number) => {
    return await request.get({ url: `/iot/feedback/get?id=` + id })
  },

  // 新增用户反馈
  createFeedback: async (data: FeedbackVO) => {
    return await request.post({ url: `/iot/feedback/create`, data })
  },

  // 修改用户反馈
  updateFeedback: async (data: FeedbackVO) => {
    return await request.put({ url: `/iot/feedback/update`, data })
  },

  // 删除用户反馈
  deleteFeedback: async (id: number) => {
    return await request.delete({ url: `/iot/feedback/delete?id=` + id })
  },

  // 导出用户反馈 Excel
  exportFeedback: async (params) => {
    return await request.download({ url: `/iot/feedback/export-excel`, params })
  }
}