Files
SteamTools/System.Application.SteamTools.Client/ImageUrlHelper.cs
T
2021-02-20 16:45:44 +08:00

28 lines
782 B
C#

using System.Application.Services.CloudService;
namespace System.Application
{
public static class ImageUrlHelper
{
static string ApiBaseUrl
{
get
{
var client = DI.Get<CloudServiceClientBase>();
return client.ApiBaseUrl;
}
}
/// <summary>
/// 获取图片的APIURL(相对路径)
/// </summary>
const string GetImageApiUrl = "{1}/api/images/{0}";
/// <summary>
/// 根据图片Id获取APIURL(绝对路径)
/// </summary>
/// <param name="imageId"></param>
/// <returns></returns>
public static string GetImageApiUrlById(Guid imageId) => string.Format(GetImageApiUrl, imageId, ApiBaseUrl);
}
}