зеркало из https://github.com/Azure/azure-saas.git
Onboarding - API - Add 201 response code as accepted for Tenant POST.
This commit is contained in:
Родитель
903172a5d4
Коммит
c262e21a16
|
@ -348,7 +348,7 @@ MigrationBackup/
|
|||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
/src/Saas.Provider/Saas.Provider.Web/appsettings.Development.json
|
||||
/src/Saas.Provider/Saas.Provider.Web/Properties/ServiceDependencies/app-contoso075-dev-075 - Web Deploy/profile.arm.json
|
||||
/src/Saas.Provider/Saas.Provider.Web/Properties/ServiceDependencies
|
||||
/src/Saas.Admin/Saas.Admin.Web/appsettings.Development.json
|
||||
/src/Saas.Onboarding/Saas.Onboarding.Api/appsettings.Development.json
|
||||
/src/Saas.Provider/Saas.Provider.Web/appsettings.Development.json
|
||||
/src/Saas.Provider/Saas.Provider.Web/Properties/ServiceDependencies/
|
|
@ -1,9 +1,25 @@
|
|||
{
|
||||
/*
|
||||
The following identity settings need to be configured
|
||||
before the project can be successfully executed.
|
||||
For more info see https://aka.ms/dotnet-template-ms-identity-platform
|
||||
*/
|
||||
"AzureAd": {
|
||||
"Instance": "https://login.microsoftonline.com/",
|
||||
"Domain": "microsoft.onmicrosoft.com",
|
||||
"TenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
|
||||
"ClientId": "0c201eb7-178e-4230-b9c0-eee9e5b50b99",
|
||||
"CallbackPath": "/signin-oidc"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"CatalogDbConnection": "Server=(localdb)\\mssqllocaldb;Database=sqldb-catalog-dev;Trusted_Connection=True;"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
[ProductId] INT NOT NULL,
|
||||
[UserId] NVARCHAR(37) NOT NULL,
|
||||
[Created] DATETIME NOT NULL DEFAULT GetDate(),
|
||||
CONSTRAINT [PK_Tenant] PRIMARY KEY ([Id])
|
||||
CONSTRAINT [PK_Tenant] PRIMARY KEY ([Id])
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"ConnectionStrings": {
|
||||
"CatalogDatabase": "Server=(localdb)\\mssqllocaldb;Database=sqldb-catalog-dev;Trusted_Connection=True;",
|
||||
"CatalogDbConnection": "Server=(localdb)\\mssqllocaldb;Database=sqldb-catalog-dev;Trusted_Connection=True;"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
|
|
@ -231,11 +231,15 @@ namespace Saas.Provider.Web.Controllers
|
|||
|
||||
Services.Tenant tenant = new Services.Tenant()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = name,
|
||||
IsActive = true,
|
||||
IsCancelled = false,
|
||||
IsProvisioned = true,
|
||||
ApiKey = Guid.NewGuid(),
|
||||
CategoryId = categoryId,
|
||||
ProductId = productId,
|
||||
UserId = userId
|
||||
UserId = userId,
|
||||
};
|
||||
|
||||
await onboardingClient.TenantsPOSTAsync(tenant);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//----------------------
|
||||
// <auto-generated>
|
||||
// Generated using the NSwag toolchain v13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
|
||||
// Generated using the NSwag toolchain v (http://NSwag.org)
|
||||
// </auto-generated>
|
||||
//----------------------
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace Saas.Provider.Web.Services
|
|||
{
|
||||
using System = global::System;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0))")]
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "")]
|
||||
public partial class OnboardingClient
|
||||
{
|
||||
private string _baseUrl = "";
|
||||
|
@ -47,10 +47,10 @@ namespace Saas.Provider.Web.Services
|
|||
|
||||
partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
|
||||
|
||||
|
||||
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
|
||||
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
|
||||
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
|
||||
|
||||
/// <returns>Success</returns>
|
||||
/// <exception cref="ApiException">A server side error occurred.</exception>
|
||||
public System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Tenant>> TenantsAllAsync()
|
||||
|
@ -173,7 +173,7 @@ namespace Saas.Provider.Web.Services
|
|||
ProcessResponse(client_, response_);
|
||||
|
||||
var status_ = (int)response_.StatusCode;
|
||||
if (status_ == 200)
|
||||
if (status_ == 200 || status_ == 201)
|
||||
{
|
||||
var objectResponse_ = await ReadObjectResponseAsync<Tenant>(response_, headers_, cancellationToken).ConfigureAwait(false);
|
||||
if (objectResponse_.Object == null)
|
||||
|
@ -530,7 +530,8 @@ namespace Saas.Provider.Web.Services
|
|||
}
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v12.0.0.0)")]
|
||||
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.6.3.0 (Newtonsoft.Json v12.0.0.0)")]
|
||||
|
||||
public partial class Tenant
|
||||
{
|
||||
[Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
|
||||
|
@ -563,10 +564,11 @@ namespace Saas.Provider.Web.Services
|
|||
[Newtonsoft.Json.JsonProperty("created", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
|
||||
public System.DateTimeOffset Created { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0))")]
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "")]
|
||||
public partial class ApiException : System.Exception
|
||||
{
|
||||
public int StatusCode { get; private set; }
|
||||
|
@ -589,7 +591,7 @@ namespace Saas.Provider.Web.Services
|
|||
}
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0))")]
|
||||
[System.CodeDom.Compiler.GeneratedCode("NSwag", "")]
|
||||
public partial class ApiException<TResult> : ApiException
|
||||
{
|
||||
public TResult Result { get; private set; }
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
$('input[type=submit]').prop('disabled', true); // Disables visually + functionally
|
||||
|
||||
// Set submit button value
|
||||
document.getElementById('submitButton').value = 'CREATING YOUR SUBSCRIBER...';
|
||||
document.getElementById('submitButton').value = 'CREATING YOUR TENANT...';
|
||||
|
||||
// Display overlay
|
||||
$("<div />").css({
|
||||
|
@ -143,6 +143,6 @@
|
|||
'opacity': '.5',
|
||||
'z-index': '1000',
|
||||
'text-align': 'center'
|
||||
}).appendTo($("body")).append($("<div style='margin-top:20rem; color:#ffffff; font-weight:500'><i class='fas fa-circle-notch fa-spin' style='font-size:3rem;'></i><br><br>Creating your Subscriber</div>"));
|
||||
}).appendTo($("body")).append($("<div style='margin-top:20rem; color:#ffffff; font-weight:500'><i class='fas fa-circle-notch fa-spin' style='font-size:3rem;'></i><br><br>Creating your Tenant</div>"));
|
||||
}
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче