123456789101112131415161718192021222324252627282930 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace NX_ModelClassLibrary.LogCorrelationModel
- {
- public class LogSearchMd
- {
- private const char SplitCHar = '|';
- public DateTime Time { get; set; }
- public string Message { get; set; }
- public string Serialize()
- {
- return $"{Time}{SplitCHar}{Message}";
- }
- public static LogSearchMd Deserialize(string txt)
- {
- LogSearchMd log = new LogSearchMd();
- string[] txts = txt.Split(SplitCHar);
- txts[0] = txts[0].Replace("发生时间:", "");
- return new LogSearchMd()
- {
- Message = txts[1],
- Time = DateTime.Parse(txts[0])
- };
- }
- }
- }
|