Browse Source

更新云鼎

master
sanji 1 year ago
parent
commit
afabe2c87f
  1. 13
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs
  2. 5
      BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
  3. 11
      BBWY.Server.Model/Dto/Request/JD/GetCategoryInfoByIdRequest.cs
  4. 13
      JD.API/Controllers/PlatformSDKController.cs

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

@ -2097,5 +2097,18 @@ namespace BBWY.Server.Business
// throw new BusinessException($"设置全国仓库存失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}");
}
}
public override JToken GetCategoryInfoById(GetCategoryInfoByIdRequest request)
{
var jdClient = GetJdClient(request.AppKey, request.AppSecret);
var req = new CategoryReadFindByIdRequest();
req.cid = request.CategoryId;
req.field = "id,fid,name,lev";
var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime());
if (res.Json == null)
res.Json = JObject.Parse(res.Body);
return res.Json["jingdong_category_read_findById_responce"]["category"];
}
}
}

5
BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs

@ -304,5 +304,10 @@ namespace BBWY.Server.Business
{
throw new NotImplementedException();
}
public virtual JToken GetCategoryInfoById(GetCategoryInfoByIdRequest request)
{
throw new NotImplementedException();
}
}
}

11
BBWY.Server.Model/Dto/Request/JD/GetCategoryInfoByIdRequest.cs

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Server.Model.Dto.Request.JD
{
public class GetCategoryInfoByIdRequest:PlatformRequest
{
public int CategoryId { get; set; }
}
}

13
JD.API/Controllers/PlatformSDKController.cs

@ -498,9 +498,20 @@ namespace JD.API.API.Controllers
/// </summary>
/// <param name="request"></param>
[HttpPost]
public void SetSkuStockNum([FromBody]SetSkuStockNumRequest request)
public void SetSkuStockNum([FromBody] SetSkuStockNumRequest request)
{
platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).SetSkuStockNum(request);
}
/// <summary>
/// 获取类目信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public JToken GetCategoryInfoById([FromBody] GetCategoryInfoByIdRequest request)
{
return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetCategoryInfoById(request);
}
}
}

Loading…
Cancel
Save