From 93b5a081ef63700a9cf5366c1327647241f152e5 Mon Sep 17 00:00:00 2001 From: Klaus Fischer <klaus.fischer@eloware.com> Date: Thu, 9 Jun 2022 08:43:12 +0200 Subject: [PATCH] Added function body for services, throwing NotImplemented --- Services/CasesService.cs | 31 ++++++++ Services/DestinationService.cs | 77 +++++++++++++++++-- Services/Models/Case/EventLogDto.cs | 17 ++++ .../CreateSubmissionDto.cs} | 2 +- Services/Services.csproj.DotSettings | 1 + Services/SubmissionService.cs | 53 +++++++++++-- 6 files changed, 166 insertions(+), 15 deletions(-) create mode 100644 Services/CasesService.cs create mode 100644 Services/Models/Case/EventLogDto.cs rename Services/Models/{CreateSubmission.cs => Submission/CreateSubmissionDto.cs} (92%) diff --git a/Services/CasesService.cs b/Services/CasesService.cs new file mode 100644 index 00000000..7fe7445a --- /dev/null +++ b/Services/CasesService.cs @@ -0,0 +1,31 @@ +using FitConnect.Services.Models; + +namespace FitConnect.Services; + +public class CasesService { + /// <summary> + /// <para> + /// @GetMapping("/cases/{caseId}/events") + /// </para> + /// </summary> + /// <param name="caseId">PathVariable</param> + /// <param name="offset">RequestParam</param> + /// <param name="limit">RequestParam</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public EventLogDto GetEventLog(string caseId, int offset, int limit) { + throw new NotImplementedException(); + } + + // + /// <summary> + /// <para>@PostMapping(value = "/cases/{caseId}/events", consumes = "application/jose")</para> + /// </summary> + /// <param name="caseId">PathVariable</param> + /// <param name="eventToken">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public bool ProcessCaseEvent(string caseId, string eventToken) { + throw new NotImplementedException(); + } +} diff --git a/Services/DestinationService.cs b/Services/DestinationService.cs index 0f13f80c..ace657c9 100644 --- a/Services/DestinationService.cs +++ b/Services/DestinationService.cs @@ -1,11 +1,74 @@ +using FitConnect.Services.Models; + namespace FitConnect.Services; internal class DestinationService { + /// <summary> + /// <para>@PostMapping("/destinations")</para> + /// </summary> + /// <param name="createDestination">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public PrivateDestinationDto CreateDestination(CreateDestinationDto createDestination) { + throw new NotImplementedException(); + } + + + /// <summary> + /// <para>@GetMapping("/destinations/{destinationId}")</para> + /// </summary> + /// <param name="destinationId">PathVariable</param> + /// <exception cref="NotImplementedException"></exception> + public void GetDestination(string destinationId) { + throw new NotImplementedException(); + } + + + /// <summary> + /// <para>@DeleteMapping("/destinations/{destinationId}")</para> + /// </summary> + /// <param name="destinationId">PathVariable</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public bool DeleteDestination(string destinationId) { + throw new NotImplementedException(); + } + + + /// <summary> + /// <para>@PatchMapping("/destinations/{destinationId}")</para> + /// </summary> + /// <param name="destinationId">PathVariable</param> + /// <param name="patchDestination">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public PrivateDestinationDto PatchDestination(string destinationId, + PatchDestinationDto patchDestination) { + throw new NotImplementedException(); + } + + + /// <summary> + /// <para>@GetMapping("/destinations")</para> + /// </summary> + /// <param name="offset">RequestParam</param> + /// <param name="limit">RequestParam</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public DestinationListDto ListDestinations(int offset, int limit) { + throw new NotImplementedException(); + } + - // @PostMapping("/destinations") - // @GetMapping("/destinations/{destinationId}") - // @DeleteMapping("/destinations/{destinationId}") - // @PatchMapping("/destinations/{destinationId}") - // @GetMapping("/destinations") - // @PutMapping("/destinations/{destinationId}") -} \ No newline at end of file + /// <summary> + /// <para>@PutMapping("/destinations/{destinationId}")</para> + /// </summary> + /// <param name="destinationId">PathVariable</param> + /// <param name="updateDestination">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + public PrivateDestinationDto UpdateDestination(string destinationId, + UpdateDestinationDto updateDestination) { + throw new NotImplementedException(); + } +} diff --git a/Services/Models/Case/EventLogDto.cs b/Services/Models/Case/EventLogDto.cs new file mode 100644 index 00000000..d1936113 --- /dev/null +++ b/Services/Models/Case/EventLogDto.cs @@ -0,0 +1,17 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class EventLogDto { + [JsonPropertyName("count")] + public int Count; + + [JsonPropertyName("offset")] + public int Offset; + + [JsonPropertyName("totalCount")] + public long TotalCount; + + [JsonPropertyName("eventLog")] + public List<string> EventLog; +} diff --git a/Services/Models/CreateSubmission.cs b/Services/Models/Submission/CreateSubmissionDto.cs similarity index 92% rename from Services/Models/CreateSubmission.cs rename to Services/Models/Submission/CreateSubmissionDto.cs index c3bd7bd3..39830d5b 100644 --- a/Services/Models/CreateSubmission.cs +++ b/Services/Models/Submission/CreateSubmissionDto.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; namespace FitConnect.Services.Models; -internal class CreateSubmission { +internal class CreateSubmissionDto { [JsonPropertyName("destinationId")] private string destinationId; diff --git a/Services/Services.csproj.DotSettings b/Services/Services.csproj.DotSettings index 8576e8bb..813beff1 100644 --- a/Services/Services.csproj.DotSettings +++ b/Services/Services.csproj.DotSettings @@ -1,4 +1,5 @@ <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Ccase/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cdestination/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cdestinations/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Csubmission/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file diff --git a/Services/SubmissionService.cs b/Services/SubmissionService.cs index 9905772d..ab536965 100644 --- a/Services/SubmissionService.cs +++ b/Services/SubmissionService.cs @@ -3,34 +3,73 @@ using FitConnect.Services.Models; namespace FitConnect.Services; public class SubmissionService { - // @PostMapping("/submissions") - internal SubmissionCreatedDto CreateSubmission(CreateSubmission submission) { + /// <summary> + /// <para>@PostMapping("/submissions")</para> + /// </summary> + /// <param name="submissionDto">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + internal SubmissionCreatedDto CreateSubmission(CreateSubmissionDto submissionDto) { throw new NotImplementedException(); } - // @PutMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", consumes = "application/jose") + + /// <summary> + /// <para>@PutMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", consumes = "application/jose")</para> + /// </summary> + /// <param name="submissionId">PathVariable</param> + /// <param name="attachmentId">PathVariable</param> + /// <param name="encryptedAttachmentContent">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> internal bool AddSubmissionAttachment(string submissionId, string attachmentId, string encryptedAttachmentContent) { throw new NotImplementedException(); } - //@PutMapping(value = "/submissions/{submissionId}", consumes = "application/json") + /// <summary> + /// <para>@PutMapping(value = "/submissions/{submissionId}", consumes = "application/json") </para> + /// </summary> + /// <param name="submissionId">PathVariable</param> + /// <param name="submitSubmission">RequestBody</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> internal SubmissionReducedDto SubmitSubmission(string submissionId, SubmitSubmissionDto submitSubmission) { throw new NotImplementedException(); } - // @GetMapping("/submissions") + + /// <summary> + /// <para>@GetMapping("/submissions")</para> + /// </summary> + /// <param name="destinationId">RequestParam</param> + /// <param name="offset">RequestParam</param> + /// <param name="limit">RequestParam</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> internal SubmissionsForPickupDto ListSubmissions(string destinationId, int offset, int limit) { throw new NotImplementedException(); } - // @GetMapping("/submissions/{submissionId}") + /// <summary> + /// <para>@GetMapping("/submissions/{submissionId}")</para> + /// </summary> + /// <param name="submissionId">PathVariable</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> internal SubmissionDto GetSubmission(string submissionId) { throw new NotImplementedException(); } - // @GetMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", produces = "application/jose") + + /// <summary> + /// <para>@GetMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", produces = "application/jose")</para> + /// </summary> + /// <param name="submissionId">PathVariable</param> + /// <param name="attachmentId">PathVariable</param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> internal string GetAttachment(string submissionId, string attachmentId) { throw new NotImplementedException(); } -- GitLab