2026-02-04 20:40:22 +08:00
|
|
|
|
namespace OpenAuth.WebApi.Controllers.ServerController;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统一API返回结果
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
|
public class ApiResult<T>
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool Success { get; set; }
|
|
|
|
|
|
public string Message { get; set; }
|
|
|
|
|
|
public T Data { get; set; }
|
|
|
|
|
|
public int TotalCount { get; set; } // 分页总条数
|
|
|
|
|
|
|
|
|
|
|
|
public static ApiResult<T> Ok(T data, int totalCount = 0, string message = "操作成功")
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ApiResult<T>
|
|
|
|
|
|
{
|
|
|
|
|
|
Success = true,
|
|
|
|
|
|
Message = message,
|
|
|
|
|
|
Data = data,
|
|
|
|
|
|
TotalCount = totalCount
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static ApiResult<T> Error(string message = "操作失败")
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ApiResult<T>
|
|
|
|
|
|
{
|
|
|
|
|
|
Success = false,
|
|
|
|
|
|
Message = message,
|
|
|
|
|
|
Data = default(T),
|
|
|
|
|
|
TotalCount = 0
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-05 09:08:32 +08:00
|
|
|
|
// 通用分页输入
|
|
|
|
|
|
public class PageInput
|
2026-02-04 20:40:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
public int PageIndex { get; set; } = 1;
|
|
|
|
|
|
public int PageSize { get; set; } = 10;
|
2026-02-05 09:08:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 通用分页输出
|
|
|
|
|
|
public class PageOutput<T>
|
|
|
|
|
|
{
|
|
|
|
|
|
public int PageIndex { get; set; }
|
|
|
|
|
|
public int PageSize { get; set; }
|
|
|
|
|
|
public long TotalCount { get; set; }
|
|
|
|
|
|
public int TotalPages { get; set; }
|
|
|
|
|
|
public List<T> Data { get; set; } = new List<T>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 发起流程请求
|
|
|
|
|
|
public class InitiateFlowRequest
|
|
|
|
|
|
{
|
|
|
|
|
|
public string FlowCode { get; set; } = string.Empty;
|
|
|
|
|
|
public string BusinessNo { get; set; } = string.Empty;
|
|
|
|
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
|
|
public List<IFormFile>? Attachments { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 处理工作项请求
|
|
|
|
|
|
public class HandleWorkitemRequest
|
|
|
|
|
|
{
|
|
|
|
|
|
public long WorkitemId { get; set; }
|
|
|
|
|
|
public string? Comment { get; set; }
|
|
|
|
|
|
public string? AuditResult { get; set; } // Pass/Reject
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 工作项查询结果(拟办/待办/已办)
|
|
|
|
|
|
public class FlowQueryResult
|
|
|
|
|
|
{
|
|
|
|
|
|
public long InstanceId { get; set; }
|
|
|
|
|
|
public string BusinessNo { get; set; } = string.Empty;
|
|
|
|
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
|
|
public string NodeName { get; set; } = string.Empty;
|
|
|
|
|
|
public string Status { get; set; } = string.Empty;
|
|
|
|
|
|
public DateTime? CreateTime { get; set; }
|
|
|
|
|
|
public string InitiatorName { get; set; } = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 流程实例查询结果(未办结/已完成)
|
|
|
|
|
|
public class FlowInstanceQueryResult
|
|
|
|
|
|
{
|
|
|
|
|
|
public long InstanceId { get; set; }
|
|
|
|
|
|
public string BusinessNo { get; set; } = string.Empty;
|
|
|
|
|
|
public string FlowName { get; set; } = string.Empty;
|
|
|
|
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
|
|
public string CurrentNodeName { get; set; } = string.Empty;
|
|
|
|
|
|
public string Status { get; set; } = string.Empty;
|
|
|
|
|
|
public string InitiatorName { get; set; } = string.Empty;
|
|
|
|
|
|
public DateTime? CreateTime { get; set; }
|
|
|
|
|
|
public DateTime? FinishTime { get; set; }
|
2026-02-04 20:40:22 +08:00
|
|
|
|
}
|