1
This commit is contained in:
23
Yes.Application/Admins/Themes/ThemeService.cs
Normal file
23
Yes.Application/Admins/Themes/ThemeService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user