Browse Source

取消精简标题非空验证

qianyi
shanji 2 years ago
parent
commit
44a03cc261
  1. 4
      BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs
  2. 2
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs
  3. 17
      BBWY.Test/JDProductAPITest.cs
  4. 2
      BBWY.Test/Program.cs

4
BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs

@ -87,8 +87,8 @@ namespace BBWY.Server.Business
if (request.GiftTemplateId == 0 && string.IsNullOrEmpty(request.MainProductGiftSku))
throw new BusinessException("赠品模板和主商品赠品SKU至少具备一个");
if (string.IsNullOrEmpty(request.SimpleTitle) || string.IsNullOrEmpty(request.FullTitle))
throw new BusinessException("缺少精简标题或完整标题");
if (string.IsNullOrEmpty(request.FullTitle))
throw new BusinessException("缺少完整标题");
if (string.IsNullOrEmpty(request.ActivityName))
throw new BusinessException("缺少活动名称");

2
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -752,7 +752,7 @@ namespace BBWY.Server.Business
var req = new WareWriteUpdateWareTitleRequest();
req.wareId = wareId;
//req.title = request.SimpleTitle;
if (!request.SimpleTitle.StartsWith(brandName))
if (string.IsNullOrEmpty(request.SimpleTitle) || !request.SimpleTitle.StartsWith(brandName))
req.title = $"{brandName}{request.SimpleTitle}";
else
req.title = request.SimpleTitle;

17
BBWY.Test/JDProductAPITest.cs

@ -26,6 +26,23 @@ namespace BBWY.Test
Console.WriteLine(JsonConvert.SerializeObject(response));
}
public void GetSpu(IJdClient client, string token, string spu)
{
var req_productList = new WareReadSearchWare4ValidRequest()
{
orderField = "modified",
orderType = "desc",
pageSize = 50,
pageNo = 1,
field = "created,logo,brandName"
};
req_productList.wareId = spu;
var res = client.Execute(req_productList, token, DateTime.Now.ToLocalTime());
Console.WriteLine(JsonConvert.SerializeObject(res));
}
public void QueryOrderCount(IJdClient client, string token)
{
var req = new ActyQueryRegistrationDataCountRequest();

2
BBWY.Test/Program.cs

@ -39,7 +39,7 @@ namespace BBWY.Test
IJdClient client = GetJdClient(appkey, appSecret);
var test1 = new JDProductAPITest();
test1.GetPromotionDetailById(client, token);
test1.GetSpu(client, token, "10023500913672");
Console.ReadKey();

Loading…
Cancel
Save