fix(clothes): 保护失败原因并可靠回退额度
仅属主可查看失败原因,分享只读场景置空;额度回退改用独立 ctx,避免客户端断开导致回退失败;新增 ImageProcessStatus 与 FailReason 响应字段,并抽取 detachedCtx 复用后台任务上下文。
This commit is contained in:
@@ -172,7 +172,12 @@ func (s *ClosetShareService) Detail(ctx context.Context, userID int64, shareUUID
|
||||
}
|
||||
clothesResp := make([]dto.ClothesGetByUUIDResponse, 0, len(clothesList))
|
||||
for i := range clothesList {
|
||||
clothesResp = append(clothesResp, buildClothesResponse(&clothesList[i]))
|
||||
item := buildClothesResponse(&clothesList[i])
|
||||
// 非属主只读查看:不暴露内部失败原因
|
||||
if !isOwner {
|
||||
item.FailReason = ""
|
||||
}
|
||||
clothesResp = append(clothesResp, item)
|
||||
}
|
||||
|
||||
// 记录接收关系:登录且非属主用户成功访问即视为收到,幂等,失败不阻断详情返回。
|
||||
|
||||
Reference in New Issue
Block a user