代码整理
This commit is contained in:
@@ -80,7 +80,7 @@ namespace dy.net.model.dto
|
||||
/// <param name="t"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public static IActionResult SuccOrFail<T>(int code,T t,string message = "")
|
||||
public static IActionResult SuccOrFail<T>(int code, T t, string message = "")
|
||||
{
|
||||
if (code == ResponseCode.Success)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ namespace dy.net.model.dto
|
||||
/// <param name="message">错误消息</param>
|
||||
/// <param name="data">附加数据</param>
|
||||
/// <returns>IActionResult</returns>
|
||||
public static IActionResult Fail<T>(string message="请求失败", int businessCode = ResponseCode.ServerError, T data = default)
|
||||
public static IActionResult Fail<T>(string message = "请求失败", int businessCode = ResponseCode.ServerError, T data = default)
|
||||
{
|
||||
var response = new DouyinApiResponse<T>
|
||||
{
|
||||
@@ -158,7 +158,7 @@ namespace dy.net.model.dto
|
||||
/// </summary>
|
||||
/// <param name="message">错误消息</param>
|
||||
/// <returns>IActionResult</returns>
|
||||
public static IActionResult Fail(string message="请求失败")
|
||||
public static IActionResult Fail(string message = "请求失败")
|
||||
{
|
||||
return Fail<object>(message, ResponseCode.ServerError);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace dy.net.model.dto
|
||||
namespace dy.net.model.dto
|
||||
{
|
||||
public class DouyinUpSecUserIdDto
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace dy.net.model.dto
|
||||
namespace dy.net.model.dto
|
||||
{
|
||||
public class DouyinVideoPageRequestDto : PageRequestDto
|
||||
{
|
||||
@@ -35,7 +33,7 @@ namespace dy.net.model.dto
|
||||
}
|
||||
|
||||
|
||||
public class FollowRequestDto: PageRequestDto
|
||||
public class FollowRequestDto : PageRequestDto
|
||||
{
|
||||
public string FollowUserName { get; set; }
|
||||
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace dy.net.model.dto
|
||||
namespace dy.net.model.dto
|
||||
{
|
||||
public class MediaMergeRequest
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace dy.net.model.dto
|
||||
namespace dy.net.model.dto
|
||||
{
|
||||
public enum VideoTypeEnum
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace dy.net.model.entity
|
||||
namespace dy.net.model.entity
|
||||
{
|
||||
[SqlSugar.SugarTable(TableName = "login_user_info")]
|
||||
public class AdminUserInfo
|
||||
{
|
||||
public string UserName { get; set;}
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
@@ -23,7 +21,7 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 原密码,不存在数据库
|
||||
/// </summary>
|
||||
[SqlSugar.SugarColumn(IsIgnore =true)]
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public string? OldPwd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System.Text.RegularExpressions;
|
||||
using SqlSugar;
|
||||
|
||||
namespace dy.net.model.entity
|
||||
{
|
||||
@@ -15,10 +13,10 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true,Length =100)]
|
||||
[SugarColumn(IsPrimaryKey = true, Length = 100)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public int Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -70,7 +68,7 @@ namespace dy.net.model.entity
|
||||
/// </summary>
|
||||
//public bool ImageViedoSaveAlone { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自动去重-逻辑是遇到相同ID的视频直接跳过
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace dy.net.model.entity
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 关联cookieId
|
||||
/// </summary>
|
||||
@@ -29,18 +29,18 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 收藏夹Id、合集Id、短剧Id
|
||||
/// </summary>
|
||||
[SugarColumn(Length =60,IsNullable =false)]
|
||||
[SugarColumn(Length = 60, IsNullable = false)]
|
||||
public string XId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 封面
|
||||
/// </summary>
|
||||
[SugarColumn(Length =500,IsNullable =true)]
|
||||
[SugarColumn(Length = 500, IsNullable = true)]
|
||||
public string CoverUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 保存文件夹
|
||||
/// </summary>
|
||||
[SugarColumn(Length =500,IsNullable =true)]
|
||||
[SugarColumn(Length = 500, IsNullable = true)]
|
||||
public string SaveFolder { get; set; }
|
||||
/// <summary>
|
||||
/// 是否开启同步
|
||||
@@ -52,9 +52,9 @@ namespace dy.net.model.entity
|
||||
/// </summary>
|
||||
public VideoTypeEnum CateType { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
[SugarColumn(IsNullable =true)]
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否已完结
|
||||
|
||||
@@ -32,16 +32,16 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 是否按收藏夹文件夹来存储视频
|
||||
/// </summary>
|
||||
public bool UseCollectFolder { get; set; }
|
||||
public bool UseCollectFolder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否下载合集
|
||||
/// </summary>
|
||||
public bool DownMix { get; set; }
|
||||
public bool DownMix { get; set; }
|
||||
/// <summary>
|
||||
/// 是否下载短剧
|
||||
/// </summary>
|
||||
public bool DownSeries { get; set; }
|
||||
public bool DownSeries { get; set; }
|
||||
/// <summary>
|
||||
/// 1 开启同步 0 关闭同步
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
|
||||
namespace dy.net.model.entity
|
||||
{
|
||||
@@ -18,18 +17,18 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 博主sec_uid
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false,Length =500)]
|
||||
[SugarColumn(IsNullable = false, Length = 500)]
|
||||
public string SecUid { get; set; }
|
||||
|
||||
[SugarColumn(IsNullable = false, Length =200)]
|
||||
[SugarColumn(IsNullable = false, Length = 200)]
|
||||
public string UperName { get; set; }
|
||||
|
||||
[SugarColumn(IsNullable = true, Length =1000)]
|
||||
[SugarColumn(IsNullable = true, Length = 1000)]
|
||||
public string UperAvatar { get; set; }
|
||||
/// <summary>
|
||||
/// 官方账号(企业认证)
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true, Length =200)]
|
||||
[SugarColumn(IsNullable = true, Length = 200)]
|
||||
public string Enterprise { get; set; }
|
||||
/// <summary>
|
||||
/// 是否开启同步
|
||||
@@ -47,25 +46,25 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 我的userId,关注者的抖音userid
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false,Length =200)]
|
||||
[SugarColumn(IsNullable = false, Length = 200)]
|
||||
public string mySelfId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 签名
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true,Length =500)]
|
||||
[SugarColumn(IsNullable = true, Length = 500)]
|
||||
public string Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 同步文件保存路径
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true,Length =500)]
|
||||
[SugarColumn(IsNullable = true, Length = 500)]
|
||||
public string SavePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 博主Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true,Length =100)]
|
||||
[SugarColumn(IsNullable = true, Length = 100)]
|
||||
public string UperId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 原视频Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable =true,Length =50)]
|
||||
[SugarColumn(IsNullable = true, Length = 50)]
|
||||
public string ViedoId { get; set; }
|
||||
/// <summary>
|
||||
/// 原保存目录
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable =true,Length =1000)]
|
||||
[SugarColumn(IsNullable = true, Length = 1000)]
|
||||
public string SavePath { get; set; }
|
||||
|
||||
public string CookieId { get; set; }
|
||||
|
||||
+27
-28
@@ -1,5 +1,4 @@
|
||||
using dy.net.extension;
|
||||
using dy.net.model.dto;
|
||||
using dy.net.model.dto;
|
||||
using dy.net.utils;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -15,17 +14,17 @@ namespace dy.net.model.entity
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string DyUserId { get; set; }
|
||||
[SugarColumn(IsIgnore =true)]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string DyUser { get; set; }
|
||||
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string CookieId { get; set; }
|
||||
/// <summary>
|
||||
/// aweme_id
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string AwemeId { get; set; }
|
||||
|
||||
public DateTime SyncTime { get; set; }
|
||||
@@ -34,34 +33,34 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 视频标题
|
||||
/// </summary>
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string VideoTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 如果配置文件 UperFileNameUseViedoTitle=true
|
||||
/// 简化后的标题 默认空 只有关注的博主的 视频会存储该字段,实际UP主的视频文件名是 VideoTitleSimplify + VideoTitleSimplifyPrefix
|
||||
/// </summary>
|
||||
[SugarColumn(Length =500,IsNullable =true)]
|
||||
[SugarColumn(Length = 500, IsNullable = true)]
|
||||
public string VideoTitleSimplify { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 精简标题的前缀 默认空,其实就是序号,类似 001-,002-
|
||||
/// </summary>
|
||||
[SugarColumn(Length =50,IsNullable =true)]
|
||||
[SugarColumn(Length = 50, IsNullable = true)]
|
||||
public string VideoTitleSimplifyPrefix { get; set; }
|
||||
/// <summary>
|
||||
/// 标签(分类)
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string Tag1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签(分类)
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string Tag2 { get; set; }
|
||||
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string Tag3 { get; set; }
|
||||
|
||||
///// <summary>
|
||||
@@ -71,59 +70,59 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 视频地址(解析会有多个取第一个)
|
||||
/// </summary>
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string VideoUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 视频下载后保存路径
|
||||
/// </summary>
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string VideoSavePath { get; set; }
|
||||
/// <summary>
|
||||
/// 视频封面地址
|
||||
/// </summary>
|
||||
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string VideoCoverUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 视频封面保存路径
|
||||
/// </summary>
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string VideoCoverSavePath { get; set; }
|
||||
/// <summary>
|
||||
/// 作者
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string Author { get; set; }
|
||||
/// <summary>
|
||||
/// 作者ID
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string AuthorId { get; set; }
|
||||
/// <summary>
|
||||
/// 作者头像
|
||||
/// </summary>
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string AuthorAvatar { get; set; }
|
||||
|
||||
[SugarColumn(Length =2000,IsNullable =true)]
|
||||
[SugarColumn(Length = 2000, IsNullable = true)]
|
||||
public string AuthorAvatarUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件hash值唯一值
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string FileHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小(字节)
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public long FileSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分辨率(如1920x1080, 3840x2160等)
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string Resolution { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -137,7 +136,7 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 1喜欢的,2收藏的,3关注的 ,4 图片视频
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public VideoTypeEnum ViedoType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -146,14 +145,14 @@ namespace dy.net.model.entity
|
||||
public int IsMergeVideo { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string ViedoTypeStr => ViedoType.GetDesc();
|
||||
public string ViedoTypeStr => ViedoType.GetDesc();
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string ViedoCate =>(string.IsNullOrWhiteSpace(Tag1) ? "" : Tag1) + "/" + (string.IsNullOrWhiteSpace(Tag2) ? "" : Tag2);
|
||||
public string ViedoCate => (string.IsNullOrWhiteSpace(Tag1) ? "" : Tag1) + "/" + (string.IsNullOrWhiteSpace(Tag2) ? "" : Tag2);
|
||||
|
||||
|
||||
// 普通字符串字段,显式标记为 SQLite TEXT 类型
|
||||
[SugarColumn(ColumnDataType = "TEXT", Length = -1,IsNullable =true)]
|
||||
[SugarColumn(ColumnDataType = "TEXT", Length = -1, IsNullable = true)]
|
||||
public string DynamicVideos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -164,7 +163,7 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 自定义收藏夹、合集、短剧 绑定的Id
|
||||
/// </summary>
|
||||
[SugarColumn(Length =200,IsNullable =true)]
|
||||
[SugarColumn(Length = 200, IsNullable = true)]
|
||||
public string CateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace dy.net.model.entity
|
||||
/// <summary>
|
||||
/// 原视频Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable =true,Length =50)]
|
||||
[SugarColumn(IsNullable = true, Length = 50)]
|
||||
public string ViedoId { get; set; }
|
||||
|
||||
public DateTime DeleteTime { get; set; }
|
||||
|
||||
[SugarColumn(IsNullable =true,Length =1000)]
|
||||
[SugarColumn(IsNullable = true, Length = 1000)]
|
||||
public string VideoTitle { get; set; }
|
||||
[SugarColumn(IsNullable = true, Length = 1000)]
|
||||
public string VideoSavePath { get; set; }
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace dy.net.model.response
|
||||
//[JsonProperty("avatar_larger")]
|
||||
//public DouyinImageResource AvatarLarger { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
//[JsonProperty("avatar_schema_list")]
|
||||
//public object AvatarSchemaList { get; set; } // 原始值为null,兼容扩展
|
||||
@@ -521,7 +521,7 @@ namespace dy.net.model.response
|
||||
|
||||
//[JsonProperty("new_story_cover")]
|
||||
//public object NewStoryCover { get; set; } // 原始值为null,兼容扩展
|
||||
|
||||
|
||||
//[JsonProperty("not_seen_item_id_list")]
|
||||
//public object UnseenItemIds { get; set; } // 原始值为null,兼容扩展
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
namespace dy.net.model.response
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user