Commit e693e1ea authored by Detlef Runde's avatar Detlef Runde
Browse files

version 1.0.0

parent af39c704
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
# Description of version 0.0.6
# Description of version 1.0.0

auto-generated ASP.NET server code

@@ -75,7 +75,7 @@ and at the value that is to become the MongoDB ID, add:
### folder `Services`
the folder `Services` should contain one common class with the DatabaseSettings (`DatabaseSettings.cs`) and one with the database-access-methods (create, get, update, remove) for each API. If some are missing create them like the ones you find there. Be aware to add the reference to these in the file `startup.cs` in this case.

the naming in the DatabaseSettings is the same as defined in `appsettings.json`, which you have to extend when creating new classes in this folder. changed `appsettings.json` in the folder `docker` accordingly. Make sure that the ConnectionString for the database contains the correct IP address as specified in `docker-compose.yml`.
the naming in the DatabaseSettings is the same as defined in `appsettings.json`, which you have to extend when creating new classes in this folder. Change `appsettings.json` in the folder `docker` accordingly. Make sure that the ConnectionString for the database contains the correct IP address as specified in `docker-compose.yml`.

### folder `wwwroot`
add in `openapi-original.json` in section `servers` the urls of the servers you want to use with swagger-ui
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * API ensuring interoperability between an authoring tool and a World Storage service
 *
 * The version of the OpenAPI document: 0.0.6
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */
@@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Controllers
    [SwaggerResponse(statusCode: 200, type: typeof(string), description: "Current version.")]
    public override IActionResult GetVersion()
    {
      string version = "0.0.6";
      string version = "1.0.0";
      return new ObjectResult(version);
      //return StatusCode(200, new ObjectResult(version));
    }
+32 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * API ensuring interoperability between an authoring tool and a World Storage service
 *
 * The version of the OpenAPI document: 0.0.6
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */
@@ -150,5 +150,35 @@ namespace Org.OpenAPITools.Controllers
      List<Trackable> trackablelist = _trackableService.Get();
      return new ObjectResult(trackablelist);
    }



    /// <summary>
    /// Modify a Trackable.
    /// </summary>
    /// <remarks>Modify an existing Trackable given a json object containing all the required informations. &lt;br&gt; **Please note that ID of the object is required in the JSON**</remarks>
    /// <param name="trackable">The Trackable to be modified in the world storage.</param>
    /// <response code="200">OK, return the UUID of the modified Trackable.</response>
    /// <response code="400">Bad request.</response>
    /// <response code="404">Not found, could not find UUID in database.</response>
    /// <response code="0">Unexpected error.</response>
    [HttpPut]
    [Route("/trackables")]
    [Consumes("application/json")]
    [ValidateModelState]
    [SwaggerOperation("ModifyTrackable")]
    [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
    public override IActionResult ModifyTrackable([FromBody] Trackable trackable)
    {
      ReplaceOneResult result = _trackableService.Update(trackable.UUID, trackable);
      if (result.MatchedCount == 0)
      {
        return StatusCode(404, "Not found, could not find UUID in database.");
      }
      else
      {
        return StatusCode(200, trackable.UUID);
      }
    }
  }
}
+33 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * API ensuring interoperability between an authoring tool and a World Storage service
 *
 * The version of the OpenAPI document: 0.0.6
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */
@@ -150,5 +150,37 @@ namespace Org.OpenAPITools.Controllers
      List<WorldAnchor> worldanchorlist = _worldAnchorService.Get();
      return new ObjectResult(worldanchorlist);
    }



    /// <summary>
    /// Modify a World Anchor.
    /// </summary>
    /// <remarks>Modify an existing World Anchor given a json object containing all the required informations. &lt;br&gt; **Please note that ID of the object is required in the JSON**</remarks>
    /// <param name="worldAnchor">The World Anchor to be modified in the world storage.</param>
    /// <response code="200">OK, return the UUID of the modified World Anchor.</response>
    /// <response code="400">Bad request.</response>
    /// <response code="404">Not found, could not find UUID in database.</response>
    /// <response code="0">Unexpected error.</response>
    [HttpPut]
    [Route("/worldAnchors")]
    [Consumes("application/json")]
    [ValidateModelState]
    [SwaggerOperation("ModifyWorldAnchor")]
    [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
    public override IActionResult ModifyWorldAnchor([FromBody] WorldAnchor worldAnchor)
    {
      ReplaceOneResult result = _worldAnchorService.Update(worldAnchor.UUID, worldAnchor);
      if (result.MatchedCount == 0)
      {
        return StatusCode(404, "Not found, could not find UUID in database.");
      }
      else
      {
        return StatusCode(200, worldAnchor.UUID);
      }
    }


  }
}
+31 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * API ensuring interoperability between an authoring tool and a World Storage service
 *
 * The version of the OpenAPI document: 0.0.6
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */
@@ -201,5 +201,35 @@ namespace Org.OpenAPITools.Controllers
      }
      return new ObjectResult(worldlinklist);
    }



    /// <summary>
    /// Modify a World Link.
    /// </summary>
    /// <remarks>Modify an existing World Link given a json object containing all the required informations. &lt;br&gt; **Please note that ID of the object is required in the JSON**</remarks>
    /// <param name="worldLink">The World Link to be modified in the world storage.</param>
    /// <response code="200">OK, return the UUID of the modified World Link.</response>
    /// <response code="400">Bad request.</response>
    /// <response code="404">Not found, could not find UUID in database.</response>
    /// <response code="0">Unexpected error.</response>
    [HttpPut]
    [Route("/worldLinks")]
    [Consumes("application/json")]
    [ValidateModelState]
    [SwaggerOperation("ModifyWorldLink")]
    [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
    public override IActionResult ModifyWorldLink([FromBody] WorldLink worldLink)
    {
      ReplaceOneResult result = _worldLinkService.Update(worldLink.UUID, worldLink);
      if (result.MatchedCount == 0)
      {
        return StatusCode(404, "Not found, could not find UUID in database.");
      }
      else
      {
        return StatusCode(200, worldLink.UUID);
      }
    }
  }
}
Loading