import http from '@/utils/request'

// 获取滚动字幕列表
export function getMarqueeList (params) {
  return http.get(`marquee/?pageNum=${params.pageNum}&status=${params.status}`)
}
// 激活/禁用
export function activeMarquee (id, value) {
  return http.post(`marquee/${id}/active`, { active: value })
}
// 删除
export function deleteMarquee (id) {
  return http.delete(`marquee/${id}`)
}
// 添加
export function addMarquee (params) {
  return http.post('/marquee', params)
}
// 详情
export function getMarqueeDetail (id) {
  return http.get(`/marquee/${id}`)
}
// 编辑
export function editMarquee (id, params) {
  return http.put(`/marquee/${id}`, params)
}
// 版本预览
export function versionPreview () {
  return http.get(`/marqueeversion/preview`)
}
// 创建版本
export function addVersion (params) {
  return http.post(`/marqueeversion`, params)
}
// 版本列表
export function getVersionList (params) {
  return http.get(`/marqueeversion/?pageNum=${params.pageNum}&status=${params.status}`)
}
// 激活/禁用
export function activeVersion (id, value) {
  return http.post(`/marqueeversion/${id}/active`, { active: value })
}
// 版本详情
export function getVersionDetail (id) {
  return http.get(`/marqueeversion/${id}`)
}
// 发布字幕
export function publishMarquee (version) {
  return http.post(`/realtimecmd`, {
    param: {
      type: 'MARQUEEPUBLISH',
      version: version
    },
    users: []
  })
}
