import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OfficialLiveConfigVO, OfficialLiveConfigForm, OfficialLiveConfigQuery } from '@/api/system/physical/officialLiveConfig/types';

/**
 * 查询官方直播配置列表
 * @param query
 * @returns {*}
 */

export const listOfficialLiveConfig = (query?: OfficialLiveConfigQuery): AxiosPromise<OfficialLiveConfigVO[]> => {
  return request({
    url: '/physical/officialLiveConfig/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询官方直播配置详细
 * @param id
 */
export const getOfficialLiveConfig = (id: string | number): AxiosPromise<OfficialLiveConfigVO> => {
  return request({
    url: '/physical/officialLiveConfig/' + id,
    method: 'get'
  });
};

/**
 * 新增官方直播配置
 * @param data
 */
export const addOfficialLiveConfig = (data: OfficialLiveConfigForm) => {
  return request({
    url: '/physical/officialLiveConfig',
    method: 'post',
    data: data
  });
};

/**
 * 修改官方直播配置
 * @param data
 */
export const updateOfficialLiveConfig = (data: OfficialLiveConfigForm) => {
  return request({
    url: '/physical/officialLiveConfig',
    method: 'put',
    data: data
  });
};

/**
 * 删除官方直播配置
 * @param id
 */
export const delOfficialLiveConfig = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/officialLiveConfig/' + id,
    method: 'delete'
  });
};
