forked from gongxuegit/tiku-backend.net
57 lines
1.4 KiB
C#
57 lines
1.4 KiB
C#
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());
|
|
}
|