sunpengfei
2025-08-08 2da5c6be190d8078393eb2df777863931218ad19
FlexJobApi.Core/Entities/Common/Resource.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;
@@ -113,5 +115,22 @@
        /// 是否已过期
        /// </summary>
        public bool IsExpired { 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, "不支持的请求类型");
            }
        }
    }
}