YaeBlog/YaeBlog/Models/BlogContents.cs
jackfiled 3126005731
All checks were successful
Build blog docker image / Build-Blog-Image (push) Successful in 49s
feat: 图片压缩命令 (#10)
将图片压缩为webp格式减少流量使用和磁盘占用
Reviewed-on: #10
2025-03-25 15:00:18 +08:00

16 lines
453 B
C#

using System.Collections;
using System.Collections.Concurrent;
namespace YaeBlog.Models;
public record BlogContents(ConcurrentBag<BlogContent> Drafts, ConcurrentBag<BlogContent> Posts)
: IEnumerable<BlogContent>
{
IEnumerator<BlogContent> IEnumerable<BlogContent>.GetEnumerator()
{
return Posts.Concat(Drafts).GetEnumerator();
}
public IEnumerator GetEnumerator() => ((IEnumerable<BlogContent>)this).GetEnumerator();
}