From e5cc6aa90d10102a1b453d31fc5e71196c2dfb8b Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Fri, 3 Feb 2023 01:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E9=BC=8E=E5=BC=80=E5=A7=8B=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=BF=94=E5=9B=9E=E4=B8=8A=E6=9E=B6=E8=B5=A0=E5=93=81?= =?UTF-8?q?=EF=BC=8Cbbwy=E5=BC=80=E5=A7=8B=E4=BB=BB=E5=8A=A1=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E4=B8=8A=E6=9E=B6=E8=B5=A0=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Common/Http/RestAPIService.cs | 8 +- .../EvaluationAssistantBusiness.cs | 59 ++++++- .../PlatformSDK/JDBusiness.cs | 155 +++++++++--------- .../PlatformSDK/PDDBusiness.cs | 2 +- .../PlatformSDK/PlatformSDKBusiness.cs | 12 +- .../PlatformSDK/TaoBaoBusiness.cs | 2 +- .../PlatformSDK/_1688Business.cs | 2 +- .../Db/EvaluationAssistant/PromotionTask.cs | 12 ++ .../StartPromotionTaskRequest.cs | 18 ++ .../PromotionTask/PromotionTaskResponse.cs | 10 ++ .../StartPromotionTaskResponse.cs | 13 ++ JD.API/Controllers/PlatformSDKController.cs | 7 +- 12 files changed, 203 insertions(+), 97 deletions(-) create mode 100644 BBWY.Server.Model/Dto/Response/PromotionTask/StartPromotionTaskResponse.cs diff --git a/BBWY.Common/Http/RestAPIService.cs b/BBWY.Common/Http/RestAPIService.cs index f6cfc883..dbcc97a9 100644 --- a/BBWY.Common/Http/RestAPIService.cs +++ b/BBWY.Common/Http/RestAPIService.cs @@ -48,7 +48,8 @@ namespace BBWY.Common.Http bool enableRandomTimeStamp = false, bool getResponseHeader = false, HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseContentRead, - string httpClientName = "") + string httpClientName = "", + int timeOutSeconds = 0) { //Get和Delete强制使用QueryString形式传参 if (httpMethod == HttpMethod.Get) @@ -71,7 +72,10 @@ namespace BBWY.Common.Http using (var httpClient = string.IsNullOrEmpty(httpClientName) ? httpClientFactory.CreateClient() : httpClientFactory.CreateClient(httpClientName)) { - httpClient.Timeout = TimeOut; + if (timeOutSeconds == 0) + httpClient.Timeout = TimeOut; + else + httpClient.Timeout = TimeSpan.FromSeconds(timeOutSeconds); using (var request = new HttpRequestMessage(httpMethod, url)) { if (requestHeaders != null && requestHeaders.Count > 0) diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs index 6908bd68..d2c72187 100644 --- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs +++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs @@ -375,17 +375,64 @@ namespace BBWY.Server.Business if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK) throw new BusinessException(httpApiResult.Content); - var response = JsonConvert.DeserializeObject>(httpApiResult.Content); + var response = JsonConvert.DeserializeObject>(httpApiResult.Content); if (!response.Success) throw new BusinessException(response.Msg); - var promotionId = response.Data; - if (promotionId == null || promotionId == 0) - return; - fsql.Update(request.Id).Set(pt => pt.PromotionId, promotionId) + var startResponse = response.Data; + + if (dbPromotionTask.GiftTemplateId != null && + dbPromotionTask.GiftTemplateId != 0 && + startResponse.DeleteGiftSkuList != null && + startResponse.DeleteGiftSkuList.Count() != 0) + dbPromotionTask.GiftTemplatePutNewSku = string.Join(",", startResponse.DeleteGiftSkuList); + + + fsql.Update(request.Id).Set(pt => pt.PromotionId, startResponse.JDPromotionId) + .SetIf(!string.IsNullOrEmpty(dbPromotionTask.GiftTemplatePutNewSku), pt => pt.GiftTemplatePutNewSku, dbPromotionTask.GiftTemplatePutNewSku) .Set(pt => pt.StartTime, DateTime.Now) .Set(pt => pt.EndTime, DateTime.Now.AddDays(180)) .Set(pt => pt.Status, Enums.PromitionTaskStatus.进行中) .ExecuteAffrows(); + + //开启延迟任务 + Task.Factory.StartNew(() => StartPromotionDelayTask(request, startResponse, dbPromotionTask), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.JDPromotionDelayTaskScheduler); + } + + private void StartPromotionDelayTask(StartPromotionTaskRequest request, StartPromotionTaskResponse startResponse, PromotionTask promotionTask) + { + var host = GetPlatformRelayAPIHost(Enums.Platform.京东); + + var httpApiResult = restApiService.SendRequest(host, "api/PlatformSDK/StartJDPromotionDelayTask", new StartPromotionTaskDelayRequest() + { + Platform = Enums.Platform.京东, + AppKey = request.AppKey, + AppSecret = request.AppSecret, + AppToken = request.AppToken, + BrandName = startResponse.BrandName, + FullTitle = promotionTask.FullTitle, + JDPromotionId = startResponse.JDPromotionId, + MainProductSpu = promotionTask.MainProductSpu, + HaveGiftTemplate = promotionTask.GiftTemplateId != null && promotionTask.GiftTemplateId != 0, + DeleteGiftSkuList = startResponse.DeleteGiftSkuList + }, GetYunDingRequestHeader(), HttpMethod.Post, timeOutSeconds: 150); + + var errorBack = new Action((id, errorMsg) => + { + fsql.Update(id).Set(pt => pt.Status, Enums.PromitionTaskStatus.已停止) + .Set(pt => pt.ErrorMsg, errorMsg) + .ExecuteAffrows(); + }); + if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK) + { + errorBack(promotionTask.Id, httpApiResult.Content); + return; + } + var response = JsonConvert.DeserializeObject>(httpApiResult.Content); + if (!response.Success) + { + errorBack(promotionTask.Id, response.Msg); + return; + } } /// @@ -495,8 +542,6 @@ namespace BBWY.Server.Business } #endregion - - #region 自动任务 public void StartMonitor(long? shopId) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index ce9d4807..01dac4ea 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -35,7 +35,7 @@ namespace BBWY.Server.Business }; - public JDBusiness(IMemoryCache memoryCache, NLogManager nLogManager, TaskSchedulerManager taskSchedulerManager) : base(memoryCache, nLogManager, taskSchedulerManager) { } + public JDBusiness(IMemoryCache memoryCache, NLogManager nLogManager) : base(memoryCache, nLogManager) { } private IJdClient GetJdClient(string appKey, string appSecret) { @@ -695,22 +695,36 @@ namespace BBWY.Server.Business } } - private void RollBackWhenStartPromotionError(DeleteSkuListRequest deleteSkuRequest, StartPromotionTaskRequest2 startRequest, string brandName, bool haveGiftTemplateSku) + private void RollBackWhenStartPromotionError(string appKey, + string appSecret, + string appToken, + IList deleteSkuList, + string mainProductSpu, + string fullTitle, + string brandName, + bool haveGiftTemplateSku) { - var jdClient = GetJdClient(deleteSkuRequest.AppKey, deleteSkuRequest.AppSecret); + var jdClient = GetJdClient(appKey, appSecret); if (haveGiftTemplateSku) - DeleteSkuList(deleteSkuRequest); + DeleteSkuList(new DeleteSkuListRequest() + { + AppKey = appKey, + AppSecret = appSecret, + AppToken = appToken, + Platform = Enums.Platform.京东, + SkuList = deleteSkuList + }); #region 设置完整标题 { var req = new WareWriteUpdateWareTitleRequest(); - req.wareId = long.Parse(startRequest.MainProductSpu); - if (!startRequest.FullTitle.StartsWith(brandName)) - req.title = $"{brandName}{startRequest.FullTitle}"; + req.wareId = long.Parse(mainProductSpu); + if (!fullTitle.StartsWith(brandName)) + req.title = $"{brandName}{fullTitle}"; else - req.title = startRequest.FullTitle; - var response = jdClient.Execute(req, startRequest.AppToken, DateTime.Now.ToLocalTime()); + req.title = fullTitle; + var response = jdClient.Execute(req, appToken, DateTime.Now.ToLocalTime()); if (response.IsError) throw new BusinessException($"设置完整标题出错-{(string.IsNullOrEmpty(response.ErrorMsg) ? response.ErrMsg : response.ErrorMsg)}"); } @@ -766,7 +780,7 @@ namespace BBWY.Server.Business } } - public override long StartJDPromotionTask(StartPromotionTaskRequest2 request) + public override StartPromotionTaskResponse StartJDPromotionTask(StartPromotionTaskRequest2 request) { var stepText = string.Empty; //stepText.AppendLine($"任务Id {request.Id} 店铺Id {request.ShopId}"); @@ -1051,14 +1065,7 @@ namespace BBWY.Server.Business } catch (Exception ex) { - RollBackWhenStartPromotionError(new DeleteSkuListRequest() - { - AppKey = request.AppKey, - AppSecret = request.AppSecret, - AppToken = request.AppToken, - Platform = request.Platform, - SkuList = giftSkuIdList - }, request, brandName, haveGiftTemplateSku); + RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, giftSkuIdList, request.MainProductSpu, request.FullTitle, brandName, true); throw ex; } } @@ -1103,7 +1110,7 @@ namespace BBWY.Server.Business res.Json = JObject.Parse(res.Body); if (res.IsError) { - RollBackWhenStartPromotionError(deleteGiftSkuRequest, request, brandName, haveGiftTemplateSku); + RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, giftSkuIdList, request.MainProductSpu, request.FullTitle, brandName, haveGiftTemplateSku); throw new BusinessException($"创建活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); } @@ -1149,36 +1156,20 @@ namespace BBWY.Server.Business var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); if (res.IsError) { - RollBackWhenStartPromotionError(deleteGiftSkuRequest, request, brandName, haveGiftTemplateSku); + RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, giftSkuIdList, request.MainProductSpu, request.FullTitle, brandName, haveGiftTemplateSku); throw new BusinessException($"创建活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); } } #endregion - Task.Factory.StartNew(() => StartJDPromotionTaskDelay(deleteGiftSkuRequest, request, brandName, promotionId), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.JDPromotionDelayTaskScheduler); - - //#region 下架赠品sku - //stepText = "下架赠品sku"; - //Thread.Sleep(5000); - //DeleteSkuList(deleteGiftSkuRequest); - //#endregion - - //#region 设置完整标题 - //{ - // stepText = "设置完整标题"; - // var req = new WareWriteUpdateWareTitleRequest(); - // req.wareId = long.Parse(request.MainProductSpu); - // if (!request.FullTitle.StartsWith(brandName)) - // req.title = $"{brandName}{request.FullTitle}"; - // else - // req.title = request.FullTitle; - // var response = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); - // if (response.IsError) - // throw new BusinessException($"设置完整标题出错-{(string.IsNullOrEmpty(response.ErrorMsg) ? response.ErrMsg : response.ErrorMsg)}"); - //} - //#endregion - - return promotionId; + //Task.Factory.StartNew(() => StartJDPromotionTaskDelay(deleteGiftSkuRequest, request, brandName, promotionId), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.JDPromotionDelayTaskScheduler); + + return new StartPromotionTaskResponse() + { + BrandName = brandName, + JDPromotionId = promotionId, + DeleteGiftSkuList = giftSkuIdList + }; } catch (Exception ex) { @@ -1187,6 +1178,40 @@ namespace BBWY.Server.Business } } + public override void StartJDPromotionDelayTask(StartPromotionTaskDelayRequest request) + { + Thread.Sleep(30 * 1000); + try + { + CheckJDPromotionTask(request.JDPromotionId, request.AppKey, request.AppSecret, request.AppToken); + } + catch (Exception ex) + { + RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, request.DeleteGiftSkuList, request.MainProductSpu, request.FullTitle, request.BrandName, request.HaveGiftTemplate); + throw; + } + + Thread.Sleep(30 * 1000); + + #region 检查奶妈sku是否完全生效 + { + var i = 0; + while (i < 10) + { + i++; + var promotionTaskSkuList = GetPromotionTaskSku(request.AppKey, request.AppSecret, request.AppToken, request.JDPromotionId); + if (promotionTaskSkuList.Any(s => s.Value("bind_type") == 1 && s.Value("sku_status") == 0)) + { + Thread.Sleep(2000); + continue; + } + break; + } + } + #endregion + RollBackWhenStartPromotionError(request.AppKey, request.AppSecret, request.AppToken, request.DeleteGiftSkuList, request.MainProductSpu, request.FullTitle, request.BrandName, true); + } + public override void DeleteJDPromotionTask(DeleteJDPromotionTaskRequest request) { var jdClient = GetJdClient(request.AppKey, request.AppSecret); @@ -1238,22 +1263,17 @@ namespace BBWY.Server.Business { var jdClient = GetJdClient(appkey, appSecret); Thread.Sleep(3000); - //var req = new SellerPromotionCheckRequest(); - //req.promoId = promotionId; - //req.status = 4; - //var res = jdClient.Execute(req, token, DateTime.Now.ToLocalTime()); - //if (res.IsError) - //{ - // //RollBackWhenStartPromotionError(deleteGiftSkuRequest, request, brandName, haveGiftTemplateSku); - // //throw new BusinessException($"审核活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); - //} var req = new PopMarketWritePromotionGiftApproveRequest(); req.promoId = promotionId; req.requestId = Guid.NewGuid().ToString(); - PopMarketWritePromotionGiftApproveResponse response = jdClient.Execute(req, token, DateTime.Now.ToLocalTime()); - + var res = jdClient.Execute(req, token, DateTime.Now.ToLocalTime()); + if (res.IsError) + { + //RollBackWhenStartPromotionError(deleteGiftSkuRequest, request, brandName, haveGiftTemplateSku); + throw new BusinessException($"审核活动失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); + } } private List GetPromotionTaskSku(string appkey, string appSecret, string token, long promotionId) @@ -1306,30 +1326,5 @@ namespace BBWY.Server.Business }).ToList(); } - - private void StartJDPromotionTaskDelay(DeleteSkuListRequest deleteSkuRequest, StartPromotionTaskRequest2 startRequest, string brandName, long promotionId) - { - Thread.Sleep(30 * 1000); - CheckJDPromotionTask(promotionId, deleteSkuRequest.AppKey, deleteSkuRequest.AppSecret, deleteSkuRequest.AppToken); - Thread.Sleep(30 * 1000); - - #region 检查奶妈sku是否完全生效 - { - var i = 0; - while (i < 10) - { - i++; - var promotionTaskSkuList = GetPromotionTaskSku(deleteSkuRequest.AppKey, deleteSkuRequest.AppSecret, deleteSkuRequest.AppToken, promotionId); - if (promotionTaskSkuList.Any(s => s.Value("bind_type") == 1 && s.Value("sku_status") == 0)) - { - Thread.Sleep(2000); - continue; - } - break; - } - } - #endregion - RollBackWhenStartPromotionError(deleteSkuRequest, startRequest, brandName, true); - } } } diff --git a/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs b/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs index d566e79e..9566af0e 100644 --- a/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs @@ -10,7 +10,7 @@ namespace BBWY.Server.Business public class PDDBusiness : PlatformSDKBusiness { public override Enums.Platform Platform => Enums.Platform.拼多多; - public PDDBusiness(IMemoryCache memoryCache, NLogManager nLogManager, TaskSchedulerManager taskSchedulerManager) : base(memoryCache, nLogManager, taskSchedulerManager) + public PDDBusiness(IMemoryCache memoryCache, NLogManager nLogManager) : base(memoryCache, nLogManager) { } } diff --git a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs index abb740f7..bc87abff 100644 --- a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs @@ -20,13 +20,11 @@ namespace BBWY.Server.Business public virtual Enums.Platform Platform { get; } protected NLogManager nLogManager; - protected TaskSchedulerManager taskSchedulerManager; - public PlatformSDKBusiness(IMemoryCache memoryCache, NLogManager nLogManager, TaskSchedulerManager taskSchedulerManager) + public PlatformSDKBusiness(IMemoryCache memoryCache, NLogManager nLogManager) { this.memoryCache = memoryCache; this.nLogManager = nLogManager; - this.taskSchedulerManager = taskSchedulerManager; this.expirationTimeSpan = TimeSpan.FromMinutes(60); } @@ -150,7 +148,12 @@ namespace BBWY.Server.Business throw new NotImplementedException(); } - public virtual long StartJDPromotionTask(StartPromotionTaskRequest2 request) + public virtual StartPromotionTaskResponse StartJDPromotionTask(StartPromotionTaskRequest2 request) + { + throw new NotImplementedException(); + } + + public virtual void StartJDPromotionDelayTask(StartPromotionTaskDelayRequest request) { throw new NotImplementedException(); } @@ -184,5 +187,6 @@ namespace BBWY.Server.Business { throw new NotImplementedException(); } + } } diff --git a/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs b/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs index 9083c612..87366b43 100644 --- a/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs @@ -5,7 +5,7 @@ namespace BBWY.Server.Business { public class TaoBaoBusiness : PlatformSDKBusiness { - public TaoBaoBusiness(IMemoryCache memoryCache, NLogManager nLogManager, TaskSchedulerManager taskSchedulerManager) : base(memoryCache, nLogManager, taskSchedulerManager) + public TaoBaoBusiness(IMemoryCache memoryCache, NLogManager nLogManager) : base(memoryCache, nLogManager) { } diff --git a/BBWY.Server.Business/PlatformSDK/_1688Business.cs b/BBWY.Server.Business/PlatformSDK/_1688Business.cs index 2b469040..1ac4e600 100644 --- a/BBWY.Server.Business/PlatformSDK/_1688Business.cs +++ b/BBWY.Server.Business/PlatformSDK/_1688Business.cs @@ -23,7 +23,7 @@ namespace BBWY.Server.Business private RestApiService restApiService; private _1688TradeTypeCompare _1688TradeTypeCompare; - public _1688Business(IMemoryCache memoryCache, NLogManager nLogManager, RestApiService restApiService, TaskSchedulerManager taskSchedulerManager) : base(memoryCache, nLogManager,taskSchedulerManager) + public _1688Business(IMemoryCache memoryCache, NLogManager nLogManager, RestApiService restApiService) : base(memoryCache, nLogManager) { this.restApiService = restApiService; _1688TradeTypeCompare = new _1688TradeTypeCompare(); diff --git a/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs b/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs index 625ddd3d..845e36a3 100644 --- a/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs +++ b/BBWY.Server.Model/Db/EvaluationAssistant/PromotionTask.cs @@ -45,6 +45,12 @@ namespace BBWY.Server.Model.Db public string MainProductGiftSku { get; set; } + + /// + /// 赠品模板上架的Sku(开始任务之后有值),逗号间隔,可空 + /// + public string GiftTemplatePutNewSku { get; set; } + /// /// 主商品sku,逗号间隔,可空 /// @@ -114,6 +120,7 @@ namespace BBWY.Server.Model.Db /// public string CustomMotherSku { get; set; } + /// /// 任务数量 /// @@ -128,6 +135,11 @@ namespace BBWY.Server.Model.Db /// 前置任务Id /// public long? BeforeTaskId { get; set; } + + /// + /// 错误信息 + /// + public string ErrorMsg { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs index fd39899c..0a4fd60f 100644 --- a/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PromotionTask/StartPromotionTaskRequest.cs @@ -56,4 +56,22 @@ namespace BBWY.Server.Model.Dto /// public string CustomMotherSku { get; set; } } + + public class StartPromotionTaskDelayRequest : PlatformRequest + { + public string BrandName { get; set; } + + public long JDPromotionId { get; set; } + + public string MainProductSpu { get; set; } + + public string FullTitle { get; set; } + + public IList DeleteGiftSkuList { get; set; } + + /// + /// 是否包含赠品模板 + /// + public bool HaveGiftTemplate { get; set; } + } } diff --git a/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs b/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs index c6a404bd..e881da53 100644 --- a/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs +++ b/BBWY.Server.Model/Dto/Response/PromotionTask/PromotionTaskResponse.cs @@ -113,6 +113,16 @@ namespace BBWY.Server.Model.Dto /// 已完成任务量 /// public int CompletedTaskCount { get; set; } + + /// + /// 前置任务Id + /// + public long? BeforeTaskId { get; set; } + + /// + /// 错误信息 + /// + public string ErrorMsg { get; set; } } public class PromotionTaskResponse diff --git a/BBWY.Server.Model/Dto/Response/PromotionTask/StartPromotionTaskResponse.cs b/BBWY.Server.Model/Dto/Response/PromotionTask/StartPromotionTaskResponse.cs new file mode 100644 index 00000000..1c5d388f --- /dev/null +++ b/BBWY.Server.Model/Dto/Response/PromotionTask/StartPromotionTaskResponse.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace BBWY.Server.Model.Dto +{ + public class StartPromotionTaskResponse + { + public string BrandName { get; set; } + + public long JDPromotionId { get; set; } + + public IList DeleteGiftSkuList { get; set; } + } +} diff --git a/JD.API/Controllers/PlatformSDKController.cs b/JD.API/Controllers/PlatformSDKController.cs index 84e03b86..29f978c5 100644 --- a/JD.API/Controllers/PlatformSDKController.cs +++ b/JD.API/Controllers/PlatformSDKController.cs @@ -283,11 +283,16 @@ namespace JD.API.API.Controllers /// /// [HttpPost] - public long StartJDPromotionTask([FromBody] StartPromotionTaskRequest2 request) + public StartPromotionTaskResponse StartJDPromotionTask([FromBody] StartPromotionTaskRequest2 request) { return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).StartJDPromotionTask(request); } + public void StartJDPromotionDelayTask([FromBody]StartPromotionTaskDelayRequest request) + { + platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).StartJDPromotionDelayTask(request); + } + /// /// 删除京东活动 ///