import request from '@/config/axios'

// 早报资讯 VO
export interface MorningNewsVO {
  id: number // id
  title: string // 标题
  url: string // 外链地址
}

// 早报资讯 API
export const MorningNewsApi = {
  // 查询早报资讯分页
  getMorningNewsPage: async (params: any) => {
    return await request.get({ url: `/menduner/system/morning-news/page`, params })
  },

  // 查询早报资讯详情
  getMorningNews: async (id: number) => {
    return await request.get({ url: `/menduner/system/morning-news/get?id=` + id })
  },

  // 新增早报资讯
  createMorningNews: async (data: MorningNewsVO) => {
    return await request.post({ url: `/menduner/system/morning-news/create`, data })
  },

  // 修改早报资讯
  updateMorningNews: async (data: MorningNewsVO) => {
    return await request.put({ url: `/menduner/system/morning-news/update`, data })
  },

  // 删除早报资讯
  deleteMorningNews: async (id: number) => {
    return await request.delete({ url: `/menduner/system/morning-news/delete?id=` + id })
  },

  // 导出早报资讯 Excel
  exportMorningNews: async (params) => {
    return await request.download({ url: `/menduner/system/morning-news/export-excel`, params })
  }
}