更改自动api
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
using Panda.DynamicWebApi;
|
using System;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -8,14 +6,16 @@ using System.Threading.Tasks;
|
|||||||
using Yi.Framework.Application.Contracts.Student;
|
using Yi.Framework.Application.Contracts.Student;
|
||||||
using Yi.Framework.Domain.Student;
|
using Yi.Framework.Domain.Student;
|
||||||
using Yi.Framework.Domain.Student.IRepository;
|
using Yi.Framework.Domain.Student.IRepository;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NET.AutoWebApi.Setting;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace Yi.Framework.Application.Student
|
namespace Yi.Framework.Application.Student
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务实现
|
/// 服务实现
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DynamicWebApi]
|
public class StudentService : IStudentService, IAutoApiService
|
||||||
public class StudentService : IStudentService, IDynamicWebApi
|
|
||||||
{
|
{
|
||||||
private readonly IStudentRepository _studentRepository;
|
private readonly IStudentRepository _studentRepository;
|
||||||
private readonly StudentManager _studentManager;
|
private readonly StudentManager _studentManager;
|
||||||
@@ -24,8 +24,10 @@ namespace Yi.Framework.Application.Student
|
|||||||
_studentRepository = studentRepository;
|
_studentRepository = studentRepository;
|
||||||
_studentManager = studentManager;
|
_studentManager = studentManager;
|
||||||
}
|
}
|
||||||
public string GetShijie()
|
|
||||||
|
public string PostShijie(IFormFile formFile)
|
||||||
{
|
{
|
||||||
|
var ss = formFile;
|
||||||
return "你好世界";
|
return "你好世界";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
|
||||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.1" />
|
<PackageReference Include="NET.AutoApi" Version="1.0.3" />
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.3.43" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.3.43" />
|
||||||
<PackageReference Include="StartupModules" Version="4.0.0" />
|
<PackageReference Include="StartupModules" Version="4.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
using AspNetCore.Microsoft.AspNetCore.Builder;
|
using AspNetCore.Microsoft.AspNetCore.Builder;
|
||||||
using Panda.DynamicWebApi;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Yi.Framework.Application;
|
using Yi.Framework.Application;
|
||||||
using Yi.Framework.Application.Contracts;
|
using Yi.Framework.Application.Contracts;
|
||||||
@@ -40,7 +39,11 @@ builder.Host.UseAutoFacServerProviderFactory();
|
|||||||
|
|
||||||
//<2F><><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>붯̬api
|
//<2F><><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>붯̬api
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddDynamicWebApi();
|
builder.Services.AddAutoApiService(opt =>
|
||||||
|
{
|
||||||
|
//NETServiceTest<73><74><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><D3BD><EFBFBD>̬api<70><69><EFBFBD><EFBFBD>
|
||||||
|
opt.CreateConventional(typeof(YiFrameworkApplicationModule).Assembly);
|
||||||
|
});
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD>swagger
|
//<2F><><EFBFBD><EFBFBD>swagger
|
||||||
builder.Services.AddSwaggerServer<YiFrameworkApplicationModule>();
|
builder.Services.AddSwaggerServer<YiFrameworkApplicationModule>();
|
||||||
@@ -59,6 +62,9 @@ app.UseHttpsRedirection();
|
|||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
//ʹ<>ö<EFBFBD>̬api
|
||||||
|
app.UseAutoApiService();
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|||||||
Reference in New Issue
Block a user