LuBan.Qingflow 2026.7.31.1

dotnet add package LuBan.Qingflow --version 2026.7.31.1
                    
NuGet\Install-Package LuBan.Qingflow -Version 2026.7.31.1
                    
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="LuBan.Qingflow" Version="2026.7.31.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LuBan.Qingflow" Version="2026.7.31.1" />
                    
Directory.Packages.props
<PackageReference Include="LuBan.Qingflow" />
                    
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 LuBan.Qingflow --version 2026.7.31.1
                    
#r "nuget: LuBan.Qingflow, 2026.7.31.1"
                    
#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 LuBan.Qingflow@2026.7.31.1
                    
#: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=LuBan.Qingflow&version=2026.7.31.1
                    
Install as a Cake Addin
#tool nuget:?package=LuBan.Qingflow&version=2026.7.31.1
                    
Install as a Cake Tool

English | 中文

LuBan.Qingflow

作者: yswenli | 联系邮箱: yswenli@outlook.com | 代码仓库: https://github.com/yswenli/luban-framework

轻流 Open API 一站式客户端——应用数据、审批流程、用户管理、报表图表,一个类全部搞定。


Related Projects: LuBan.Framework | LuBan.Common | LuBan.Web.Core


为什么选择 LuBan.Qingflow?

轻流(Qingflow)是低代码平台,通过 Open API 可以与外部系统深度集成。但官方 API 文档分散、Token 管理繁琐、分页查询需要手动循环……
LuBan.Qingflow 封装了完整的轻流 API 客户端,自动管理 AccessToken 缓存与刷新,支持泛型数据映射,让你用 C# 对象直接操作轻流数据。


快速预览

// 获取轻流客户端(单例,自动从配置读取参数)
var client = OpenApiClient.Instance;

// 获取应用数据列表
var result = await client.GetAppDataListAsync(new GetAppDataListInput
{
    AppId = "your_app_id",
    PageIndex = 1,
    PageSize = 50
});

// 获取强类型数据
var orders = await client.GetPagedModelListAsync<OrderModel>(new GetAppDataListInput
{
    AppId = "your_app_id",
    PageIndex = 1,
    PageSize = 50
});

技术栈 & 依赖

类别 组件 说明
运行时 .NET 8.0
框架依赖 LuBan.Common LuBan 基础组件(HTTP、缓存、序列化等)

安装

dotnet add package LuBan.Qingflow

配置

appsettings.json 或 配置中心添加:

{
  "QingflowOptions": {
    "Domain": "https://api.qingflow.com",
    "WorkspaceId": "your_workspace_id",
    "WorkspaceSecret": "your_workspace_secret",
    "SuperAdminToken": "your_super_admin_token"
  }
}
字段 说明
Domain 轻流 API 域名(公有云/私有云/钉钉等)
WorkspaceId 工作区 ID
WorkspaceSecret 工作区密钥(AccessToken/Secret)
SuperAdminToken 超级管理员 Token(用于获取应用列表等管理操作)

功能全景

核心类

说明
OpenApiClient 轻流 API 客户端(单例,~825 行),封装全部 API 调用
QingflowOptions 配置类:域名、工作区、密钥、应用列表
QingflowAppOptions 轻流应用配置(AppId + AppName)

API 能力矩阵

功能域 方法 说明
应用管理 GetAppListAsync() 获取应用列表(需超管 Token)
应用数据 GetAppDataListAsync(input) 获取应用数据列表(支持分页、过滤、全量拉取)
GetAppDataByIdAsync(appDataId) 获取单条数据详情
GetTitleValueCollectionListAsync(input) 获取数据列表(标题-值集合格式)
GetTitleValueCollectionByIdAsync(appDataId) 获取单条数据(标题-值集合格式)
GetModelByIdAsync<T>(appDataId) 获取单条数据(强类型泛型)
GetPagedModelListAsync<T>(input) 获取分页数据列表(强类型泛型)
DeleteAppDataAsync(input) 删除应用数据
日期范围 GetLastestAppDataAsync(input) 按日期范围获取数据
GetLastestModelAsync<T>(input) 按日期范围获取数据(强类型)
表格数据 GetModelListForTabletAsync<T>(input) 获取表格子表数据
GetModelListWithTableDataAsync<T1, T2>(input) 获取主表 + 子表关联数据
审批流程 GetAuditFlowListAsync(dataId) 获取数据审批流程列表
GetLatestAuditFlowAsync(dataId, nodeName) 获取最新审批状态
用户管理 GetUserAsync(userId) 获取用户信息
报表图表 GetChartDataAsync(input) 获取报表图表数据
GetChartDataByDatetimeAsync(input) 按日期范围获取图表数据
患者数据 GetPatientRegistInfosAsync(input) 获取患者注册信息
GetAppDataByIdCardAsync(input) 按身份证查询数据
GetModelByIdCardAsync<T>(input) 按身份证查询数据(强类型)

