
import BaseService from '../base'
import { GetApplyDTO, JoinApplyDTO, QuitApplyDTO, SubmitJoinApplyDTO, SubmitQuitApplyDTO } from './service.dto'

export default class Enterprise extends BaseService {
  router= {
    getApply: { path: '/v1/apply/get-applylist', crediential: true },
    approvalJoin: { path: '/v1/apply/join-apply-approval', crediential: true },
    approvalQuit: { path: '/v1/apply/quit-apply-approval', crediential: true },
    submitJoin: { path: '/v1/apply/submit-join-apply', crediential: true },
    submitQuit: { path: '/v1/apply/submit-quit-apply', crediential: true }
  }
  // constructor() {
  //   super()
  // }
  /**
   * 获取审批列表
   * @param {GetApplyDTO} data {GetApplyDTO}
   * @returns
   */
  async getApply(data: GetApplyDTO) {
    return await this.useService(this.router.getApply, data)
  }

  /**
   * 提交加入申请
   * @param {JoinApplyDTO} data {JoinApplyDTO}
   * @returns
   */
  async approvalJoin(data: JoinApplyDTO) {
    return await this.useService(this.router.approvalJoin, data)
  }

  /**
   * 提交退出申请
   * @param {QuitApplyDTO} data {QuitApplyDTO}
   * @returns
   */
  async approvalQuit(data: QuitApplyDTO) {
    return await this.useService(this.router.approvalQuit, data)
  }

  /**
   * 审批加入
   * @param {SubmitJoinApplyDTO} data {SubmitJoinApplyDTO}
   * @returns
   */
  async submitJoin(data: SubmitJoinApplyDTO) {
    return await this.useService(this.router.submitJoin, data)
  }

  /**
   * 审批退出
   * @param {SubmitQuitApplyDTO} data {SubmitQuitApplyDTO}
   * @returns
   */
  async submitQuit(data: SubmitQuitApplyDTO) {
    return await this.useService(this.router.submitQuit, data)
  }
}

