-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
在DHSitemap.cs文件中添加了Pek.Seo命名空间,并新增DHSitemap类,该类继承自Attribute,用于自动生成Sitemap。DHSitemap类包含多个属性,如IsUse、SType、Data、UpdateTime、DisplyOrder、Url、ControllerName、ActionName、UniqueSeoCode、Priority和ChangeFreq。 在SiteMap.cs文件中添加了Pek.Seo命名空间,并新增SiteMap和SiteMapChangeFreq两个枚举。SiteMap枚举包含首页、栏目首页、栏目页、内容页、单页和其他等值。SiteMapChangeFreq枚举包含none、always、hourly、daily、weekly、monthly和yearly等值。
- Loading branch information
猿人易
committed
Nov 29, 2024
1 parent
135e886
commit 78e50bc
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
namespace Pek.Seo; | ||
|
||
/// <summary> | ||
/// 自动生成Sitemap | ||
/// </summary> | ||
public class DHSitemap : Attribute | ||
{ | ||
/// <summary> | ||
/// 是否开启Sitemap生成 | ||
/// </summary> | ||
public Boolean IsUse { get; set; } | ||
|
||
/// <summary> | ||
/// 类型,1为首页 | ||
/// </summary> | ||
public SiteMap SType { get; set; } | ||
|
||
/// <summary> | ||
/// 路由数据 | ||
/// </summary> | ||
public IDictionary<String, Object>? Data { get; set; } | ||
|
||
/// <summary> | ||
/// 更新时间 | ||
/// </summary> | ||
public DateTime? UpdateTime { get; set; } | ||
|
||
/// <summary> | ||
/// 排序 | ||
/// </summary> | ||
public Int32 DisplyOrder { get; set; } | ||
|
||
/// <summary> | ||
/// Url | ||
/// </summary> | ||
public String? Url { get; set; } | ||
|
||
/// <summary> | ||
/// 控制器名称 | ||
/// </summary> | ||
public String? ControllerName { get; set; } | ||
|
||
/// <summary> | ||
/// 动作名称 | ||
/// </summary> | ||
public String? ActionName { get; set; } | ||
|
||
/// <summary> | ||
/// 语言 | ||
/// </summary> | ||
public String? UniqueSeoCode { get; set; } | ||
|
||
/// <summary> | ||
/// 优先级 | ||
/// </summary> | ||
public Double Priority { get; set; } | ||
|
||
/// <summary> | ||
/// 更新频率 | ||
/// </summary> | ||
public SiteMapChangeFreq ChangeFreq { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace Pek.Seo; | ||
|
||
public enum SiteMap | ||
{ | ||
首页 = 1, | ||
栏目首页 = 2, | ||
栏目页 = 3, | ||
内容页 = 4, | ||
单页 = 5, | ||
其他 = 99 | ||
} | ||
|
||
public enum SiteMapChangeFreq | ||
{ | ||
/// <summary> | ||
/// 无 | ||
/// </summary> | ||
none, | ||
/// <summary> | ||
/// 经常 | ||
/// </summary> | ||
always, | ||
/// <summary> | ||
/// 每时 | ||
/// </summary> | ||
hourly, | ||
/// <summary> | ||
/// 每天 | ||
/// </summary> | ||
daily, | ||
/// <summary> | ||
/// 每周 | ||
/// </summary> | ||
weekly, | ||
/// <summary> | ||
/// 每月 | ||
/// </summary> | ||
monthly, | ||
/// <summary> | ||
/// 每年 | ||
/// </summary> | ||
yearly | ||
} |