import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  CaseBaseInfoVO,
  CaseBaseInfoForm,
  CaseBaseInfoQuery,
  Doctoroption,
  BeautifyNoticeVo
} from "@/api/business/caseBaseInfo/types";

/**
 * 查询课件基础信息列表
 * @param query
 * @returns {*}
 */

export const listCaseBaseInfo = (query?: CaseBaseInfoQuery): AxiosPromise<CaseBaseInfoVO[]> => {
  return request({
    url: '/business/caseBaseInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询租户的课件信息列表
 * @param query
 * @returns {*}
 */
export const listCaseViewInfo = (query?: CaseBaseInfoQuery): AxiosPromise<CaseBaseInfoVO[]> => {
  return request({
    url: '/business/caseBaseInfo/tenantList',
    method: 'get',
    params: query
  });
};

/**
 * 查询审核课件基础信息列表
 * @param query
 * @returns {*}
 */
export const ChecklistCaseBaseInfo = (query?: CaseBaseInfoQuery): AxiosPromise<CaseBaseInfoVO[]> => {
  return request({
    url: '/business/caseBaseInfo/checkList',
    method: 'get',
    params: query
  });
};

/**
 * 查询点评专家下拉列表
 */
export const listExpert = (): AxiosPromise<Doctoroption[]> => {
  return request({
    url: '/business/caseBaseInfo/expertSelectList',
    method: 'get'
  });
};

/**
 * 查询医生用户列表
 */
export const listDoctor = (): AxiosPromise<Doctoroption[]> => {
  return request({
    url: '/business/caseBaseInfo/doctorList',
    method: 'get'
  });
};

/**
 * 查询课件基础信息详细
 * @param id
 */
export const getCaseBaseInfo = (id: string | number): AxiosPromise<CaseBaseInfoVO> => {
  return request({
    url: '/business/caseBaseInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增课件基础信息
 * @param data
 */
export const addCaseBaseInfo = (data: CaseBaseInfoForm) => {
  return request({
    url: '/business/caseBaseInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改课件基础信息
 * @param data
 */
export const updateCaseBaseInfo = (data: CaseBaseInfoForm) => {
  return request({
    url: '/business/caseBaseInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除课件基础信息
 * @param id
 */
export const delCaseBaseInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/caseBaseInfo/' + id,
    method: 'delete'
  });
};

/**
 * 查询课件美化通知下载信息
 * @param id
 */
export const getBeautifyNotice = (id: string | number): AxiosPromise<BeautifyNoticeVo> => {
  return request({
    url: '/business/caseBaseInfo/notice/' + id,
    method: 'get'
  });
};
