forked from gongxuegit/tiku-backend.net
feat: add tenant resolve and health endpoints
This commit is contained in:
6
Tiku.Api/Contracts/HealthDtos.cs
Normal file
6
Tiku.Api/Contracts/HealthDtos.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Tiku.Api.Contracts;
|
||||
|
||||
public sealed record HealthResponseDto(
|
||||
string Status,
|
||||
string Service,
|
||||
DateTimeOffset CheckedAt);
|
||||
56
Tiku.Api/Contracts/TenantDtos.cs
Normal file
56
Tiku.Api/Contracts/TenantDtos.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Common;
|
||||
using Tiku.Domain.Tenancy;
|
||||
|
||||
namespace Tiku.Api.Contracts;
|
||||
|
||||
public sealed class TenantResolveQueryDto
|
||||
{
|
||||
[StringLength(253)]
|
||||
[Description("要解析的访问域名,例如 student.example.com。本地开发也可以直接传 localhost。")]
|
||||
public string? Host { get; set; }
|
||||
|
||||
[StringLength(100)]
|
||||
[Description("租户编码;本地开发或无独立域名时使用,例如 master。")]
|
||||
public string? TenantCode { get; set; }
|
||||
}
|
||||
|
||||
public sealed record TenantResolveResponseDto(
|
||||
PublicTenantDto Tenant,
|
||||
PublicTenantBrandingDto Branding,
|
||||
JsonElement Features,
|
||||
JsonElement AdminFeatures,
|
||||
JsonElement PublicConfig);
|
||||
|
||||
public sealed record PublicTenantDto(
|
||||
Guid Id,
|
||||
string Slug,
|
||||
string Name,
|
||||
TenantStatus Status,
|
||||
TenantMode Mode,
|
||||
string? Host);
|
||||
|
||||
public sealed record PublicTenantBrandingDto(
|
||||
string? BrandName,
|
||||
string? ShortName,
|
||||
string? Slogan,
|
||||
string? LogoUrl,
|
||||
string? FaviconUrl,
|
||||
string? ServiceWechat,
|
||||
string? ServiceAccountName,
|
||||
JsonElement Theme,
|
||||
JsonElement PublicAssets)
|
||||
{
|
||||
public static PublicTenantBrandingDto Empty { get; } = new(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
JsonDefaults.Object(),
|
||||
JsonDefaults.Object());
|
||||
}
|
||||
Reference in New Issue
Block a user