代码示例

基本使用

// 初始化客户端(自动从 Nacos/appsettings 读取配置)
var client = OpenApiClient.Instance;

// 或手动指定配置
var client = new OpenApiClient(new QingflowOptions
{
    Domain = "https://api.qingflow.com",
    WorkspaceId = "ws_001",
    WorkspaceSecret = "secret_xxx",
    SuperAdminToken = "admin_token_xxx"
});

获取应用数据(强类型)

// 定义数据模型(实现 IAppData 接口)
public class OrderModel : IAppData
{
    public long AppDataId { get; set; }
    public string OrderNo { get; set; }
    public decimal Amount { get; set; }
    public string CustomerName { get; set; }
}

// 分页查询
var result = await client.GetPagedModelListAsync<OrderModel>(new GetAppDataListInput
{
    AppId = "app_001",
    PageIndex = 1,
    PageSize = 50,
    Queries = new List<AppDataQuery>
    {
        new AppDataQuery { QueId = 1, SearchKey = "关键词" }
    }
});

foreach (var order in result.Result.Result)
{
    Console.WriteLine($"{order.OrderNo}: {order.Amount}");
}

全量拉取数据

// IsAll = true 自动翻页,拉取全部数据
var result = await client.GetAppDataListAsync(new GetAppDataListInput
{
    AppId = "app_001",
    PageIndex = 1,
    PageSize = 100,
    IsAll = true
});

Console.WriteLine($"共获取 {result.Result.Result.Count} 条数据");

按日期范围查询

var data = await client.GetLastestAppDataAsync(new GetLastestAppDataInput
{
    AppId = "app_001",
    FromDateTime = DateTime.Parse("2026-01-01"),
    ToDateTime = DateTime.Parse("2026-07-01"),
    PageIndex = 1,
    PageSize = 100,
    IsAll = true
});

查询审批流程状态

// 获取某条数据的审批流程
var flowInfo = await client.GetAuditFlowListAsync("data_id_xxx");

// 获取最新审批节点
var latest = await client.GetLatestAuditFlowAsync("data_id_xxx", nodeName: "经理审批");
if (latest != null)
{
    Console.WriteLine($"当前节点:{latest.AuditNodeName},状态:{latest.ApplyStatus}");
}

获取图表数据

var chartData = await client.GetChartDataAsync(new GetChartDataListInput
{
    ChartKey = "chart_001",
    Filter = new ChartDataListInputFilter
    {
        PageNum = 1,
        PageSize = 50
    }
});

删除数据

await client.DeleteAppDataAsync(new DeleteAppDataInput
{
    AppId = "app_001",
    AppDataId = 12345
});

小贴士

  1. Token 自动管理OpenApiClient 自动缓存 AccessToken,过期前 20 分钟自动刷新,无需手动处理
  2. Token 过期重试:当遇到错误码 49300(Token 失效)时,自动清除缓存并重试
  3. 全量拉取:设置 IsAll = true 可自动翻页,直到拉取全部数据
  4. 强类型映射:实现 IAppData 接口后,可直接用泛型方法获取 C# 对象
  5. 单例模式OpenApiClient.Instance 全局唯一,构造函数中自动加载应用列表
  6. 超管权限GetAppListAsync() 等管理接口需要 SuperAdminToken,普通 Token 无法调用

许可证

Copyright (c) yswenli. All Rights Reserved.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.7.31.1 0 7/31/2026
2026.7.30.1 36 7/30/2026
2026.7.29.1 59 7/29/2026
2026.7.23.1 96 7/23/2026
2026.7.22.1 89 7/21/2026
2026.7.21.2 92 7/21/2026
2026.7.21.1 91 7/21/2026
2026.7.17.1 94 7/17/2026
2026.7.13.2 94 7/13/2026
2026.7.13.1 90 7/13/2026
2026.7.12.2 96 7/12/2026
2026.7.12.1 93 7/12/2026
2026.7.11.2 91 7/11/2026

轻流api客户端