添加非关注博主,验证是否已存在

This commit is contained in:
jianzhichu
2025-12-01 21:53:24 +08:00
parent 4e561a8e94
commit 6c99825548
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -24,6 +24,11 @@ namespace dy.net.service
/// <returns></returns>
public async Task<bool> AddAsync(DouyinFollowed followed)
{
var foll= await _followRepository.GetFirstAsync(x=>x.SecUid==followed.SecUid && x.mySelfId== followed.mySelfId);
if(foll!=null)
{
return false;
}
followed.Id = IdGener.GetLong().ToString();
followed.LastSyncTime = DateTime.UtcNow;
return await _followRepository.InsertAsync(followed);