import { responsesmodel } from './model/queryModal';
import { defHttp } from '@/utils/http/axios';

enum Api {
  InitiateFlow = '/api/Workflow/InitiateFlow',
  HandleWorkitem = '/api/Workflow/HandleWorkitem',
  SaveDraft = '/api/Workflow/SaveDraft',
  QueryMyDraft = '/api/Workflow/QueryMyDraft',
  QueryMyToDo = '/api/Workflow/QueryMyToDo',
  QueryMyDone = '/api/Workflow/QueryMyDone',
  QueryMyUnfinished = '/api/Workflow/QueryMyUnfinished',
  QueryMyCompleted = '/api/Workflow/QueryMyCompleted',
  QueryMyAllItems = '/api/Workflow/QueryMyAllItems',
  Detail = '/api/Workflow/Detail',
  GetUserInfoWithDept = '/api/Workflow/GetUserInfoWithDept',
  ListSupervisionOrg = '/api/Workflow/ListSupervisionOrg',
}

export function initiateFlow(params) {
  return defHttp.post<responsesmodel>({
    url: Api.InitiateFlow,
    params,
  });
}
export function handleWorkitem(params) {
  return defHttp.post<responsesmodel>({
    url: Api.HandleWorkitem,
    params,
  });
}
export function saveDraft(params) {
  return defHttp.post<responsesmodel>({
    url: Api.SaveDraft,
    params,
  });
}
export function queryMyDraft(params) {
  return defHttp.get<responsesmodel>({
    url: Api.QueryMyDraft,
    params,
  });
}

export function queryMyToDo(params) {
  return defHttp.get<responsesmodel>({
    url: Api.QueryMyToDo,
    params,
  });
}

export function queryMyDone(params) {
  return defHttp.get<responsesmodel>({
    url: Api.QueryMyDone,
    params,
  });
}

export function queryMyUnfinished(params) {
  return defHttp.get<responsesmodel>({
    url: Api.QueryMyUnfinished,
    params,
  });
}

export function queryMyCompleted(params) {
  return defHttp.get<responsesmodel>({
    url: Api.QueryMyCompleted,
    params,
  });
}

export function queryMyAllItems(params) {
  return defHttp.get<responsesmodel>({
    url: Api.QueryMyAllItems,
    params,
  });
}
export function detail(params) {
  return defHttp.get<responsesmodel>({
    url: Api.Detail,
    params,
  });
}
export function getUserInfoWithDept(params) {
  return defHttp.get<responsesmodel>({
    url: Api.GetUserInfoWithDept,
    params,
  });
}
export function listSupervisionOrg(params) {
  return defHttp.get<responsesmodel>({
    url: Api.ListSupervisionOrg,
    params,
  });
}
