Files
KJD/Store.Product/Publish/Steps/Wx/WXUpload.cs
T
2026-09-14 09:16:59 +08:00

52 lines
5.9 KiB
C#

using AllBase.Model.Param.WXParam;
using AllBase.Model.Result;
using MAX.Core.Helpers;
using Newtonsoft.Json;
using Store.Management.Framework.Apis;
using System.Collections.Generic;
namespace Store.Product.Publish.Steps.Wx;
/// <summary>
/// UploadProduct 旧静态上传调用的无控件兼容层。
/// </summary>
internal static class WXUpload
{
private static readonly WXApi Api = new WXApi();
private static string Html(HttpResult result) => result?.Html ?? "";
private static string Json(object value) => JsonConvert.SerializeObject(value, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
public static string searchProduct(ShopLoginInfo shop, string extCode, string extCode2 = "") => Html(Api.searchProduct(shop.Cookies, extCode, extCode2));
public static string searchProductWithSpuId(ShopLoginInfo shop, string spuId) => Html(Api.searchProductWithSpuId(shop.Cookies, spuId));
public static string searchProductWithTitle(ShopLoginInfo shop, string urlEncodeTitle) => Html(Api.searchProductWithTitle(shop.Cookies, urlEncodeTitle));
public static string getUploadTempImgAuth(ShopLoginInfo shop, int uploadScene = 3) => Html(Api.getUploadTempImgAuth(shop.Cookies, uploadScene));
public static string adtimageupload(ShopLoginInfo shop, string imgBase64, string disK, long disT, string ext) => Html(Api.adtimageupload(shop.Cookies, "", imgBase64, disK, disT, ext));
public static string getProductClassify(ShopLoginInfo shop, string goodsName, List<string> goodImgUrlsLst) => Html(Api.getProductClassify(shop.Cookies, goodsName, goodImgUrlsLst));
public static string getCategoryOnShelf(ShopLoginInfo shop, List<long> catIdLst, string brandId = "2100000000") => Html(Api.getCategoryOnShelf(shop.Cookies, catIdLst, brandId));
public static string getMixBrand(ShopLoginInfo shop, string catId = "547591") => Html(Api.getMixBrand(shop.Cookies, catId));
public static string batchCheckCategoryRelation(ShopLoginInfo shop, long catId) => Html(Api.batchCheckCategoryRelation(shop.Cookies, catId));
public static string addFinderCategoryV2(ShopLoginInfo shop, long catId) => Html(Api.addFinderCategoryV2(shop.Cookies, catId));
public static string getSingleCategoryData(ShopLoginInfo shop, long catId, List<long> catIdLst) => Html(Api.getSingleCategoryData(shop.Cookies, catId, catIdLst));
public static string wxCateAuth(ShopLoginInfo shop, List<long> catIdLst, WXCateAuthParam parameter) => Html(Api.wxCateAuth(shop.Cookies, catIdLst, Json(parameter)));
public static string genProductShortTitle(ShopLoginInfo shop, WXGetShortTitleParam parameter) => Html(Api.genProductShortTitle(shop.Cookies, Json(parameter)));
public static string getFreightTemplate(ShopLoginInfo shop) => Html(Api.getFreightTemplate(shop.Cookies));
public static string getAddress(ShopLoginInfo shop, string searchText = "") => Html(Api.getAddress(shop.Cookies, searchText));
public static string getAddressById(ShopLoginInfo shop, string addressId) => Html(Api.getAddressById(shop.Cookies, addressId));
public static string uploadProductDraft(ShopLoginInfo shop, WXUploadProductParam parameter) => Html(Api.uploadProductDraft(shop.Cookies, Json(parameter)));
public static string upProductV2(ShopLoginInfo shop, WXUploadProductParam parameter) => Html(Api.upProductV2(shop.Cookies, Json(parameter)));
public static string checkProductUpload(ShopLoginInfo shop, string productId) => Html(Api.checkProductUpload(shop.Cookies, productId));
public static string SearchProductUpload(ShopLoginInfo shop, string productId) => Html(Api.SearchProductUpload(shop.Cookies, productId));
public static string upProductJObjectV2(ShopLoginInfo shop, string prodStr) => Html(Api.upProductJObjectV2(shop.Cookies, prodStr));
public static string getEditProductV2(ShopLoginInfo shop, string productId) => Html(Api.getEditProductV2(shop.Cookies, productId));
public static string initUploadPart(ShopLoginInfo shop, string submitJson, string prodId, int time1, int time2) => Html(Api.initUploadPart(shop.Cookies, submitJson, prodId, time1, time2));
public static string listingAuditFree(ShopLoginInfo shop, WXUploadProductParam parameter, string prodId, int time1, int time2) => Html(Api.listingAuditFree(shop.Cookies, Json(parameter), prodId, time1, time2));
public static string listingAuditFree(ShopLoginInfo shop, string prodStr, string prodId, int time1, int time2) => Html(Api.listingAuditFree(shop.Cookies, prodStr, prodId, time1, time2));
public static string uploadPartBinary(ShopLoginInfo shop, string initFileName, string blobPath, string uploadId, string prodId, int time1, int time2) => Html(Api.uploadPartBinary(shop.Cookies, initFileName, blobPath, uploadId, prodId, time1, time2));
public static string completeUploadPart(ShopLoginInfo shop, string completeJson, string prodId, int time1, int time2) => Html(Api.completeUploadPart(shop.Cookies, completeJson, prodId, time1, time2));
public static string addAddress(ShopLoginInfo shop, string provinceName, string cityName, string countyName, string detailInfo, string userName, string telNumber) => Html(Api.addAddress(shop.Cookies, provinceName, cityName, countyName, detailInfo, userName, telNumber));
public static string GetApiServiceList(ShopLoginInfo shop) => Html(Api.GetApiServiceList(shop.Cookies));
public static string GetAndUpdateWebStatus(ShopLoginInfo shop) => Html(Api.GetAndUpdateWebStatus(shop.Cookies));
public static string addLeagueItemForUpdatingProduct(ShopLoginInfo shop, int itemSwitch, int itemRatio, int headSupplierItemSwitch, int headSupplierItemRatio, long prodId, int updType = 2) => Html(Api.addLeagueItemForUpdatingProduct(shop.Cookies, itemSwitch, itemRatio, headSupplierItemSwitch, headSupplierItemRatio, prodId, updType));
public static string generalProductInfoRecommend(ShopLoginInfo shop, WXUploadProductInfoRecommendParam parameter) => Html(Api.generalProductInfoRecommend(shop.Cookies, parameter.productId, Json(parameter)));
}