更新邮件解析服务,添加主题参数以增强解析能力;修改HTML文件以支持PWA和优化视图设置
This commit is contained in:
@@ -5,13 +5,18 @@ public class EmailParseForm95555(
|
||||
IOpenAiService openAiService
|
||||
) : EmailParseServicesBase(logger, openAiService)
|
||||
{
|
||||
public override bool CanParse(string from, string body)
|
||||
public override bool CanParse(string from, string subject, string body)
|
||||
{
|
||||
if (!from.Contains("95555@message.cmbchina.com"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!subject.Contains("账户变动通知"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 不能包含HTML标签
|
||||
if (Regex.IsMatch(body, "<.*?>"))
|
||||
{
|
||||
|
||||
@@ -7,13 +7,18 @@ public class EmailParseFormCCSVC(
|
||||
IOpenAiService openAiService
|
||||
) : EmailParseServicesBase(logger, openAiService)
|
||||
{
|
||||
public override bool CanParse(string from, string body)
|
||||
public override bool CanParse(string from, string subject, string body)
|
||||
{
|
||||
if (!from.Contains("ccsvc@message.cmbchina.com"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!subject.Contains("每日信用管家"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 必须包含HTML标签
|
||||
if (!Regex.IsMatch(body, "<.*?>"))
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
public interface IEmailParseServices
|
||||
{
|
||||
bool CanParse(string from, string body);
|
||||
bool CanParse(string from, string subject, string body);
|
||||
|
||||
/// <summary>
|
||||
/// 解析邮件内容,提取交易信息
|
||||
@@ -22,7 +22,7 @@ public abstract class EmailParseServicesBase(
|
||||
IOpenAiService openAiService
|
||||
) : IEmailParseServices
|
||||
{
|
||||
public abstract bool CanParse(string from, string body);
|
||||
public abstract bool CanParse(string from, string subject, string body);
|
||||
|
||||
public async Task<(
|
||||
string card,
|
||||
|
||||
Reference in New Issue
Block a user