21
This commit is contained in:
parent
4e1a57418a
commit
77987729b5
|
|
@ -80,16 +80,19 @@ public class InvitationService : IInvitationService
|
||||||
|
|
||||||
// 生成用户专属海报
|
// 生成用户专属海报
|
||||||
var shareImage = string.Empty;
|
var shareImage = string.Empty;
|
||||||
|
_logger.LogInformation("开始为用户 {UserId} 生成海报,平台: {Platform}", userId, platform);
|
||||||
var posterResult = await _posterService.GetUserPosterAsync(userId, platform);
|
var posterResult = await _posterService.GetUserPosterAsync(userId, platform);
|
||||||
if (posterResult.Success && !string.IsNullOrEmpty(posterResult.ImageUrl))
|
if (posterResult.Success && !string.IsNullOrEmpty(posterResult.ImageUrl))
|
||||||
{
|
{
|
||||||
shareImage = posterResult.ImageUrl;
|
shareImage = posterResult.ImageUrl;
|
||||||
|
_logger.LogInformation("用户 {UserId} 海报生成成功: {Url}", userId, shareImage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 如果海报生成失败,使用静态分享图片作为备选
|
// 如果海报生成失败,使用静态分享图片作为备选
|
||||||
shareImage = await GetShareImageAsync();
|
shareImage = await GetShareImageAsync();
|
||||||
_logger.LogWarning("用户 {UserId} 海报生成失败: {Message},使用静态分享图片", userId, posterResult.Message);
|
_logger.LogWarning("用户 {UserId} 海报生成失败: {Message},平台: {Platform},使用静态分享图片: {FallbackImage}",
|
||||||
|
userId, posterResult.Message, platform, shareImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new InvitationInfoResponse
|
return new InvitationInfoResponse
|
||||||
|
|
|
||||||
|
|
@ -84,3 +84,4 @@ public class UserPosterCache
|
||||||
[Column("updated_at")]
|
[Column("updated_at")]
|
||||||
public DateTime UpdatedAt { get; set; } = DateTime.Now;
|
public DateTime UpdatedAt { get; set; } = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user