
import BaseService from '../base'
import { AddSubDTO, DeleteSubDTO, GetALLStaffDTO, GetDepDTO, GetSub, UpdateDepDTO } from './service.dto'

export default class Department extends BaseService {
    router= {
      getsub: { path: '/v1/department/get-sub-dep', crediential: true },
      addDep: { path: '/v1/department/add-dep', crediential: true },
      deleteDep: { path: '/v1/department/delete-dep', crediential: true },
      getAllStaff: { path: '/v1/department/get-all-staffs', crediential: true },
      getDep: { path: '/v1/department/get-dep', crediential: true },
      updateDep: { path: '/v1/department/update-dep', crediential: true }
    }
    // constructor() {
    //   super()
    // }
    /**
     * 获取子部门信息
     * @param {GetSub} data {GetSub}
     * @returns
     */
    async getSub(data:GetSub) {
      return await this.useService(this.router.getsub, data)
    }

    /**
     * 添加部门
     * @param { AddSubDTO } data {AddSubDTO}
     * @returns
     */
    async addDep(data:AddSubDTO) {
      return await this.useService(this.router.addDep, data)
    }

    /**
     * 删除部门
     * @param { DeleteSubDTO } data {DeleteSubDTO}
     * @returns
     */
    async deleteDep(data:DeleteSubDTO) {
      return await this.useService(this.router.deleteDep, data)
    }

    /**
     * 获取部门的全部员工
     * @param { GetALLStaffDTO } data {GetALLStaffDTO}
     * @returns
     */
    async getAllStaff(data:GetALLStaffDTO) {
      return await this.useService(this.router.getAllStaff, data)
    }

    /**
     * 获取部门基本信息
     * @param { GetDepDTO } data {GetDepDTO}
     * @returns
     */
    async getDep(data:GetDepDTO) {
      return await this.useService(this.router.getDep, data)
    }

    /**
     * 修改部门基本信息
     * @param { UpdateDepDTO } data {UpdateDepDTO}
     * @returns
     */
    async updateDep(data:UpdateDepDTO) {
      return await this.useService(this.router.updateDep, data)
    }
}

