提交代码

This commit is contained in:
zpc 2024-08-28 16:08:00 +08:00
parent 49754cc173
commit 42c9bb973f

View File

@ -48,7 +48,7 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
//}
/// <summary>
/// ${tenant}/zfb/${orderId} http://localhost:90/api/Pay/default/wx/WX0T1724769806U000002P001M001RLZ/c2e0468ed21e79ebb4f3164b2a3209ac
///
/// </summary>
/// <returns></returns>
[HttpPost("{tenant?}/{pay?}/{orderId?}/{sign?}")]
@ -76,7 +76,7 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
var redis = RedisConnection.GetRedis(appConfig);
if (!redis.StringSetLock(baseKey, "", 10))
{
return "error;重复请求";
return "success";
}
var temantInfo = serviceProvider.GetRequiredService<ITenantInfo>();
appConfig.ToITenantInfo(temantInfo);
@ -90,7 +90,7 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
if (intentOrder.Status != (int)OrderState.)
{
redis.KeyDelete(baseKey);
return $"error;订单{((OrderState)intentOrder.Status).ToString()}";
return $"success";
}
intentOrder.Status = (int)OrderState.;
await dao.daoDbMiaoYu.context.SaveChangesAsync();
@ -123,10 +123,11 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
}
catch (Exception ex)
{
logger.LogError($"请求支付回调接口,发货失败,请求路径: {context.Request.Path}", ex);
intentOrder.Status = (int)OrderState.;
dao.daoDbMiaoYu.context.SaveChanges();
logger.LogError($"请求支付回调接口,发货失败,请求路径: {context.Request.Path}", ex);
await dao.daoDbMiaoYu.context.SaveChangesAsync();
redis.KeyDelete(baseKey);
return $"error;出现异常{ex.Message}";
}
}