修复关注列表-新增非关注博主,丢失的bug

This commit is contained in:
jianzhichu
2025-12-02 09:20:11 +08:00
parent 6c99825548
commit de5813a874
9 changed files with 33 additions and 13 deletions
+4
View File
@@ -107,6 +107,10 @@ namespace dy.net.service
END;";
sqlSugarClient.Ado.ExecuteCommand(sql);
//更新关注表的IsNoFollowed字段为空的数据为0--兼容老版本-新加的字段
string followUpdateSql = @"Update dy_follow SET IsNoFollowed=0 WHERE IsNoFollowed is NULL";
sqlSugarClient.Ado.ExecuteCommand(followUpdateSql);
//var collectViedos = sqlSugarClient.Queryable<DouyinVideo>().ToList();
//if (collectViedos.Any())
+1
View File
@@ -31,6 +31,7 @@ namespace dy.net.service
}
followed.Id = IdGener.GetLong().ToString();
followed.LastSyncTime = DateTime.UtcNow;
followed.IsNoFollowed = true;
return await _followRepository.InsertAsync(followed);
}
+15 -6
View File
@@ -257,18 +257,27 @@ namespace dy.net.service
{
var data = await respose.Content.ReadAsStringAsync();
var res= JsonConvert.DeserializeObject<DouyinFollowInfo>(data);
if(res.Followings==null)
if (res != null)
{
var err= JsonConvert.DeserializeObject<FollowErrorDto>(data);
Serilog.Log.Error($"SyncMyFollows error: {err.StatusMsg}");
if (err != null)
if (res.Followings == null)
{
callBack(err);
var err = JsonConvert.DeserializeObject<FollowErrorDto>(data);
if (err != null)
{
Serilog.Log.Error($"SyncMyFollows error: {err.StatusMsg}");
callBack(err);
}
}
else
{
callBack(new FollowErrorDto { StatusCode = 0 });
}
}
else
{
callBack(new FollowErrorDto { StatusCode = 0 });
Serilog.Log.Error($"SyncMyFollows error: 反序列化结果为空,接口返回数据:{data}");
callBack(new FollowErrorDto { StatusCode = 8,StatusMsg="未知" });
}
return res;
}
+1 -1
View File
@@ -51,7 +51,7 @@ namespace dy.net.service
//关注的用户的作品
DelayAndStartJobAsync("uper", expression, delayBetweenJobs * 2),
//关注列表
DelayAndStartJobAsync("follow_user", expression, delayBetweenJobs * 3)
DelayAndStartJobAsync("follow_user", (Convert.ToInt32(expression)*2*24).ToString(), delayBetweenJobs * 3)
};
var results = await Task.WhenAll(jobTasks);