Add project files.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
namespace Core.Blueprint.Service.External.Clients.Adapters
|
||||
{
|
||||
public class BlueprintAdapter
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public string _Id { get; set; } = null!;
|
||||
public string Id { get; init; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public StatusEnum Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Core.Blueprint.KeyVault;
|
||||
|
||||
namespace Core.Blueprint.Service.External.Clients.Adapters
|
||||
{
|
||||
public class KeyVaultAdapter
|
||||
{
|
||||
public KeyVaultResponse Item1 { get; set; }
|
||||
public string Item2 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Core.Blueprint.Service.External.Clients.Adapters
|
||||
{
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum StatusEnum
|
||||
{
|
||||
|
||||
Active = 0,
|
||||
|
||||
Inactive = 1,
|
||||
|
||||
Deleted = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace Core.Blueprint.Service.External.Clients.Adapters
|
||||
{
|
||||
public class UserProjectAdapter
|
||||
{
|
||||
public string ProjectCode { get; set; } = null!;
|
||||
public string ProjectDescription { get; set; } = null!;
|
||||
public string UserId { get; set; } = null!;
|
||||
public int Id { get; set; }
|
||||
public string Guid { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public StatusEnum Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Core.Blueprint.KeyVault;
|
||||
using Core.Blueprint.Service.External.Clients.Adapters;
|
||||
using Core.Blueprint.Service.External.Clients.Requests;
|
||||
using Core.Blueprint.Storage;
|
||||
using Core.Blueprint.Storage.Adapters;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Refit;
|
||||
|
||||
namespace Core.Blueprint.Service.External.Clients
|
||||
{
|
||||
public interface IBlueprintServiceClient
|
||||
{
|
||||
[Post("/v1/MongoBlueprint/Create")]
|
||||
Task<BlueprintAdapter> CreateBlueprintAsync([FromBody] BlueprintRequest newBlueprint, CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/MongoBlueprint/GetAll")]
|
||||
Task<IEnumerable<BlueprintAdapter>> GetAllBlueprintsAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/MongoBlueprint/{_id}/GetBy_Id")]
|
||||
Task<BlueprintAdapter> GetBlueprintByIdAsync([FromRoute] string _id, CancellationToken cancellationToken = default);
|
||||
|
||||
[Put("/v1/MongoBlueprint/{_id}/Update")]
|
||||
Task<BlueprintAdapter> UpdateBlueprintAsync([FromRoute] string _id, [FromBody] BlueprintAdapter entity, CancellationToken cancellationToken = default);
|
||||
|
||||
[Delete("/v1/MongoBlueprint/{_id}/Delete")]
|
||||
Task<BlueprintAdapter> DeleteBlueprintAsync([FromRoute] string _id, CancellationToken cancellationToken = default);
|
||||
|
||||
[Post("/v1/UserProject/Create")]
|
||||
Task<UserProjectAdapter> CreateUserProjectAsync([FromBody] UserProjectRequest newUserProject, CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/UserProject/GetAll")]
|
||||
Task<IEnumerable<UserProjectAdapter>> GetAllUserProjectsAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/UserProject/{id}/GetById")]
|
||||
Task<UserProjectAdapter> GetUserProjectByIdAsync([FromRoute] int id, CancellationToken cancellationToken = default);
|
||||
|
||||
[Put("/v1/UserProject/{id}/Update")]
|
||||
Task<UserProjectAdapter> UpdateUserProjectAsync([FromRoute] int id, [FromBody] UserProjectAdapter entity, CancellationToken cancellationToken = default);
|
||||
|
||||
[Delete("/v1/UserProject/{id}/Delete")]
|
||||
Task<UserProjectAdapter> DeleteUserProjectAsync([FromRoute] int id, CancellationToken cancellationToken = default);
|
||||
|
||||
[Post("/v1/KeyVault/CreateSecret")]
|
||||
Task<KeyVaultResponse> CreateSecretAsync([FromBody] KeyVaultRequest newKeyVault, CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/KeyVault/{secretName}/GetSecret")]
|
||||
Task<KeyVaultAdapter> GetSecretByNameAsync([FromRoute] string secretName, CancellationToken cancellationToken = default);
|
||||
|
||||
[Put("/v1/KeyVault/UpdateSecret")]
|
||||
Task<KeyVaultAdapter> UpdateSecretAsync([FromBody] KeyVaultRequest entity, CancellationToken cancellationToken = default);
|
||||
|
||||
[Delete("/v1/KeyVault/{secretName}/DeleteSecret")]
|
||||
Task<KeyVaultAdapter> DeleteSecretAsync([FromRoute] string secretName, CancellationToken cancellationToken = default);
|
||||
|
||||
[Post("/v1/BlobStorage/UploadBlob")]
|
||||
Task<BlobFileAdapter> UploadBlobAsync([FromQuery] BlobAddDto request, CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/BlobStorage/GetBlobList")]
|
||||
Task<List<BlobFileAdapter>> GetBlobListAsync([FromQuery] string? prefix, CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/BlobStorage/DownloadBlob")]
|
||||
Task<BlobDownloadUriAdapter> DownloadBlobAsync([FromQuery] string blobName, CancellationToken cancellationToken = default);
|
||||
|
||||
[Delete("/v1/BlobStorage/DeleteBlob")]
|
||||
Task<BlobFileAdapter> DeleteBlobAsync([FromQuery] string blobName, CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Core.Blueprint.Service.External.Clients.Requests
|
||||
{
|
||||
public class BlueprintRequest
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Core.Blueprint.Service.External.Clients.Requests
|
||||
{
|
||||
public class UserProjectRequest
|
||||
{
|
||||
public string ProjectCode { get; set; } = null!;
|
||||
public string ProjectDescription { get; set; } = null!;
|
||||
public string UserId { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user