diff --git a/openapi b/openapi index 073fd7213fd9e6ebc2f8a47d628a650de30c8bc4..b639a02180c2b5e301c77483b3a2fa645ba94169 160000 --- a/openapi +++ b/openapi @@ -1 +1 @@ -Subproject commit 073fd7213fd9e6ebc2f8a47d628a650de30c8bc4 +Subproject commit b639a02180c2b5e301c77483b3a2fa645ba94169 diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs index 9a377b30adec12cab328cbdf7b14cdf9e249f9da..02a00581f938ad8b603566108bf6ff111c896e9d 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs @@ -52,13 +52,14 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers /// Operation to retrieve all the relocalization information of one or severals WorldAnchors or Trackables. /// </summary> /// - public override IActionResult GetRelocalizationInformation([FromQuery(Name = "uuids")][Required()] List<GetRelocalizationInformationUuidsParameterInner> uuids, [FromQuery(Name = "capabilities")][Required()] List<Capability> capabilities, [FromHeader(Name = "token")] string token) + // old: public override IActionResult GetRelocalizationInformation([FromQuery(Name = "uuids")][Required()] List<GetRelocalizationInformationUuidsParameterInner> uuids, [FromQuery(Name = "capabilities")][Required()] List<Capability> capabilities, [FromHeader(Name = "token")] string token) + public override IActionResult GetRelocalizationInformation([FromQuery(Name = "uuids")][Required()] List<UuidAndMode> uuids, [FromQuery(Name = "capabilities")][Required()] List<Capability> capabilities, [FromHeader(Name = "token")] string token) { WorldAnchorService _worldAnchorService = WorldAnchorService.Singleton as WorldAnchorService; TrackableService _trackableService = TrackableService.Singleton as TrackableService; var history = new List<Guid>(); - var result = new GetRelocalizationInformation200Response(); + var result = new RelocalizationInformations(); result.RelocInfo = new List<RelocalizationInformation>(); foreach (var request in uuids) @@ -88,18 +89,18 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers else if (trackable != null) { history.Add(trackable.UUID); - + Matrix4x4 matrix = Matrix4x4.Identity; var relocalizationInformation = new RelocalizationInformation(); relocalizationInformation.RequestUUID = trackable.UUID; relocalizationInformation.RequestType = TypeWorldStorage.TRACKABLEEnum; - relocalizationInformation.RelocObjects = new List<RelocalizationInformationRelocObjectsInner>(); + relocalizationInformation.RelocObjects = new List<RelocObject>(); if (trackable.Match(capabilities)) { // add itself with matrix identity as Transform3D - var itself = new RelocalizationInformationRelocObjectsInner(); + var itself = new RelocObject(); itself.Trackable = trackable; itself.Mode = request.Mode; itself.Transform3D = new List<float>() @@ -122,12 +123,12 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers } } - return result.RelocInfo.Count > 0 ? new ObjectResult(result) : StatusCode(404, "Not found, could not find UUID in database."); + return result.RelocInfo.Count > 0 ? new ObjectResult(result) : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } - private List<RelocalizationInformationRelocObjectsInner> FindRelocInfo(Guid targetUUID, ModeWorldStorage mode, Matrix4x4 matrix, List<Capability> capabilities, ref List<Guid> history) + private List<RelocObject> FindRelocInfo(Guid targetUUID, ModeWorldStorage mode, Matrix4x4 matrix, List<Capability> capabilities, ref List<Guid> history) { - var results = new List<RelocalizationInformationRelocObjectsInner>(); + var results = new List<RelocObject>(); results.AddRange(FindRelocInfoAsTo(targetUUID, mode, matrix, capabilities, ref history)); results.AddRange(FindRelocInfoAsFrom(targetUUID, mode, matrix, capabilities, ref history)); @@ -136,13 +137,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers } // Check links where the target UUID appeared as "To" - private List<RelocalizationInformationRelocObjectsInner> FindRelocInfoAsTo(Guid targetUUID, ModeWorldStorage mode, Matrix4x4 matrix, List<Capability> capabilities, ref List<Guid> history) + private List<RelocObject> FindRelocInfoAsTo(Guid targetUUID, ModeWorldStorage mode, Matrix4x4 matrix, List<Capability> capabilities, ref List<Guid> history) { TrackableService _trackableService = TrackableService.Singleton as TrackableService; WorldAnchorService _worldAnchorService = WorldAnchorService.Singleton as WorldAnchorService; WorldLinkService _worldLinkService = WorldLinkService.Singleton as WorldLinkService; - var results = new List<RelocalizationInformationRelocObjectsInner>(); + var results = new List<RelocObject>(); // Check links where the target UUID appeared as "To" List<WorldLink> linksTo; @@ -199,7 +200,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers } // We found a valid trackable, add it to the results - var result = new RelocalizationInformationRelocObjectsInner(); + var result = new RelocObject(); result.Trackable = trackable; result.Mode = mode; result.Transform3D = new List<float>() @@ -226,9 +227,9 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers if (anchor != null) { - + Matrix4x4 m; - m = link.Matrix()*matrix; + m = link.Matrix() * matrix; if (mode == ModeWorldStorage.REQUESTTOTRACKABLESEnum) { @@ -272,13 +273,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers } // Check links where the target UUID appeared as "From" - private List<RelocalizationInformationRelocObjectsInner> FindRelocInfoAsFrom(Guid targetUUID, ModeWorldStorage mode, Matrix4x4 matrix, List<Capability> capabilities, ref List<Guid> history) + private List<RelocObject> FindRelocInfoAsFrom(Guid targetUUID, ModeWorldStorage mode, Matrix4x4 matrix, List<Capability> capabilities, ref List<Guid> history) { TrackableService _trackableService = TrackableService.Singleton as TrackableService; WorldAnchorService _worldAnchorService = WorldAnchorService.Singleton as WorldAnchorService; WorldLinkService _worldLinkService = WorldLinkService.Singleton as WorldLinkService; - var results = new List<RelocalizationInformationRelocObjectsInner>(); + var results = new List<RelocObject>(); // Check links where the anchor appeared as "From" List<WorldLink> linksTo; @@ -335,7 +336,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers } // We found a valid trackable, add it to the results - var result = new RelocalizationInformationRelocObjectsInner(); + var result = new RelocObject(); result.Trackable = trackable; result.Mode = mode; result.Transform3D = new List<float>() diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/TrackablesImpl.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/TrackablesImpl.cs index f6c4bdce3a49c4e5aaa0375582fd51d7f37f0f7a..7997e6cbad0677687861573e1b8d66e82f3fb1b0 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/TrackablesImpl.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/TrackablesImpl.cs @@ -75,13 +75,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers Trackable mytrackable = _trackableService.Create(trackable); if (mytrackable == null) { - return StatusCode(409, "UUID already existing!"); + return StatusCode(409, new Error() { Message = "UUID already existing!" }); } - else return StatusCode(200, mytrackable.UUID.ToString()); + else return StatusCode(200, new Error() { Message = mytrackable.UUID.ToString() }); } catch (Exception e) { - return StatusCode(400, e.Message); + return StatusCode(400, new Error() { Message = e.Message }); } } @@ -121,7 +121,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers { result += ", removed object was referenced in " + worldlinkinfo + " and removed there as well"; } - return (count > 0) ? new ObjectResult(result) : StatusCode(404, "Not found, could not find UUID in database."); + return (count > 0) ? new ObjectResult(result) : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } /// <summary> @@ -130,7 +130,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers public override IActionResult GetTrackableById([FromRoute(Name = "trackableUUID")][Required] Guid trackableUUID, [FromHeader] string token) { Trackable trackable = _trackableService.Get(trackableUUID); - return (null != trackable) ? new ObjectResult(trackable) : StatusCode(404, "Not found, could not find UUID in database."); + return (null != trackable) ? new ObjectResult(trackable) : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } /// <summary> @@ -152,11 +152,11 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers long count = _trackableService.Replace(trackable); if (count == 0) { - return StatusCode(404, "Not found, could not find UUID in database."); + return StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } else { - return StatusCode(200, trackable.UUID.ToString()); + return StatusCode(200, new Error() { Message = trackable.UUID.ToString() }); } } } diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldAnchorsImpl.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldAnchorsImpl.cs index 0d6663375c20628577dd23c0df7f95c8d525586f..8d6b265e220e2d042549fe64ad9bcf66a0101398 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldAnchorsImpl.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldAnchorsImpl.cs @@ -75,13 +75,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers WorldAnchor myworldanchor = _worldAnchorService.Create(worldAnchor); if (myworldanchor == null) { - return StatusCode(409, "UUID alread exexisting!"); + return StatusCode(409, new Error() { Message = "UUID alread exexisting!" }); } - else return StatusCode(200, myworldanchor.UUID.ToString()); + else return StatusCode(200, new Error() { Message = myworldanchor.UUID.ToString() }); } catch (Exception e) { - return StatusCode(400, e.Message); + return StatusCode(400, new Error() { Message = e.Message }); } } @@ -121,7 +121,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers { result += ", but removed object was referenced in " + worldlinkinfo + " and removed there as well"; } - return (count > 0) ? new ObjectResult(result) : StatusCode(404, "Not found, could not find UUID in database."); + return (count > 0) ? new ObjectResult(result) : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } /// <summary> @@ -130,7 +130,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers public override IActionResult GetWorldAnchorById([FromRoute(Name = "worldAnchorUUID")][Required] Guid worldAnchorUUID, [FromHeader] string token) { WorldAnchor myworldanchor = _worldAnchorService.Get(worldAnchorUUID); - return (null != myworldanchor) ? new ObjectResult(myworldanchor) : StatusCode(404, "Not found, could not find UUID in database."); + return (null != myworldanchor) ? new ObjectResult(myworldanchor) : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } /// <summary> @@ -152,11 +152,11 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers long count = _worldAnchorService.Replace(worldAnchor); if (count == 0) { - return StatusCode(404, "Not found, could not find UUID in database."); + return StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } else { - return StatusCode(200, worldAnchor.UUID.ToString()); + return StatusCode(200, new Error() { Message = worldAnchor.UUID.ToString() }); } } diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldLinksImpl.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldLinksImpl.cs index 27ce36e891b86c3a6dff3ea9f757fa3941ebc2b9..ef44865fdab674647c0f58cd724d86a8e5ffba64 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldLinksImpl.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/WorldLinksImpl.cs @@ -74,13 +74,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers WorldLink myworldlink = _worldLinkService.Create(worldLink); if (myworldlink == null) { - return StatusCode(409, "UUID already existing!"); + return StatusCode(409, new Error() { Message = "UUID already existing!" }); } - else return StatusCode(200, myworldlink.UUID.ToString()); + else return StatusCode(200, new Error() { Message = myworldlink.UUID.ToString() }); } catch (Exception e) { - return StatusCode(400, e.Message); + return StatusCode(400, new Error() { Message = e.Message}); } } @@ -90,7 +90,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers public override IActionResult DeleteWorldLink([FromRoute(Name = "worldLinkUUID")][Required] Guid worldLinkUUID, [FromHeader] string token) { long count = _worldLinkService.Remove(worldLinkUUID); - return (count > 0) ? new ObjectResult("ok") : StatusCode(404, "Not found, could not find UUID in database."); + return (count > 0) ? new ObjectResult("ok") : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } @@ -141,7 +141,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers } } } - return (null != myworldlink) ? new ObjectResult(myworldlink) : StatusCode(404, "Not found, could not find UUID in database."); + return (null != myworldlink) ? new ObjectResult(myworldlink) : StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } /// <summary> @@ -204,11 +204,11 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers long count = _worldLinkService.Replace(worldLink); if (count == 0) { - return StatusCode(404, "Not found, could not find UUID in database."); + return StatusCode(404, new Error() { Message = "Not found, could not find UUID in database." }); } else { - return StatusCode(200, worldLink.UUID.ToString()); + return StatusCode(200, new Error() { Message = worldLink.UUID.ToString() }); } } } diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/TrackableService.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/TrackableService.cs index c7601cb22b3d1ede3738f9d8e7cecee6207b1756..3b4fb58180c0663f93d3fa42b17ab93c1fbd594a 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/TrackableService.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/TrackableService.cs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: June 2022 +// Last change: June 2024 // using System; diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldAnchorService.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldAnchorService.cs index 2b50133bc231dd05ecf22c682875bae819f19898..78defd59775eb4e9260873b1b18d63c1264a1f28 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldAnchorService.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldAnchorService.cs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: June 2022 +// Last change: June 2024 // using System; diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldLinkService.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldLinkService.cs index dac8abd63734ed230b56cd24ad2915ba603c9b17..7a0f1dd6871e7170afe98e26e22e238c2dadb8c6 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldLinkService.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/Services/WorldLinkService.cs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Last change: June 2022 +// Last change: June 2024 // using System; diff --git a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/Startup.cs b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/Startup.cs index b2d59f7aa163a8dc47a08351cc99c1ac74395d8c..ba5250a373e3eedea47efc9835d77c2328b8b8d8 100644 --- a/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/Startup.cs +++ b/server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/Startup.cs @@ -180,7 +180,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage services .AddControllers(options => { - options.ModelBinderProviders.Insert(0, new FromJsonBinderProviderT<GetRelocalizationInformationUuidsParameterInner>()); + options.ModelBinderProviders.Insert(0, new FromJsonBinderProviderT<RelocObject>()); options.ModelBinderProviders.Insert(0, new FromJsonBinderProviderT<Capability>()); }); }