修改了http服务器无法正确处理post请求入参;添加了modbus tcp客户端支持。

This commit is contained in:
fengjiayi
2025-07-23 15:57:57 +08:00
parent acf0b87ad0
commit 4e20e816ae
24 changed files with 2466 additions and 189 deletions

View File

@@ -92,7 +92,7 @@ namespace Serein.Library.Web
{
if (!controllerType.IsClass || controllerType.IsAbstract) return; // 如果不是类或者是抽象类,则直接返回
var autoHostingAttribute = controllerType.GetCustomAttribute<AutoHostingAttribute>();
var autoHostingAttribute = controllerType.GetCustomAttribute<WebApiControllerAttribute>();
var methods = controllerType.GetMethods().Where(m => m.GetCustomAttribute<WebApiAttribute>() != null).ToArray();
@@ -264,7 +264,7 @@ namespace Serein.Library.Web
/// <param name="controllerType">控制器类型</param>
/// <param name="method">方法信息</param>
/// <returns>方法对应的urk</returns>
private string AddRoutesUrl(AutoHostingAttribute autoHostingAttribute, WebApiAttribute webAttribute, Type controllerType, MethodInfo method)
private string AddRoutesUrl(WebApiControllerAttribute autoHostingAttribute, WebApiAttribute webAttribute, Type controllerType, MethodInfo method)
{
string controllerName;
if (string.IsNullOrWhiteSpace(autoHostingAttribute.Url))