跟新 未命中云数据记录
This commit is contained in:
1 parent
53a4887d35
commit
86ee692a04
2 files changed
+34
-4
No files matched your search
@@ -362,9 +362,16 @@ namespace Store.Modules.CloudProduct.Controllers
|
||||
[EndpointSummary("查询商品详情")]
|
||||
public async Task<JsonNode> GetGoodsDetail([FromQuery] long goodsId)
|
||||
{
|
||||
var raw = await GetRawDataOrThrowAsync(goodsId);
|
||||
var node = JsonNode.Parse(raw);
|
||||
return node ?? throw new AppException("商品详情解析失败", ResultCode.BusinessError);
|
||||
try
|
||||
{
|
||||
var raw = await GetRawDataOrThrowAsync(goodsId);
|
||||
var node = JsonNode.Parse(raw);
|
||||
return node ?? throw new AppException("商品详情解析失败", ResultCode.BusinessError);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
throw new AppException(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -374,7 +381,14 @@ namespace Store.Modules.CloudProduct.Controllers
|
||||
[EndpointSummary("读取商品原始数据")]
|
||||
public async Task<string> GetGoodsRawData([FromQuery] long goodsId)
|
||||
{
|
||||
return await GetRawDataOrThrowAsync(goodsId);
|
||||
try
|
||||
{
|
||||
return await GetRawDataOrThrowAsync(goodsId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new AppException(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -433,7 +447,10 @@ namespace Store.Modules.CloudProduct.Controllers
|
||||
|
||||
var raw = await _rawDataStorage.ReadAsync(goodsId);
|
||||
if (raw == null)
|
||||
{
|
||||
System.IO.File.WriteAllText("./NoGoods.txt", goodsId.ToString());
|
||||
throw new AppException($"商品原始数据不存在: {goodsId}", ResultCode.NotFound);
|
||||
}
|
||||
|
||||
return raw;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user