minimal api 测试准备

This commit is contained in:
2024-10-15 13:16:09 +08:00
parent a3ec9618ed
commit 67e09bbf66
5 changed files with 126 additions and 50 deletions
+14 -26
View File
@@ -2,42 +2,30 @@
using IRaCIS.Core.Application.Service.BusinessFilter;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Panda.DynamicWebApi;
using Panda.DynamicWebApi.Attributes;
using System.Diagnostics.CodeAnalysis;
namespace IRaCIS.Core.Application.Service
namespace IRaCIS.Core.Application.Service;
[TypeFilter(typeof(UnifiedApiResultFilter))]
[Authorize, DynamicWebApi]
public class BaseService : IDynamicWebApi
{
#pragma warning disable CS8618
#region
[TypeFilter(typeof(UnifiedApiResultFilter))]
[Authorize, DynamicWebApi]
public class BaseService : IBaseService, IDynamicWebApi
public static IResponseOutput Null404NotFound<TEntity>(TEntity? businessObject) where TEntity : class
{
public static IResponseOutput Null404NotFound<TEntity>(TEntity? businessObject) where TEntity : class
{
return new ResponseOutput<string>()
.NotOk($"The query object {typeof(TEntity).Name} does not exist , or was deleted by someone else, or an incorrect parameter query caused", code: ApiResponseCodeEnum.DataNotExist);
}
return new ResponseOutput<string>()
.NotOk($"The query object {typeof(TEntity).Name} does not exist , or was deleted by someone else, or an incorrect parameter query caused", code: ApiResponseCodeEnum.DataNotExist);
}
public interface IBaseService
{
}
#endregion
}