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" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.HumanResources.Xinrenxinshi" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.HumanResources.Xinrenxinshi&version=1.0.2
                    
Install as a Cake Tool

Bitzsoft.Integrations.HumanResources.Xinrenxinshi

薪人薪事人力资源服务实现,实现 IHumanResourcesService 统一接口。

功能特性

  • 员工全生命周期:创建、查询、更新、停用(离职)、分页列表查询
  • 部门管理:创建部门、查询部门列表
  • 考勤管理:提交考勤、按日期范围查询考勤记录
  • API Key + HMAC-SHA256 签名鉴权:请求头携带 X-Xrxs-Api-KeyX-Xrxs-TimestampX-Xrxs-NonceX-Xrxs-Signature,签名逐请求生成
  • 统一接口:实现 IHumanResourcesServiceProviderName 返回薪人薪事供应商标识
  • 配置校验:注册时通过 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";
});

注册后 IHumanResourcesServiceProviderName = 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 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.

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.

Version Downloads Last Updated
1.0.2 123 8/29/2026
1.0.1 143 8/3/2026
1.0.0 139 8/2/2026