跟新 未命中云数据记录
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("查询商品详情")]
|
[EndpointSummary("查询商品详情")]
|
||||||
public async Task<JsonNode> GetGoodsDetail([FromQuery] long goodsId)
|
public async Task<JsonNode> GetGoodsDetail([FromQuery] long goodsId)
|
||||||
{
|
{
|
||||||
var raw = await GetRawDataOrThrowAsync(goodsId);
|
try
|
||||||
var node = JsonNode.Parse(raw);
|
{
|
||||||
return node ?? throw new AppException("商品详情解析失败", ResultCode.BusinessError);
|
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>
|
/// <summary>
|
||||||
@@ -374,7 +381,14 @@ namespace Store.Modules.CloudProduct.Controllers
|
|||||||
[EndpointSummary("读取商品原始数据")]
|
[EndpointSummary("读取商品原始数据")]
|
||||||
public async Task<string> GetGoodsRawData([FromQuery] long goodsId)
|
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>
|
/// <summary>
|
||||||
@@ -433,7 +447,10 @@ namespace Store.Modules.CloudProduct.Controllers
|
|||||||
|
|
||||||
var raw = await _rawDataStorage.ReadAsync(goodsId);
|
var raw = await _rawDataStorage.ReadAsync(goodsId);
|
||||||
if (raw == null)
|
if (raw == null)
|
||||||
|
{
|
||||||
|
System.IO.File.WriteAllText("./NoGoods.txt", goodsId.ToString());
|
||||||
throw new AppException($"商品原始数据不存在: {goodsId}", ResultCode.NotFound);
|
throw new AppException($"商品原始数据不存在: {goodsId}", ResultCode.NotFound);
|
||||||
|
}
|
||||||
|
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"dotnet-ef": {
|
||||||
|
"version": "10.0.14",
|
||||||
|
"commands": [
|
||||||
|
"dotnet-ef"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user