[]
当在服务器端执行实现了ICommandExecutableInServerSide接口的命令时,从服务器端传递的上下文信息。
public interface IServerCommandExecuteContext
应用的Base Url。
string AppBaseUrl { get; }
| 类型 | 描述 |
|---|---|
| string |
应用的目录
string AppFolder { get; }
| 类型 | 描述 |
|---|---|
| string |
应用的本地Base Url。
string AppLocalBaseUrl { get; }
| 类型 | 描述 |
|---|---|
| string |
缓存服务
ICacheService CacheService { get; }
| 类型 | 描述 |
|---|---|
| ICacheService |
返回IOwinContext类的实例。
HttpContext Context { get; }
| 类型 | 描述 |
|---|---|
| Microsoft.AspNetCore.Http.HttpContext |
服务端命令的名称。
string CurrentServerCommandName { get; }
| 类型 | 描述 |
|---|---|
| string |
当前登陆用户名称
[Obsolete("Please use GetCurrentUserNameAsync() instead")]
string CurrentUserName { get; }
| 类型 | 描述 |
|---|---|
| string |
用于操作数据库的上下文信息。
IDataAccess DataAccess { get; }
| 类型 | 描述 |
|---|---|
| IDataAccess |
用于导出页面的上下文信息。
IExportHelper ExportHelper { get; }
| 类型 | 描述 |
|---|---|
| IExportHelper |
用于记录日志的上下文环境。
ILog Log { get; }
| 类型 | 描述 |
|---|---|
| ILog |
当前上下文中可用参数。
IDictionary<string, object> Parameters { get; }
| 类型 | 描述 |
|---|---|
| System.Collections.Generic.IDictionary<TKey, TValue><string, object> |
服务提供者
IServiceProvider ServiceProvider { get; }
| 类型 | 描述 |
|---|---|
| System.IServiceProvider |
用于操作用户的上下文环境。
IUserInfos UserInfos { get; }
| 类型 | 描述 |
|---|---|
| IUserInfos |
计算公式的工具方法,返回公式的计算结果。
[Obsolete("EvaluateFormula is deprecated, please use EvaluateFormulaAsync instead")]
object EvaluateFormula(object value)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | value | 原始公式字符串。 |
| 类型 | 描述 |
|---|---|
| object | 公式的计算结果。 |
计算公式的工具方法,返回公式的计算结果。
Task<object> EvaluateFormulaAsync(object value)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | value | 原始公式字符串。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><object> | 公式的计算结果。 |
计算字符串中的公式,如 aaa,[=参数1],bbb 假设‘参数1’的值为ccc则计算结果为 aaa,ccc,bbb
Task<object> EvaluateFormulaInContentAsync(object value, Dictionary<string, object> formulaValues)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | value | 原始公式字符串。 |
| System.Collections.Generic.Dictionary<TKey, TValue><string, object> | formulaValues | 用于缓存公式计算结果。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><object> | 公式的计算结果。 |
计算查询条件的工具方法,返回查询条件的计算结果。
[Obsolete("EvaluateQueryConditionValueFormula is deprecated, please use EvaluateQueryConditionValueFormulaAsync instead")]
object EvaluateQueryConditionValueFormula(object queryCondition)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | queryCondition | 原始查询条件。 |
| 类型 | 描述 |
|---|---|
| object | 查询条件的计算结果。 |
计算查询条件的工具方法,返回查询条件的计算结果。
Task<object> EvaluateQueryConditionValueFormulaAsync(object queryCondition, NullFormulaValueQueryPolicy nullFormulaValueQueryPolicy)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | queryCondition | 原始查询条件。 |
| NullFormulaValueQueryPolicy | nullFormulaValueQueryPolicy | 公式计算值为空时查询策略。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><object> | 查询条件的计算结果。 |
计算查询条件的工具方法,返回查询条件的计算结果。
Task<object> EvaluateQueryConditionValueFormulaAsync(object queryCondition)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | queryCondition | 原始查询条件。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><object> | 查询条件的计算结果。 |
执行命令列表并返回执行结果。
ExecuteResult ExecuteCommands(List<Command> commands)
| 类型 | 名称 | 描述 |
|---|---|---|
| System.Collections.Generic.List<T><Command> | commands | 待执行命令列表。 |
| 类型 | 描述 |
|---|---|
| ExecuteResult | 命令执行结果。 |
执行命令列表并返回执行结果。
Task<ExecuteResult> ExecuteCommandsAsync(List<Command> commands)
| 类型 | 名称 | 描述 |
|---|---|---|
| System.Collections.Generic.List<T><Command> | commands | 待执行命令列表。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><ExecuteResult> | 命令执行结果。 |
执行自定义命令对象列表。
Task<ExecuteResult> ExecuteCustomCommandObjectAsync(object command, Dictionary<string, object> initParams, string commandLogDisplayName = null)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | command | 命令。 |
| System.Collections.Generic.Dictionary<TKey, TValue><string, object> | initParams | 上下文参数值。 |
| string | commandLogDisplayName | 执行日志中显示的命令名称。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><ExecuteResult> | 命令执行结果。 |
执行mcp tool
Task<IEnumerable<ExecuteMCPToolResponse>> ExecuteMcpToolAsync(string toolName, Dictionary<string, object> param)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | toolName | mcp tool名称 用双下划线分割mcp工具和具体函数,如:baiduMcp__aiSearch |
| System.Collections.Generic.Dictionary<TKey, TValue><string, object> | param | mcp tool参数 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><System.Collections.Generic.IEnumerable<T><ExecuteMCPToolResponse>> | mcp tool执行结果 |
执行服务端命令列表并返回执行结果。
ExecuteResult ExecuteServerCommands(string serverCommandName, IServerCommandExecuteContext dataContext)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | serverCommandName | 服务端命令的名称。 |
| IServerCommandExecuteContext | dataContext | 执行服务端命令的上下文。 |
| 类型 | 描述 |
|---|---|
| ExecuteResult |
执行服务端命令列表并返回执行结果。
Task<ExecuteResult> ExecuteServerCommandsAsync(string serverCommandName, IServerCommandExecuteContext dataContext)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | serverCommandName | 服务端命令的名称。 |
| IServerCommandExecuteContext | dataContext | 执行服务端命令的上下文。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><ExecuteResult> |
获取数据库数据。
Task<object> GetBindingDataSourceValueAsync(object bindingDataSource)
| 类型 | 名称 | 描述 |
|---|---|---|
| object | bindingDataSource | 数据库查询对象,标注了BindingDataSourcePropertyAttribute属性的值 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><object> | 数据库查询结果 |
当前登陆用户名称
Task<string> GetCurrentUserNameAsync()
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><string> |
调用该方法可以异步发送OpenAI请求。
Task<AIResponse> OpenAICallAsync(OpenAICallRequestParams param)
| 类型 | 名称 | 描述 |
|---|---|---|
| OpenAICallRequestParams | param | OpenAI请求参数 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><AIResponse> | OpenAI请求的输出结果 |
调用该方法可以异步发送流式输出的OpenAI请求。
IAsyncEnumerable<AIResponse> OpenAICallStreamingAsync(OpenAICallRequestParams param)
| 类型 | 名称 | 描述 |
|---|---|---|
| OpenAICallRequestParams | param | OpenAI请求参数 |
| 类型 | 描述 |
|---|---|
| System.Collections.Generic.IAsyncEnumerable<T><AIResponse> | OpenAI请求的流式输出结果 |
更换邮件中相关属性关键字的工具方法,返回更换过关键字后的字符串。
[Obsolete("ReplaceKeyWord is deprecated, please use ReplaceKeyWordAsync instead")]
string ReplaceKeyWord(string value)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | value | 原始字符串。 |
| 类型 | 描述 |
|---|---|
| string | 返回更换过关键字后的字符串。 |
更换邮件中相关属性关键字的工具方法,返回更换过关键字后的字符串。
Task<string> ReplaceKeyWordAsync(string value)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | value | 原始字符串。 |
| 类型 | 描述 |
|---|---|
| System.Threading.Tasks.Task<TResult><string> | 返回更换过关键字后的字符串。 |
调用该方法可以异步发送邮件。
string SendMail(string fromAddress, List<string> toList, string title, string content)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | fromAddress | 发送人邮件地址(可以使用用户名) |
| System.Collections.Generic.List<T><string> | toList | 收件人列表(可以使用用户名) |
| string | title | 标题 |
| string | content | 邮件正文 |
| 类型 | 描述 |
|---|---|
| string | 如果有非空返回值表示邮件发送失败 |