import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InterviewQuery, InterviewVO, InterviewForm } from './types';

// 查询约谈列表
export function listInterview(query: InterviewQuery): AxiosPromise<InterviewVO[]> {
  return request({ url: '/edu/interview/list', method: 'get', params: query });
}

// 查询约谈详情
export function getInterview(id: number | string): AxiosPromise<InterviewVO> {
  return request({ url: '/edu/interview/' + id, method: 'get' });
}

// 新增约谈
export function addInterview(data: InterviewForm) {
  return request({ url: '/edu/interview', method: 'post', data });
}

// 修改约谈
export function updateInterview(data: InterviewForm) {
  return request({ url: '/edu/interview', method: 'put', data });
}

// 删除约谈
export function delInterview(ids: string | number | (string | number)[]) {
  return request({ url: '/edu/interview/' + ids, method: 'delete' });
}

// 标记已跟进
export function markFollowed(id: number | string) {
  return request({ url: '/edu/interview/follow/' + id, method: 'put' });
}
