You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
993 B
C#
39 lines
993 B
C#
using ClassLibrary1;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using WebMVCApi.Services;
|
|
|
|
namespace DIWebApi.Controllers
|
|
{
|
|
[Route("api/")]
|
|
[ApiController]
|
|
public class TestController : ControllerBase
|
|
{
|
|
private readonly CalculateService calculate;
|
|
public TestController(CalculateService calculate) {
|
|
this.calculate = calculate;
|
|
}
|
|
|
|
[HttpGet("Get")]
|
|
public int Get([FromServices] Class1 class1,int i1 ,int i2)
|
|
{
|
|
return class1.Add(i1,i2);
|
|
}
|
|
[HttpGet("GetCount")]
|
|
public int GetCount()
|
|
{
|
|
return calculate.Count;
|
|
}
|
|
/// <summary>
|
|
/// 写入文件
|
|
/// </summary>
|
|
/// <param name="Path">文件路径</param>
|
|
/// <param name="content">文件内容</param>
|
|
[HttpGet("build")]
|
|
public void buildCount()
|
|
{
|
|
System.IO.File.WriteAllText("", "");
|
|
}
|
|
}
|
|
}
|