import { request } from '@/http/axios'
import { SubmitApprovalRequestData, SubmitApprovalResponseData, SearchApiReturnApprovalQuery, ApiResponsePageData, ReturnApprovalEntity, HandleApprovalRequestData } from './type'

export const getApprovalListApi = (params: SearchApiReturnApprovalQuery) => {
  return request<ApiResponsePageData<ReturnApprovalEntity>>({
    url: 'approval/list',
    method: 'get',
    params
  })
}



export const submitApprovalApi = (data: SubmitApprovalRequestData) => {
  return request<SubmitApprovalResponseData>({
    url: 'approval/submit',
    method: 'post',
    data
  })
}

export const handleApprovalApi = (data: HandleApprovalRequestData) => {
  return request<ApiResponseMsgData<string>>({
    url: 'approval/handle',
    method: 'post',
    data
  })
}
