import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FilingTaskVO, FilingTaskQuery, FilingTaskFilingForm } from './types';

/**
 * 查询归档任务列表
 * @param query 查询参数
 */
export const listFilingTasks = (
  query: FilingTaskQuery
): AxiosPromise<{
  total: number;
  rows: FilingTaskVO[];
}> => {
  return request({
    url: '/home/taskCenter/filing/list',
    method: 'get',
    params: query
  });
};

/**
 * 归档文档
 * @param data 归档参数
 */
export const filingDocument = (data: FilingTaskFilingForm) => {
  return request({
    url: '/home/taskCenter/filing/filing',
    method: 'put',
    data: data
  });
};
