人力资源域把员工(Employee)、部门(Department)与考勤(Attendance)三类核心对象抽象为 IHumanResourcesService,消费方通过 DI 注入接口即可,无需关心具体供应商。
统一接口
IHumanResourcesService(命名空间 Bitzsoft.Integrations.HumanResources)定义 9 个方法:
| 方法 | 说明 |
|---|---|
CreateEmployeeAsync | 创建员工 |
GetEmployeeAsync | 查询单个员工 |
UpdateEmployeeAsync | 更新员工信息 |
DeactivateEmployeeAsync | 停用员工 |
ListEmployeesAsync | 查询员工列表 |
CreateDepartmentAsync | 创建部门 |
ListDepartmentsAsync | 查询部门列表 |
SubmitAttendanceAsync | 提交考勤记录 |
ListAttendanceRecordsAsync | 查询员工考勤记录 |
接口还暴露 ProviderName 属性,返回运行时供应商名称(如 "Moka")。
包结构
Bitzsoft.Integrations.HumanResources/ ← 抽象层Bitzsoft.Integrations.HumanResources.All/ ← 聚合包(拉入全部 2 家)Bitzsoft.Integrations.HumanResources.Moka/ ← Moka HRBitzsoft.Integrations.HumanResources.Xinrenxinshi/ ← 薪人薪事供应商清单
| 供应商 | Provider ID | 鉴权 | 文档 |
|---|---|---|---|
| Moka | moka | HTTP Basic Auth(API Key + Secret) | moka.mdx |
| 薪人薪事 | xinrenxinshi | API Key + HMAC-SHA256 签名头 | xinrenxinshi.mdx |