3 Commits
4402e4fbc9
...
d4c5d4d3c0
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
d4c5d4d3c0 |
Apewer-6.8.7
|
6 months ago |
|
|
38e00f5cb8 |
增加 SqlClient,用于查询正在执行的语句。
|
6 months ago |
|
|
38cae76108 |
AddMiddleware 增加重载,支持匿名方法。
|
6 months ago |
7 changed files with 172 additions and 14 deletions
-
49Apewer.Source/Source/ExecutingStatement.cs
-
59Apewer.Source/Source/SqlClient.cs
-
2Apewer/Apewer.props
-
16Apewer/Web/ApiInvoker.cs
-
28Apewer/Web/ApiMiddleware.cs
-
26Apewer/Web/ApiProcessor.cs
-
6ChangeLog.md
@ -0,0 +1,49 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Apewer.Source |
||||
|
{ |
||||
|
|
||||
|
/// <summary>正在执行的 SQL 语句。</summary>
|
||||
|
[Serializable] |
||||
|
public sealed class ExecutingStatement |
||||
|
{ |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public long Session { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public string Status { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public long CpuTime { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public long LogicalReads { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public long Reads { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public long Writes { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public double ElapsedTime { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public string StatementText { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public string LoginName { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public string HostName { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public DateTime LoginTime { get; set; } |
||||
|
|
||||
|
/// <summary></summary>
|
||||
|
public long OpenTransactionCount { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Apewer.Web |
||||
|
{ |
||||
|
|
||||
|
internal class ApiMiddleware |
||||
|
{ |
||||
|
|
||||
|
internal Type Type; |
||||
|
internal Action<ApiContext, Action> Callback; |
||||
|
|
||||
|
public ApiMiddleware(Type type) |
||||
|
{ |
||||
|
if (!typeof(IApiMiddleware).IsAssignableFrom(type)) throw new NotImplementedException($"类型【{type.FullName}】未实现【{nameof(IApiMiddleware)}】。"); |
||||
|
Type = type; |
||||
|
} |
||||
|
|
||||
|
public ApiMiddleware(Action<ApiContext, Action> callback) |
||||
|
{ |
||||
|
if (callback == null) throw new ArgumentNullException(nameof(callback)); |
||||
|
Callback = callback; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue