1、增加图片视频
2、优化代码结构 3、up主下载分类逻辑可配置
This commit is contained in:
@@ -6,9 +6,9 @@ using SqlSugar;
|
||||
|
||||
namespace dy.net.repository
|
||||
{
|
||||
public class UserRepository : BaseRepository<LoginUserInfo>
|
||||
public class AdminUserRepository : BaseRepository<AdminUserInfo>
|
||||
{
|
||||
public UserRepository(ISqlSugarClient db) : base(db)
|
||||
public AdminUserRepository(ISqlSugarClient db) : base(db)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace dy.net.repository
|
||||
}
|
||||
|
||||
|
||||
public async Task<LoginUserInfo> GetUser(string userName=null)
|
||||
public async Task<AdminUserInfo> GetUser(string userName=null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(userName))
|
||||
{
|
||||
@@ -89,7 +89,7 @@ namespace dy.net.repository
|
||||
/// </summary>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <returns></returns>
|
||||
public (int code, string erro) InitUser(LoginUserInfo userInfo)
|
||||
public (int code, string erro) InitUser(AdminUserInfo userInfo)
|
||||
{
|
||||
var isInit = this.GetFirst(x=>!string.IsNullOrWhiteSpace(x.Id));
|
||||
if (isInit!=null)
|
||||
@@ -3,22 +3,22 @@ using SqlSugar;
|
||||
|
||||
namespace dy.net.repository
|
||||
{
|
||||
public class DyCookieRepository : BaseRepository<DyUserCookies>
|
||||
public class DouyinUserCookieRepository : BaseRepository<DouyinUserCookie>
|
||||
{
|
||||
// 注入SQLSugar客户端
|
||||
public DyCookieRepository(ISqlSugarClient db) : base(db)
|
||||
public DouyinUserCookieRepository(ISqlSugarClient db) : base(db)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<DyUserCookies>> GetAllCookies()
|
||||
public async Task<List<DouyinUserCookie>> GetAllCookies()
|
||||
{
|
||||
return await this.GetListAsync(x=>x.Status==1);
|
||||
}
|
||||
|
||||
|
||||
public async Task<(List<DyUserCookies> list, int totalCount)> GetPagedAsync(int pageIndex, int pageSize)
|
||||
public async Task<(List<DouyinUserCookie> list, int totalCount)> GetPagedAsync(int pageIndex, int pageSize)
|
||||
{
|
||||
var where = this.Db.Queryable<DyUserCookies>();
|
||||
var where = this.Db.Queryable<DouyinUserCookie>();
|
||||
|
||||
var totalCount = await where.CountAsync();
|
||||
var list = await where.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToListAsync();
|
||||
@@ -6,10 +6,10 @@ using System.Linq;
|
||||
|
||||
namespace dy.net.repository
|
||||
{
|
||||
public class DyCollectVideoRepository : BaseRepository<DyCollectVideo>
|
||||
public class DouyinVideoRepository : BaseRepository<DouyinVideo>
|
||||
{
|
||||
// 注入SQLSugar客户端
|
||||
public DyCollectVideoRepository(ISqlSugarClient db) : base(db)
|
||||
public DouyinVideoRepository(ISqlSugarClient db) : base(db)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace dy.net.repository
|
||||
/// <param name="tag">可选标签过滤</param>
|
||||
/// <param name="author">可选作者过滤</param>
|
||||
/// <returns>分页结果(视频列表和总数)</returns>
|
||||
public async Task<(List<DyCollectVideo> list, int totalCount)> GetPagedAsync(int pageIndex, int pageSize, string tag = null, string author = null,string viedoType=null, List<string> dates = null)
|
||||
public async Task<(List<DouyinVideo> list, int totalCount)> GetPagedAsync(int pageIndex, int pageSize, string tag = null, string author = null,string viedoType=null, List<string> dates = null)
|
||||
{
|
||||
|
||||
DateTime? start = null;
|
||||
@@ -38,7 +38,7 @@ namespace dy.net.repository
|
||||
start = Convert.ToDateTime(dates[0]);
|
||||
}
|
||||
|
||||
var where = this.Db.Queryable<DyCollectVideo>()
|
||||
var where = this.Db.Queryable<DouyinVideo>()
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(tag), x => x.Tag1 == tag)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(author), x => x.Author == author)
|
||||
.WhereIF(start.HasValue, x => x.SyncTime >= start.Value)
|
||||
@@ -49,7 +49,7 @@ namespace dy.net.repository
|
||||
var totalCount = await where.CountAsync();
|
||||
var list = await where.OrderByDescending(x=>x.SyncTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToListAsync();
|
||||
if (list.Any()) {
|
||||
var users= await this.Db.Queryable<DyUserCookies>().ToListAsync();
|
||||
var users= await this.Db.Queryable<DouyinUserCookie>().ToListAsync();
|
||||
foreach (var item in list)
|
||||
{
|
||||
var user= users.FirstOrDefault(x=>x.Id== item.CookieId);
|
||||
@@ -72,7 +72,7 @@ namespace dy.net.repository
|
||||
public async Task<(string, string)> GetUperLastViedoFileName(string AuthorId,string ViedoNameSimplify)
|
||||
{
|
||||
|
||||
var video= await this.Db.Queryable<DyCollectVideo>().Where(x => x.AuthorId == AuthorId && x.ViedoType == "3")
|
||||
var video= await this.Db.Queryable<DouyinVideo>().Where(x => x.AuthorId == AuthorId && x.ViedoType == "3")
|
||||
.Where(x => x.VideoTitleSimplify == ViedoNameSimplify)
|
||||
.OrderByDescending(x => x.CreateTime).FirstAsync();
|
||||
|
||||
Reference in New Issue
Block a user