using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using AutoCheckSMS;
|
|
namespace TestTemplate
|
{
|
class Program
|
{
|
static void Main(string[] args)
|
{
|
Console.WriteLine("测试内容是否匹配模板按1回车");
|
Console.WriteLine("短信内容生成模板按2回车");
|
string entNum = Console.ReadKey().KeyChar.ToString();
|
|
int.TryParse(entNum, out int num);
|
List<A_template> _Templates = SQLHelper.Instance.GetTemplates();
|
|
if (num == 1)
|
{
|
Console.WriteLine("测试内容是否匹配模板");
|
Console.WriteLine("请输入要检测的内容(回车结束):");
|
string str = Console.ReadLine();
|
|
if (Match.Instance.IsMatchByWildcard(_Templates, str))
|
{
|
Console.WriteLine("检测通过");
|
}
|
else
|
{
|
Console.WriteLine("检测-不通过");
|
}
|
Console.WriteLine("按任意键结束!");
|
}
|
if (num == 2)
|
{
|
Console.WriteLine("测试内容--》生成模板");
|
Console.WriteLine("请输入要生成模板的短信内容(回车结束):");
|
string str = Console.ReadLine();
|
|
//匹配模板-判断模板是否存在
|
if (Match.Instance.IsMatchByWildcard(_Templates, str))
|
{
|
Console.WriteLine($"模板已经存在-不处理-{str}");
|
}
|
else
|
{
|
//生成模板
|
string _template = GenerateTemplate.Instance.GenerateTemplates(str);
|
Console.WriteLine($"模板内容:{_template}");
|
}
|
|
|
Console.WriteLine("按任意键结束!");
|
}
|
|
if (num == 0)
|
{
|
Console.WriteLine("输入的键值不对,请关闭程序重新操作");
|
}
|
Console.ReadKey();
|
}
|
}
|
}
|