diff --git a/src/Yi.Framework/Yi.Framework.Application/Student/StudentService.cs b/src/Yi.Framework/Yi.Framework.Application/Student/StudentService.cs index 48e590ed..2e896389 100644 --- a/src/Yi.Framework/Yi.Framework.Application/Student/StudentService.cs +++ b/src/Yi.Framework/Yi.Framework.Application/Student/StudentService.cs @@ -1,6 +1,4 @@ -using Panda.DynamicWebApi; -using Panda.DynamicWebApi.Attributes; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,14 +6,16 @@ using System.Threading.Tasks; using Yi.Framework.Application.Contracts.Student; using Yi.Framework.Domain.Student; using Yi.Framework.Domain.Student.IRepository; +using Microsoft.AspNetCore.Mvc; +using NET.AutoWebApi.Setting; +using Microsoft.AspNetCore.Http; namespace Yi.Framework.Application.Student { /// /// 服务实现 /// - [DynamicWebApi] - public class StudentService : IStudentService, IDynamicWebApi + public class StudentService : IStudentService, IAutoApiService { private readonly IStudentRepository _studentRepository; private readonly StudentManager _studentManager; @@ -24,8 +24,10 @@ namespace Yi.Framework.Application.Student _studentRepository = studentRepository; _studentManager = studentManager; } - public string GetShijie() + + public string PostShijie(IFormFile formFile) { + var ss = formFile; return "你好世界"; } } diff --git a/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj b/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj index 91843c46..b7d607f3 100644 --- a/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj +++ b/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Yi.Framework/Yi.Framework.Web/Program.cs b/src/Yi.Framework/Yi.Framework.Web/Program.cs index bc8b21b5..0a0554e9 100644 --- a/src/Yi.Framework/Yi.Framework.Web/Program.cs +++ b/src/Yi.Framework/Yi.Framework.Web/Program.cs @@ -1,6 +1,5 @@ using AspNetCore.Microsoft.AspNetCore.Builder; -using Panda.DynamicWebApi; using System.Reflection; using Yi.Framework.Application; using Yi.Framework.Application.Contracts; @@ -40,7 +39,11 @@ builder.Host.UseAutoFacServerProviderFactory(); //ӿ붯̬api builder.Services.AddControllers(); -builder.Services.AddDynamicWebApi(); +builder.Services.AddAutoApiService(opt => +{ + //NETServiceTestڳӽ̬api + opt.CreateConventional(typeof(YiFrameworkApplicationModule).Assembly); +}); //swagger builder.Services.AddSwaggerServer(); @@ -59,6 +62,9 @@ app.UseHttpsRedirection(); app.UseAuthorization(); app.UseRouting(); + +//ʹö̬api +app.UseAutoApiService(); app.MapControllers(); app.Run();