Fix Api descriptions
parent
4944df9c8a
commit
3d415b6903
|
@ -5,6 +5,15 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace API_SequentMicrosystems.Controllers
|
|||
/// Read points from and to specified points positions
|
||||
/// </summary>
|
||||
/// <param name="limit">limit of returned points (Maximum 1000)</param>
|
||||
/// <param name="start">id of start element</param>
|
||||
/// <param name="pm">start element</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{limit}")]
|
||||
public List<PointsModel> Post(int limit, [FromBody] PointsModel pm)
|
||||
|
@ -76,7 +76,6 @@ namespace API_SequentMicrosystems.Controllers
|
|||
/// <summary>
|
||||
/// Read points from first to specified number
|
||||
/// </summary>
|
||||
/// <param name="max">max readed points</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Count")]
|
||||
public int GetCount()
|
||||
|
@ -94,6 +93,17 @@ namespace API_SequentMicrosystems.Controllers
|
|||
_PointsService.DeletePoints();
|
||||
}
|
||||
|
||||
//DELETE api/points
|
||||
/// <summary>
|
||||
/// Delete Specified saved point
|
||||
/// </summary>
|
||||
/// <param name="id">Point ID</param>
|
||||
[HttpDelete("{id}")]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_PointsService.DeletePoint(id);
|
||||
}
|
||||
|
||||
//GET api/points/save
|
||||
/// <summary>
|
||||
/// Save new point
|
||||
|
@ -108,7 +118,7 @@ namespace API_SequentMicrosystems.Controllers
|
|||
/// <summary>
|
||||
/// Start timer to automatic saving points in specified interval
|
||||
/// </summary>
|
||||
/// <param name="sec"></param>
|
||||
/// <param name="msec"></param>
|
||||
[HttpGet("AutoSave/{msec}")]
|
||||
public void GetSaveSec(int msec)
|
||||
{
|
||||
|
|
|
@ -5,8 +5,9 @@ using Microsoft.AspNetCore.Mvc;
|
|||
|
||||
namespace API_SequentMicrosystems.Controllers
|
||||
{
|
||||
|
||||
[Tags("RTD-8 Temperature Module")]
|
||||
[Route("RTDDA")]
|
||||
[Route("api/RTDDA")]
|
||||
[ApiController]
|
||||
public class RTDDataAcquisitionController : ControllerBase
|
||||
{
|
||||
|
@ -74,7 +75,7 @@ namespace API_SequentMicrosystems.Controllers
|
|||
|
||||
//GET api/RTDDA/Names/Preconfigured
|
||||
/// <summary>
|
||||
/// Get preconfigured Names for chanels
|
||||
/// Get preconfigured Names
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Names/Preconfigured")]
|
||||
|
@ -85,7 +86,7 @@ namespace API_SequentMicrosystems.Controllers
|
|||
|
||||
//POST api/RTDDA/Names/Preconfigured
|
||||
/// <summary>
|
||||
/// Post preconfigured names for chanels
|
||||
/// Post preconfigured names
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
[HttpPost("Names/Preconfigured")]
|
||||
|
@ -106,6 +107,10 @@ namespace API_SequentMicrosystems.Controllers
|
|||
}
|
||||
|
||||
//POST api/RTDDA/Calibration
|
||||
/// <summary>
|
||||
/// Post Calibration data
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
[HttpPost("Calibration")]
|
||||
public void PostCalibration([FromBody] SortedList<byte, float[]> data)
|
||||
{
|
||||
|
|
19
Program.cs
19
Program.cs
|
@ -1,4 +1,5 @@
|
|||
using API_SequentMicrosystems.Services;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
|
@ -19,15 +20,27 @@ namespace API_SequentMicrosystems
|
|||
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
{
|
||||
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||
c.IncludeXmlComments(xmlPath);
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (true)//app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
app.UseSwagger(c =>
|
||||
{
|
||||
c.RouteTemplate = "api/{documentName}/swagger.json";
|
||||
});
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/api/v1/swagger.json", "V1");
|
||||
c.RoutePrefix = "api";
|
||||
});
|
||||
}
|
||||
|
||||
app.UseAuthorization();
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"launchUrl": "api",
|
||||
"applicationUrl": "http://localhost:5242",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
|
@ -22,7 +22,7 @@
|
|||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"launchUrl": "api",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
|
|
@ -106,6 +106,15 @@ namespace API_SequentMicrosystems.Services
|
|||
SavePoints();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete Specified Point
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public void DeletePoint(int id)
|
||||
{
|
||||
_points.RemoveAt(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create actual point object
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue