using Hotline.Application.Snapshot.Contracts;
using Hotline.Caching.Interfaces;
using Hotline.Settings;
using Hotline.Share.Attributes;
using Hotline.Share.Dtos.Snapshot;
using Hotline.Snapshot.IRepository;
using Microsoft.AspNetCore.Http;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using XF.Domain.Dependency;
namespace Hotline.Application.Snapshot;
public class SnapshotBulletinApplication : ISnapshotBulletinApplication, IScopeDependency
{
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
private readonly ISnapshotBulletinRepository _bulletinRepository;
public SnapshotBulletinApplication(ISystemSettingCacheManager systemSettingCacheManager, ISnapshotBulletinRepository bulletinRepository)
{
_systemSettingCacheManager = systemSettingCacheManager;
_bulletinRepository = bulletinRepository;
}
///
/// 处理通知公告图片附件路径
///
///
///
public string GetSiteUrls(string sHtmlText)
{
sHtmlText = sHtmlText.Replace("<", "<").Replace(">", ">");
//临时内容
System.Text.StringBuilder sb = new StringBuilder();
sb.Append(sHtmlText);
// 定义正则表达式用来匹配 img 标签
Regex regImg = new Regex(@"
]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>", RegexOptions.IgnoreCase);
// 搜索匹配的字符串
MatchCollection matches = regImg.Matches(sHtmlText);
// 定义正则表达式用来匹配 video 标签
Regex regvideo = new Regex(@"