sunpengfei
2025-08-19 6031dcc190be45f33c7e161c05e92ff0e4f07562
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;
@@ -20,9 +22,19 @@
        public string ApplicationName { get; set; }
        /// <summary>
        /// 路由区域
        /// 动态程序集名称
        /// </summary>
        public string RouteArea { get; set; }
        public string DynamicAssemblyName { get; set; }
        /// <summary>
        /// 服务
        /// </summary>
        public EnumResourceService Service { get; set; }
        /// <summary>
        /// 服务名称
        /// </summary>
        public string ServiceName { get; set; }
        /// <summary>
        /// 控制器
@@ -38,6 +50,11 @@
        /// 委托名称
        /// </summary>
        public string ActionName { get; set; }
        /// <summary>
        /// 委托摘要
        /// </summary>
        public string ActionSummary { get; set; }
        /// <summary>
        /// 编号
@@ -58,6 +75,16 @@
        /// 请求方式
        /// </summary>
        public EnumResourceMethod Method { get; set; }
        /// <summary>
        /// 文件上传
        /// </summary>
        public bool FileUpload { get; set; }
        /// <summary>
        /// 路由区域
        /// </summary>
        public string RouteArea { get; set; }
        /// <summary>
        /// 路由
@@ -83,5 +110,22 @@
        /// 响应类型全名
        /// </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, "不支持的请求类型");
            }
        }
    }
}