sunpengfei
2025-08-13 59afa0eaecc1daf07128aa2fd02df238c9854d4c
FlexJobApi.Core/Utils/ResourceUtils/ResourceModel.cs
@@ -1,7 +1,9 @@
using System;
using Furion.FriendlyException;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
@@ -15,9 +17,44 @@
        public string TraceId { get; set; }
        /// <summary>
        /// 微服务
        /// 应用名称
        /// </summary>
        public string Service { get; set; }
        public string ApplicationName { get; set; }
        /// <summary>
        /// 动态程序集名称
        /// </summary>
        public string DynamicAssemblyName { get; set; }
        /// <summary>
        /// 服务
        /// </summary>
        public EnumResourceService Service { get; set; }
        /// <summary>
        /// 服务名称
        /// </summary>
        public string ServiceName { get; set; }
        /// <summary>
        /// 控制器
        /// </summary>
        public EnumResourceController Controller { get; set; }
        /// <summary>
        /// 控制器摘要
        /// </summary>
        public string ControllerSummary { get; set; }
        /// <summary>
        /// 委托名称
        /// </summary>
        public string ActionName { get; set; }
        /// <summary>
        /// 委托摘要
        /// </summary>
        public string ActionSummary { get; set; }
        /// <summary>
        /// 编号
@@ -30,9 +67,19 @@
        public string Name { get; set; }
        /// <summary>
        /// 忽略权限
        /// </summary>
        public bool AllowAnonymous { get; set; }
        /// <summary>
        /// 请求方式
        /// </summary>
        public EnumWebApiMethod Method { get; set; }
        public EnumResourceMethod Method { get; set; }
        /// <summary>
        /// 路由区域
        /// </summary>
        public string RouteArea { get; set; }
        /// <summary>
        /// 路由
@@ -45,8 +92,35 @@
        public string RequestTypeName { get; set; }
        /// <summary>
        /// 请求类型全名
        /// </summary>
        public string RequestTypeFullName { get; set; }
        /// <summary>
        /// 响应类型名称
        /// </summary>
        public string ResponseTypeName { get; set; }
        /// <summary>
        /// 响应类型全名
        /// </summary>
        public string ResponseTypeFullName { get; set; }
        public HttpMethod GetHttpMethod()
        {
            switch (Method)
            {
                case EnumResourceMethod.Get:
                    return HttpMethod.Get;
                case EnumResourceMethod.Post:
                    return HttpMethod.Post;
                case EnumResourceMethod.Put:
                    return HttpMethod.Put;
                case EnumResourceMethod.Delete:
                    return HttpMethod.Delete;
                default:
                    throw Oops.Oh(EnumErrorCodeType.s400, "不支持的请求类型");
            }
        }
    }
}