Bitzsoft.Integrations.Ticketing 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bitzsoft.Integrations.Ticketing --version 1.0.0
                    
NuGet\Install-Package Bitzsoft.Integrations.Ticketing -Version 1.0.0
                    
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.Ticketing" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.Ticketing" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.Ticketing" />
                    
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.Ticketing --version 1.0.0
                    
#r "nuget: Bitzsoft.Integrations.Ticketing, 1.0.0"
                    
#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.Ticketing@1.0.0
                    
#: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.Ticketing&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.Ticketing&version=1.0.0
                    
Install as a Cake Tool

Bitzsoft.Integrations.Ticketing

工单系统(ITSM)抽象层 — 统一接口定义、基础模型与结果包装。

屏蔽 Zendesk、禅道 Zentao、Freshdesk、ServiceNow 等供应商差异,提供一致的工单创建、查询、更新、分配、状态变更、评论与列表查询 API。

功能特性

  • 统一供应商接口 ITicketService:8 个异步方法覆盖工单全生命周期
  • 统一结果包装TicketingResult 携带成功标志与错误信息
  • 统一异常 TicketingException:封装供应商标识、错误码与请求 ID
  • 不可变模型设计:集合返回 List<T>,属性使用 init 保证只读

安装

dotnet add package Bitzsoft.Integrations.Ticketing
<PackageReference Include="Bitzsoft.Integrations.Ticketing" Version="1.0.0" />

接口

ITicketService

统一的工单系统供应商接口。

方法 返回类型 说明
ProviderName string 供应商标识(如 ZendeskZentao
CreateTicketAsync Task<TicketInfo> 创建工单,返回工单信息
GetTicketAsync Task<TicketInfo> 查询单个工单详情
UpdateTicketAsync Task<TicketingResult> 更新工单信息
AssignTicketAsync Task<TicketingResult> 分配工单给处理人
ChangeStatusAsync Task<TicketingResult> 变更工单状态
AddCommentAsync Task<TicketingResult> 添加工单评论/回复
ListTicketsAsync Task<List<TicketInfo>> 分页查询工单列表

注意:ServiceNow 实现为只读,写操作(创建/更新/分配/变更状态/评论)将抛出 NotSupportedException

核心模型

关键字段 说明
CreateTicketRequest SubjectDescriptionRequesterEmailRequesterNamePriorityTags 创建工单请求
UpdateTicketRequest TicketIdSubjectDescriptionPriority 更新工单请求
ListTicketsRequest StatusAssigneeIdPageIndexPageSize 工单列表查询参数
TicketInfo TicketIdSubjectDescriptionStatusPriorityRequesterAssigneeTagsCreatedAtUpdatedAt 工单信息
TicketingResult SuccessErrorMessage 操作结果
TicketingException 统一异常(继承 IntegrationException

枚举

枚举 说明
TicketStatus 工单状态:New / Open / Pending / Resolved / Closed
TicketPriority 工单优先级:Low / Normal / High / Urgent

使用示例

抽象层本身只定义接口与模型,具体实现由各供应商包提供。以下示例假设已注册某个供应商实现:

public class HelpDeskService(ITicketService ticketing)
{
    public async Task<string> OpenTicketAsync(string subject, string email)
    {
        var ticket = await ticketing.CreateTicketAsync(new CreateTicketRequest
        {
            Subject = subject,
            Description = "无法登录系统",
            RequesterEmail = email,
            Priority = TicketPriority.High
        });
        return ticket.TicketId;
    }

    public Task<List<TicketInfo>> GetOpenTicketsAsync()
        => ticketing.ListTicketsAsync(new ListTicketsRequest { Status = TicketStatus.Open });
}

多供应商解析

同一应用注册多个供应商时,通过 IIntegrationProviderResolver<ITicketService> 按供应商 ID 解析:

var resolver = serviceProvider.GetRequiredService<IIntegrationProviderResolver<ITicketService>>();
var zendesk = resolver.GetRequired("zendesk");
var ticket = await zendesk.CreateTicketAsync(request);

依赖

相关包

供应商 包名
统一抽象 Bitzsoft.Integrations.Ticketing
Zendesk Bitzsoft.Integrations.Ticketing.Zendesk
禅道 Zentao Bitzsoft.Integrations.Ticketing.Zentao
Freshdesk Bitzsoft.Integrations.Ticketing.Freshdesk
ServiceNow Bitzsoft.Integrations.Ticketing.ServiceNow
聚合包 Bitzsoft.Integrations.Ticketing.All
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 (5)

Showing the top 5 NuGet packages that depend on Bitzsoft.Integrations.Ticketing:

Package Downloads
Bitzsoft.Integrations.Ticketing.Zendesk

Zendesk 工单系统实现 — Basic Auth(email/token:apiToken)鉴权 + HttpClient,实现 ITicketService 统一接口,支持工单创建/查询/更新/分配/状态变更/评论

Bitzsoft.Integrations.Ticketing.Freshdesk

Freshdesk 工单系统实现 — HTTP Basic Auth(api_key:x,密码为空)鉴权 + HttpClient,实现 ITicketService 统一接口,支持工单创建/查询/更新/分配/状态变更/评论/列表

Bitzsoft.Integrations.Ticketing.Zentao

禅道 Zentao 工单系统实现 — Session Token 鉴权(POST /tokens 换 token)+ HttpClient,实现 ITicketService 统一接口,支持工单(bug/task)创建/查询/更新/分配/状态变更/评论

Bitzsoft.Integrations.Ticketing.All

工单系统服务聚合包 — 包含全部供应商实现(Zendesk / 禅道 Zentao / Freshdesk)

Bitzsoft.Integrations.Ticketing.ServiceNow

ServiceNow 工单系统适配器 — 委托 Bitzsoft.Integrations.ServiceNow 单体的只读 Incident client,实现 ITicketService 统一接口,支持工单查询/列表(写入操作抛 NotSupportedException)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 244 8/3/2026
1.0.0 231 8/2/2026