增加 导入外部微信数据

This commit is contained in:
chfei committed 2026-08-19 12:13:42 +08:00
1 parent 5ed558e343
commit a9f7b1f831
13 files changed
+2088 -1589

No files matched your search

@@ -1,11 +1,14 @@
using AllBase.Model.Result.PDDResult;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
namespace TemuKJD.BLL.ImportConverters
{
@@ -29,10 +32,15 @@ namespace TemuKJD.BLL.ImportConverters
/// </summary>
PlatformType Platform { get; }
/// <summary>
/// 读取内容
/// </summary>
/// <param name="filePath"></param>
void ReadContent(string filePath);
/// <summary>
/// 判断是否匹配当前转换器
/// </summary>
/// <returns>是否匹配</returns>
bool IsMatch(string data);
bool IsMatch();
/// <summary>
/// 转换为标准商品模型
@@ -43,15 +51,29 @@ namespace TemuKJD.BLL.ImportConverters
public abstract class GoodsConverterBase : IGoodsConverter
{
private bool _isMatch = false;
public string FilePath { get; private set; }
public string RawData { get; private set; }
public abstract string ConverterName { get; }
public abstract PlatformType Platform { get; }
void IGoodsConverter.ReadContent(string filePath)
{
ReadContent(filePath);
}
protected virtual void ReadContent(string filePath)
{
if (File.Exists(filePath) == false) throw new Exception("文件不存在");
FilePath = filePath;
using (StreamReader sr = new StreamReader(filePath, Work.Api.UploadPinduoduoMain.GetFileEncoding(filePath)))
{
RawData = sr.ReadToEnd();
}
}
public virtual bool IsMatch(string data)
public virtual bool IsMatch()
{
_isMatch = true;
RawData = data;
return IsMatchProvider();
}
protected abstract bool IsMatchProvider();
@@ -83,8 +105,5 @@ namespace TemuKJD.BLL.ImportConverters
}
protected abstract PDDFrontProductInfo5 ConverterProvider();
}
}