You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1014 B
44 lines
1014 B
3 weeks ago
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||
|
using ReZero.SuperAPI;
|
||
|
using System.Security.Policy;
|
||
|
namespace SuperAPITest.Controllers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 动态接口
|
||
|
/// </summary>
|
||
|
[Api(200100, GroupName = "分组1",Url= "/api/MyApiController")]
|
||
|
public class MyApiController
|
||
|
{
|
||
|
[ApiMethod("我是A方法")]
|
||
|
public int A(int num,int num2)
|
||
|
{
|
||
|
return num+num2;
|
||
|
}
|
||
|
|
||
|
[ApiMethod("我是B方法")]
|
||
|
public string B(byte[] file)
|
||
|
{
|
||
|
return "文件长度"+ file.Length;
|
||
|
}
|
||
|
|
||
|
[ApiMethod("我是C方法", HttpMethod = HttpType.Get)]
|
||
|
public Object C(SqlSugar.PageModel classA)
|
||
|
{
|
||
|
return classA;
|
||
|
}
|
||
|
|
||
|
[ApiMethod("我是D方法")]
|
||
|
[UrlParameters]
|
||
|
public int D(int num, int num2)
|
||
|
{
|
||
|
return num + num2;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public class ClassA
|
||
|
{
|
||
|
public int Id { get; set; }
|
||
|
public string? Name { get; set; }
|
||
|
}
|
||
|
}
|