Files
yes.blog/Yes.Application/Admins/Themes/ThemeService.cs
2025-04-30 09:51:36 +08:00

24 lines
614 B
C#

namespace Yes.Application.Admins.Themes
{
public class ThemeService(IWebHostEnvironment env) : IThemeService
{
private readonly IWebHostEnvironment _env = env;
public void CheckThemeExists(string theme)
{
var themePath = Path.Combine(_env.ContentRootPath, "files", "themes");
var directories = Directory.GetDirectories(themePath);
var jsonPath = Path.Combine(themePath, theme, "config.json");
if (!File.Exists(jsonPath))
{
throw new ThemeNotExistsException(theme);
}
}
}
}