src/SSCMS.Web/Controllers/Admin/Cms/Templates/TemplatesController.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using SSCMS.Configuration;
using SSCMS.Dto;
using SSCMS.Enums;
using SSCMS.Models;
using SSCMS.Repositories;
using SSCMS.Services;
namespace SSCMS.Web.Controllers.Admin.Cms.Templates
{
[OpenApiIgnore]
[Authorize(Roles = Types.Roles.Administrator)]
[Route(Constants.ApiAdminPrefix)]
public partial class TemplatesController : ControllerBase
{
private const string Route = "cms/templates/templates";
private const string RouteDelete = "cms/templates/templates/actions/delete";
private const string RouteCreate = "cms/templates/templates/actions/create";
private const string RouteCopy = "cms/templates/templates/actions/copy";
private const string RouteDefault = "cms/templates/templates/actions/default";
private readonly ISettingsManager _settingsManager;
private readonly IAuthManager _authManager;
private readonly IPathManager _pathManager;
private readonly ICreateManager _createManager;
private readonly ISiteRepository _siteRepository;
private readonly IChannelRepository _channelRepository;
private readonly ITemplateRepository _templateRepository;
public TemplatesController(ISettingsManager settingsManager, IAuthManager authManager, IPathManager pathManager, ICreateManager createManager, ISiteRepository siteRepository, IChannelRepository channelRepository, ITemplateRepository templateRepository)
{
_settingsManager = settingsManager;
_authManager = authManager;
_pathManager = pathManager;
_createManager = createManager;
_siteRepository = siteRepository;
_channelRepository = channelRepository;
_templateRepository = templateRepository;
}
public class GetResult
{
public List<Cascade<int>> Channels { get; set; }
public IEnumerable<Template> Templates { get; set; }
}
public class TemplateRequest
{
public int SiteId { get; set; }
public int TemplateId { get; set; }
}
private async Task<ActionResult<GetResult>> GetResultAsync(Site site)
{
var channels = new List<Channel>();
var children = await _channelRepository.GetCascadeChildrenAsync(site, site.Id,
后面还有 50 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
