add saving and deletion of PointClouds
This commit is contained in:
@@ -40,6 +40,17 @@ namespace PointCloudWeb.Server.Controllers
|
||||
return ConvertPointCloudToDto(pc);
|
||||
}
|
||||
|
||||
[HttpDelete]
|
||||
[Route("{id:Guid}")]
|
||||
public ActionResult RemoveById(Guid id)
|
||||
{
|
||||
if (pointCloudService.GetById(id) == null)
|
||||
return new NotFoundResult();
|
||||
|
||||
pointCloudService.RemoveById(id);
|
||||
return new OkResult();
|
||||
}
|
||||
|
||||
[HttpPut]
|
||||
public ActionResult<PointCloudInfoDto> UpdatePointCloud([FromBody] PointCloudInfoDto newPc)
|
||||
{
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace PointCloudWeb.Server.Models
|
||||
|
||||
public PointCloud GetById(Guid id)
|
||||
{
|
||||
return this.Find(pc => pc.Id == id);
|
||||
return Find(pc => pc.Id == id);
|
||||
}
|
||||
|
||||
public void RemoveById(Guid id)
|
||||
|
||||
@@ -68,5 +68,10 @@ namespace PointCloudWeb.Server.Services
|
||||
foreach (var pointCloud in pointClouds)
|
||||
RegisterPointCloud(pointCloud.Id);
|
||||
}
|
||||
|
||||
public void RemoveById(Guid id)
|
||||
{
|
||||
pointClouds.RemoveById(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,11 @@ namespace PointCloudWeb.Server
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
app.UseCors(options => {
|
||||
app.UseCors(options =>
|
||||
{
|
||||
options.AllowAnyOrigin();
|
||||
options.AllowAnyMethod();
|
||||
options.AllowAnyHeader();
|
||||
});
|
||||
|
||||
//app.UseAuthorization();
|
||||
|
||||
Reference in New Issue
Block a user