飞牛fpk打包,新增一个初始化页面。用于飞牛fpk安装完成后初始配置
This commit is contained in:
@@ -5,7 +5,7 @@ using dy.net.utils;
|
||||
using SqlSugar;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
//using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
namespace dy.net.service
|
||||
{
|
||||
@@ -59,7 +59,8 @@ namespace dy.net.service
|
||||
FollowedTitleSeparator = "",
|
||||
AutoDistinct = true,//默认开启
|
||||
PriorityLevel = "[{\"id\":1,\"name\":\"喜欢的视频\",\"sort\":1},{\"id\":2,\"name\":\"收藏的视频\",\"sort\":2},{\"id\":3,\"name\":\"关注的视频\",\"sort\":3}]",
|
||||
IsFirstRunning = true
|
||||
IsFirstRunning = true,
|
||||
OnlySyncNew = true
|
||||
};
|
||||
sqlSugarClient.Insertable(config).ExecuteCommand();
|
||||
return config;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using ClockSnowFlake;
|
||||
using dy.net.dto;
|
||||
using dy.net.model;
|
||||
using dy.net.repository;
|
||||
using SqlSugar;
|
||||
@@ -26,12 +27,22 @@ namespace dy.net.service
|
||||
{
|
||||
return _cookieRepository.GetAllAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> IsInit()
|
||||
{
|
||||
return await _cookieRepository.ExistsAsync(x => !string.IsNullOrEmpty(x.Id));
|
||||
}
|
||||
public async Task<bool> Add(DouyinCookie dyUserCookies)
|
||||
{
|
||||
return await _cookieRepository.InsertAsync(dyUserCookies);
|
||||
}
|
||||
|
||||
public async Task<bool> Switch(DouyinCookieStopDto dto)
|
||||
{
|
||||
return await _cookieRepository.SwitchAsync(dto);
|
||||
}
|
||||
public bool InitCookie()
|
||||
{
|
||||
var exist = _cookieRepository.GetDefault();
|
||||
@@ -41,7 +52,7 @@ namespace dy.net.service
|
||||
}
|
||||
var cookie = new DouyinCookie
|
||||
{
|
||||
UserName = "douyin",
|
||||
UserName = "douyin2025",
|
||||
Cookies = "-",
|
||||
SecUserId = "-",
|
||||
Id = IdGener.GetLong().ToString(),
|
||||
@@ -96,5 +107,23 @@ namespace dy.net.service
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将所有同步类型的同步状态改为已同步,这样,之后就不会再扫描所有接口数据,只会读取最新一页的数据了
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SetOnlySyncNew()
|
||||
{
|
||||
var cks= await _cookieRepository.GetAllAsync();
|
||||
|
||||
foreach (var item in cks)
|
||||
{
|
||||
item.CollHasSyncd = 1;
|
||||
item.FavHasSyncd = 1;
|
||||
item.UperSyncd = 1;
|
||||
}
|
||||
var d= await _cookieRepository.UpdateRangeAsync(cks);
|
||||
return d>0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace dy.net.service
|
||||
/// <param name="followInfos"></param>
|
||||
/// <param name="ck"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> Sync(List<FollowingsItem> followInfos, DouyinCookie ck)
|
||||
public async Task<(int add, int update, bool succ)> Sync(List<FollowingsItem> followInfos, DouyinCookie ck)
|
||||
{
|
||||
return await _followRepository.Sync(followInfos, ck);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user