Bitzsoft.Integrations.HumanResources.Xinrenxinshi
1.0.2
dotnet add package Bitzsoft.Integrations.HumanResources.Xinrenxinshi --version 1.0.2
NuGet\Install-Package Bitzsoft.Integrations.HumanResources.Xinrenxinshi -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.HumanResources.Xinrenxinshi" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.HumanResources.Xinrenxinshi" Version="1.0.2" />
<PackageReference Include="Bitzsoft.Integrations.HumanResources.Xinrenxinshi" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.HumanResources.Xinrenxinshi --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bitzsoft.Integrations.HumanResources.Xinrenxinshi, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.HumanResources.Xinrenxinshi@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.HumanResources.Xinrenxinshi&version=1.0.2
#tool nuget:?package=Bitzsoft.Integrations.HumanResources.Xinrenxinshi&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Bitzsoft.Integrations.HumanResources.Xinrenxinshi
薪人薪事人力资源服务实现,实现 IHumanResourcesService 统一接口。
功能特性
- 员工全生命周期:创建、查询、更新、停用(离职)、分页列表查询
- 部门管理:创建部门、查询部门列表
- 考勤管理:提交考勤、按日期范围查询考勤记录
- API Key + HMAC-SHA256 签名鉴权:请求头携带
X-Xrxs-Api-Key、X-Xrxs-Timestamp、X-Xrxs-Nonce、X-Xrxs-Signature,签名逐请求生成 - 统一接口:实现
IHumanResourcesService,ProviderName返回薪人薪事供应商标识 - 配置校验:注册时通过
XinrenxinshiOptionsValidator校验必填项 - 请求审计:内置 RequestLogging 管道,记录出站请求
安装
dotnet add package Bitzsoft.Integrations.HumanResources.Xinrenxinshi
<PackageReference Include="Bitzsoft.Integrations.HumanResources.Xinrenxinshi" Version="1.0.0" />
配置
appsettings.json
{
"HumanResources": {
"Xinrenxinshi": {
"ApiBaseUrl": "https://api.xinrenxinshi.com",
"ApiKey": "your-api-key",
"ApiSecret": "your-api-secret"
}
}
}
| 配置项 | 说明 | 必填 | 默认值 |
|---|---|---|---|
ApiBaseUrl |
薪人薪事开放平台基地址 | 否 | https://api.xinrenxinshi.com |
ApiKey |
API Key(请求头 X-Xrxs-Api-Key,须脱敏) |
是 | - |
ApiSecret |
API Secret(HMAC-SHA256 签名用,须脱敏) | 是 | - |
HttpClientName |
命名 HttpClient 标识 | 否 | HumanResourcesXinrenxinshi |
注册服务
从 IConfiguration 绑定(推荐)
using Microsoft.Extensions.DependencyInjection;
builder.Services.AddXinrenxinshiHumanResources(
builder.Configuration.GetSection("HumanResources:Xinrenxinshi"));
委托配置
builder.Services.AddXinrenxinshiHumanResources(options =>
{
options.ApiBaseUrl = "https://api.xinrenxinshi.com";
options.ApiKey = "your-api-key";
options.ApiSecret = "your-api-secret";
});
注册后
IHumanResourcesService(ProviderName = Xinrenxinshi)可用,可通过IIntegrationProviderResolver<IHumanResourcesService>按供应商 ID(xinrenxinshi)解析。
使用示例
using Bitzsoft.Integrations.Core;
using Bitzsoft.Integrations.HumanResources;
public class EmployeeSyncService(IIntegrationProviderResolver<IHumanResourcesService> resolver)
{
public async Task<HrEmployee> CreateEmployeeAsync(string name, string email, CancellationToken ct)
{
var service = resolver.GetRequired("xinrenxinshi");
return await service.CreateEmployeeAsync(new CreateEmployeeRequest
{
Name = name,
Email = email
}, ct);
}
public async Task<HrResult> DeactivateAsync(string employeeId, CancellationToken ct)
{
var service = resolver.GetRequired("xinrenxinshi");
return await service.DeactivateEmployeeAsync(employeeId, ct);
}
public async Task<List<HrDepartment>> ListDepartmentsAsync(CancellationToken ct)
{
var service = resolver.GetRequired("xinrenxinshi");
return await service.ListDepartmentsAsync(ct);
}
}
IHumanResourcesService 方法 |
说明 |
|---|---|
CreateEmployeeAsync |
创建员工 |
GetEmployeeAsync |
按 ID 查询员工 |
UpdateEmployeeAsync |
更新员工信息 |
DeactivateEmployeeAsync |
停用(离职)员工(PUT 携带 status=2) |
ListEmployeesAsync |
分页查询员工列表(支持按部门 / 关键字 / 状态过滤) |
CreateDepartmentAsync |
创建部门 |
ListDepartmentsAsync |
查询部门列表 |
SubmitAttendanceAsync |
提交考勤记录 |
ListAttendanceRecordsAsync |
按日期范围查询考勤记录 |
依赖
| 包 | 说明 |
|---|---|
Bitzsoft.Integrations.HumanResources |
抽象层(IHumanResourcesService / 模型) |
Bitzsoft.Integrations.Core |
核心基础库 |
Bitzsoft.Integrations.Compatibility |
基础工具库 |
Bitzsoft.Integrations.RequestLogging |
出站请求审计 |
Microsoft.Extensions.Http |
IHttpClientFactory |
Microsoft.Extensions.Options.ConfigurationExtensions |
Options 配置绑定 |
相关包
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.2)
- Bitzsoft.Integrations.Core (>= 1.0.2)
- Bitzsoft.Integrations.HumanResources (>= 1.0.2)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.2)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
-
net5.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.2)
- Bitzsoft.Integrations.Core (>= 1.0.2)
- Bitzsoft.Integrations.HumanResources (>= 1.0.2)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.2)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 5.0.0)
-
net8.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.2)
- Bitzsoft.Integrations.Core (>= 1.0.2)
- Bitzsoft.Integrations.HumanResources (>= 1.0.2)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.2)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.HumanResources.Xinrenxinshi:
| Package | Downloads |
|---|---|
|
Bitzsoft.Integrations.HumanResources.All
人力资源服务聚合包 — 包含全部供应商实现(Moka / 薪人薪事) |
GitHub repositories
This package is not used by any popular GitHub repositories.