gx
This commit is contained in:
1 parent
0a3e5af6a9
commit
c2dcedd238
59 files changed
+2053
-1274
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using AllBase;
|
||||
using AllBase.Extension;
|
||||
using NaiBa.Util.Extension;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Config;
|
||||
using AllBase.Model.DBModel;
|
||||
@@ -20,7 +21,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Work;
|
||||
|
||||
namespace Store.Product.Publish.Steps.Wx;
|
||||
@@ -34,27 +34,27 @@ public sealed class GenerateAiShortTitleStep : WxProductPublishStepBase
|
||||
|
||||
protected override Task ExecuteProvider(WXPublishContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
if (wxUploadRule.IsAiShortTitle || chkAiImage.Checked)
|
||||
if (context.Parameters.IsAiShortTitle || context.Parameters.IsAiImage)
|
||||
{
|
||||
if (cell != null)
|
||||
if (context.Progress != null)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cell.Value = "正在生成短标题";
|
||||
context.Progress.Report("正在生成短标题");
|
||||
}));
|
||||
}
|
||||
|
||||
WXGetShortTitleParam titleParam = new WXGetShortTitleParam()
|
||||
{
|
||||
categories = new List<categorieParam>(),
|
||||
headImgUrls = upProdParam.product.info.headImg,
|
||||
productTitle = upProdParam.product.info.title,
|
||||
headImgUrls = context.Parameters.ProductParameter.product.info.headImg,
|
||||
productTitle = context.Parameters.ProductParameter.product.info.title,
|
||||
};
|
||||
foreach (var cate in upProdParam.product.info.category)
|
||||
foreach (var cate in context.Parameters.ProductParameter.product.info.category)
|
||||
{
|
||||
titleParam.categories.Add(new categorieParam() { catId = cate.catId, catName = cate.name });
|
||||
}
|
||||
var shortTitleRst = WXUpload.genProductShortTitle(shop, titleParam);
|
||||
var shortTitleRst = WXUpload.genProductShortTitle(context.Parameters.Shop, titleParam);
|
||||
if (!shortTitleRst.Contains("\"code\":0") && !shortTitleRst.Contains("\"success\":true"))
|
||||
{
|
||||
var error = BaseRegex.GetStringJson(ref shortTitleRst, "msg");
|
||||
@@ -62,9 +62,10 @@ public sealed class GenerateAiShortTitleStep : WxProductPublishStepBase
|
||||
error = shortTitleRst;
|
||||
throw new Exception("短标题获取失败 " + error);
|
||||
}
|
||||
upProdParam.product.info.shortTitle = BaseRegex.GetStringJson(ref shortTitleRst, "shortTitle");
|
||||
upProdParam.product.info.aiGenShortTitle = upProdParam.product.info.shortTitle;
|
||||
upProdParam.product.info.title = upProdParam.product.info.shortTitle + upProdParam.product.info.title;
|
||||
context.Parameters.ProductParameter.product.info.shortTitle = BaseRegex.GetStringJson(ref shortTitleRst, "shortTitle");
|
||||
context.Parameters.ProductParameter.product.info.aiGenShortTitle = context.Parameters.ProductParameter.product.info.shortTitle;
|
||||
context.Parameters.ProductParameter.product.info.title = context.Parameters.ProductParameter.product.info.shortTitle + context.Parameters.ProductParameter.product.info.title;
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user