mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.4 KiB
39 lines
1.4 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using Squidex.Domain.Apps.Entities.Apps;
|
|
using Squidex.Domain.Apps.Entities.Assets;
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL;
|
|
using Squidex.Domain.Apps.Entities.Schemas;
|
|
|
|
namespace Squidex.Domain.Apps.Entities.Contents.TestData
|
|
{
|
|
public sealed class FakeUrlGenerator : IGraphQLUrlGenerator
|
|
{
|
|
public bool CanGenerateAssetSourceUrl { get; } = true;
|
|
|
|
public string GenerateAssetUrl(IAppEntity app, IAssetEntity asset)
|
|
{
|
|
return $"assets/{asset.Id}";
|
|
}
|
|
|
|
public string GenerateAssetThumbnailUrl(IAppEntity app, IAssetEntity asset)
|
|
{
|
|
return $"assets/{asset.Id}?width=100";
|
|
}
|
|
|
|
public string GenerateAssetSourceUrl(IAppEntity app, IAssetEntity asset)
|
|
{
|
|
return $"assets/source/{asset.Id}";
|
|
}
|
|
|
|
public string GenerateContentUrl(IAppEntity app, ISchemaEntity schema, IContentEntity content)
|
|
{
|
|
return $"contents/{schema.SchemaDef.Name}/{content.Id}";
|
|
}
|
|
}
|
|
}
|
|
|