mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-08-04 09:37:59 +08:00
添加项目文件。
This commit is contained in:
50
test/Basic/Controllers/UnboundParamsController.cs
Normal file
50
test/Basic/Controllers/UnboundParamsController.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Basic.Controllers
|
||||
{
|
||||
[Route("/stores")]
|
||||
[Produces("application/json")]
|
||||
public class UnboundParamsController
|
||||
{
|
||||
|
||||
[HttpPost]
|
||||
public int Create(Store store)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IEnumerable<Store> Search(string[] locations = null)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new Store { Id = 1, Location = "Boston" },
|
||||
new Store { Id = 1, Location = "Seattle" }
|
||||
};
|
||||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
public Store GetById(int id)
|
||||
{
|
||||
return new Store { Id = 1, Location = "Boston" };
|
||||
}
|
||||
|
||||
[HttpPut("{id}")]
|
||||
public void Update(int id, Store store)
|
||||
{
|
||||
}
|
||||
|
||||
[HttpDelete("{id}")]
|
||||
public void Delete(int id)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class Store
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Location { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user