src/SSCMS.Core/Utils/PathRules/ChannelFilePathRules.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using SSCMS.Enums;
using SSCMS.Models;
using SSCMS.Services;
using SSCMS.Utils;
namespace SSCMS.Core.Utils.PathRules
{
public class ChannelFilePathRules
{
private const string ChannelId = "{@channelId}";
private const string Year = "{@year}";
private const string Month = "{@month}";
private const string Day = "{@day}";
private const string Hour = "{@hour}";
private const string Minute = "{@minute}";
private const string Second = "{@second}";
private const string Sequence = "{@sequence}";
private const string ParentRule = "{@parentRule}";
private const string ChannelName = "{@channelName}";
private const string LowerChannelName = "{@lowerChannelName}";
private const string ChannelIndex = "{@channelIndex}";
private const string LowerChannelIndex = "{@lowerChannelIndex}";
public static string DefaultRule = "/channels/{@channelId}.html";
public static string DefaultDirectoryName = "/channels/";
public static string DefaultRegexString = "/channels/(?<channelId>[^_]*)_?(?<pageIndex>[^_]*)";
private readonly IPathManager _pathManager;
private readonly IDatabaseManager _databaseManager;
public ChannelFilePathRules(IPathManager pathManager, IDatabaseManager databaseManager)
{
_pathManager = pathManager;
_databaseManager = databaseManager;
}
public async Task<Dictionary<string, string>> GetDictionaryAsync(int channelId)
{
var dictionary = new Dictionary<string, string>
{
{ChannelId, "栏目ID"},
{Year, "年份"},
{Month, "月份"},
{Day, "日期"},
{Hour, "小时"},
{Minute, "分钟"},
{Second, "秒钟"},
{Sequence, "顺序数"},
{ParentRule, "父级命名规则"},
{ChannelName, "栏目名称"},
{LowerChannelName, "栏目名称(小写)"},
{ChannelIndex, "栏目索引"},
{LowerChannelIndex, "栏目索引(小写)"}
};
var channelInfo = await _databaseManager.ChannelRepository.GetAsync(channelId);
var styleInfoList = await _databaseManager.TableStyleRepository.GetChannelStylesAsync(channelInfo);
后面还有 143 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
