import { defHttp } from '/@/utils/http/axios';
import { CameraModel, CameraQueryParam } from './model/feedbackModel';

enum CameraManagerApi {
  CAMERA_POST_URL = '/opinion',
  CAMERA_GET_URL = '/opinion',
  CAMERA_DELETE_URL = '/opinion',
  CAMERA_GET_DETAIL_URL = '/opinion',
}

export const feedbackPage = (params: CameraQueryParam) => {
  return defHttp.get<CameraQueryParam>({
    url: CameraManagerApi.CAMERA_GET_URL,
    params,
  });
};

/**
 * 删除视频
 * @param ids 删除的ids
 */
export const deleteFeedbackManage = (ids: string[]) => {
  return defHttp.delete({
    url: CameraManagerApi.CAMERA_DELETE_URL,
    data: {
      ids: ids,
    },
  });
};

// 创建或编辑视频
export const createOrEditFeedBackManage = (data) => {
  return defHttp.post<CameraModel>({
    url: CameraManagerApi.CAMERA_POST_URL,
    data,
  });
};

// 查询视频详情
export const getCameraManageDetail = (id: string) => {
  return defHttp.get({
    url: CameraManagerApi.CAMERA_GET_DETAIL_URL + `/${id}`,
  });
};
