mobile 更新

This commit is contained in:
jianzhichu
2025-12-19 09:52:55 +08:00
parent 086a0ea5af
commit 0549688e6f
10 changed files with 229 additions and 119 deletions
+28 -15
View File
@@ -11,12 +11,12 @@ namespace dy.net.Controllers
[ApiController] [ApiController]
public class VideoController : ControllerBase public class VideoController : ControllerBase
{ {
private readonly DouyinVideoService dyCollectVideoService; private readonly DouyinVideoService douyinVideoService;
private readonly DouyinCommonService douyinCommonService; private readonly DouyinCommonService douyinCommonService;
public VideoController(DouyinVideoService dyCollectVideoService, DouyinCommonService douyinCommonService) public VideoController(DouyinVideoService dyCollectVideoService, DouyinCommonService douyinCommonService)
{ {
this.dyCollectVideoService = dyCollectVideoService; this.douyinVideoService = dyCollectVideoService;
this.douyinCommonService = douyinCommonService; this.douyinCommonService = douyinCommonService;
} }
/// <summary> /// <summary>
@@ -27,16 +27,16 @@ namespace dy.net.Controllers
[HttpPost("paged")] [HttpPost("paged")]
public async Task<IActionResult> GetPagedAsync(DouyinVideoPageRequestDto dto) public async Task<IActionResult> GetPagedAsync(DouyinVideoPageRequestDto dto)
{ {
var (list, totalCount) = await dyCollectVideoService.GetPagedAsync(dto); var (list, totalCount) = await douyinVideoService.GetPagedAsync(dto);
return Ok(new return Ok(new
{ {
code = 0, code = 0,
data = new data = new
{ {
data = list, data = list,
total=totalCount, total = totalCount,
pageIndex=dto.PageIndex, pageIndex = dto.PageIndex,
pageSize=dto.PageSize pageSize = dto.PageSize
} }
}); });
} }
@@ -49,7 +49,7 @@ namespace dy.net.Controllers
[HttpGet("statics")] [HttpGet("statics")]
public async Task<IActionResult> GetStaticsAsync() public async Task<IActionResult> GetStaticsAsync()
{ {
var data = await dyCollectVideoService.GetStatics(); var data = await douyinVideoService.GetStatics();
return Ok(new return Ok(new
{ {
code = 0, code = 0,
@@ -68,7 +68,7 @@ namespace dy.net.Controllers
{ {
try try
{ {
var viedo = await dyCollectVideoService.GetById(vid); var viedo = await douyinVideoService.GetById(vid);
if (viedo == null) if (viedo == null)
{ {
@@ -137,7 +137,7 @@ namespace dy.net.Controllers
{ {
try try
{ {
var viedo = await dyCollectVideoService.GetById(vid); var viedo = await douyinVideoService.GetById(vid);
if (viedo == null) if (viedo == null)
{ {
@@ -191,7 +191,7 @@ namespace dy.net.Controllers
} }
else else
{ {
var result = await dyCollectVideoService.ReDownloadViedoAsync(dto); var result = await douyinVideoService.ReDownloadViedoAsync(dto);
if (result) if (result)
{ {
return Ok(new { code = 0, data = true }); return Ok(new { code = 0, data = true });
@@ -208,7 +208,7 @@ namespace dy.net.Controllers
/// <param name="vid"></param> /// <param name="vid"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("vdelete/{vid}")] [HttpGet("vdelete/{vid}")]
public async Task<IActionResult> DeleteVideo([FromRoute]string vid) public async Task<IActionResult> DeleteVideo([FromRoute] string vid)
{ {
if (string.IsNullOrWhiteSpace(vid)) if (string.IsNullOrWhiteSpace(vid))
{ {
@@ -216,14 +216,14 @@ namespace dy.net.Controllers
} }
else else
{ {
var video = await dyCollectVideoService.GetById(vid); var video = await douyinVideoService.GetById(vid);
if (video == null) if (video == null)
{ {
return Ok(new { code = -1, data = false }); return Ok(new { code = -1, data = false });
} }
else else
{ {
var result = await dyCollectVideoService.ReDownloadViedoAsync(new ReDownViedoDto { Ids = new List<string> { vid } }); var result = await douyinVideoService.ReDownloadViedoAsync(new ReDownViedoDto { Ids = new List<string> { vid } });
if (result) if (result)
{ {
//加入删除逻辑 //加入删除逻辑
@@ -243,7 +243,7 @@ namespace dy.net.Controllers
} }
} }
} }
} }
@@ -254,7 +254,20 @@ namespace dy.net.Controllers
[HttpGet("vdelete/get")] [HttpGet("vdelete/get")]
public async Task<IActionResult> GetDeleteVideo() public async Task<IActionResult> GetDeleteVideo()
{ {
return Ok(new { code = 0, data = await douyinCommonService.GetDouyinDeleteVideos() } ); return Ok(new { code = 0, data = await douyinCommonService.GetDouyinDeleteVideos() });
}
/// <summary>
/// 查询最新N条数据
/// </summary>
/// <param name="top"></param>
/// <returns></returns>
[HttpGet("top{top}")]
public async Task<IActionResult> GetLast([FromRoute]int top = 5)
{
var data =await douyinVideoService.GetLastTop(top);
return Ok(new { code = 0, data = data });
} }
} }
} }
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl> <_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl>
<History>True|2025-12-14T11:09:59.9031104Z||;True|2025-12-13T21:21:10.0022707+08:00||;True|2025-12-11T22:07:16.6229994+08:00||;True|2025-12-11T22:05:56.7363206+08:00||;True|2025-12-11T22:01:07.5862406+08:00||;True|2025-12-11T22:00:43.5796594+08:00||;True|2025-12-08T21:20:37.8369271+08:00||;False|2025-12-08T21:20:21.1646252+08:00||;True|2025-12-08T20:51:50.6845619+08:00||;True|2025-12-08T16:43:45.2425324+08:00||;False|2025-12-08T16:42:23.0308163+08:00||;True|2025-12-08T16:41:52.4103868+08:00||;True|2025-12-08T16:41:49.8972006+08:00||;False|2025-12-08T16:41:39.5343442+08:00||;True|2025-12-08T12:40:19.2430740+08:00||;True|2025-12-08T12:02:30.6005542+08:00||;True|2025-12-08T11:34:29.6673185+08:00||;False|2025-12-08T11:30:56.2857042+08:00||;True|2025-12-08T10:52:43.7427594+08:00||;True|2025-12-08T07:05:03.2845531+08:00||;True|2025-12-07T23:02:10.0037815+08:00||;True|2025-12-07T22:48:25.7859648+08:00||;True|2025-12-07T20:49:13.6683281+08:00||;True|2025-12-07T08:47:30.1236366+08:00||;True|2025-12-06T13:14:32.4410202+08:00||;True|2025-12-06T13:07:29.7182102+08:00||;True|2025-12-06T13:05:46.2855366+08:00||;False|2025-12-06T13:05:40.3550904+08:00||;True|2025-12-06T13:03:47.8773880+08:00||;True|2025-12-06T13:03:28.9521030+08:00||;True|2025-12-05T23:11:51.5026151+08:00||;True|2025-12-05T12:46:26.1415079+08:00||;False|2025-12-05T12:46:19.1274332+08:00||;True|2025-12-05T09:04:36.7111717+08:00||;True|2025-12-05T08:22:51.7343317+08:00||;True|2025-12-05T08:20:32.0383739+08:00||;True|2025-12-04T21:58:29.4112766+08:00||;True|2025-12-04T21:58:10.0382218+08:00||;True|2025-12-04T21:57:55.3894059+08:00||;True|2025-12-04T21:10:38.8943797+08:00||;True|2025-12-04T21:09:31.5024569+08:00||;True|2025-12-04T08:22:47.9617427+08:00||;False|2025-12-04T08:22:41.3759733+08:00||;True|2025-12-04T08:14:02.2478893+08:00||;True|2025-12-04T07:57:00.2208139+08:00||;True|2025-12-03T23:58:13.3693303+08:00||;True|2025-12-03T23:57:40.4257893+08:00||;True|2025-12-03T23:56:38.8717769+08:00||;True|2025-12-03T23:56:24.0663568+08:00||;False|2025-12-03T23:55:36.1902974+08:00||;True|2025-12-03T23:51:30.6688504+08:00||;True|2025-12-03T23:34:17.1648971+08:00||;False|2025-12-03T23:34:07.7649161+08:00||;True|2025-12-03T22:32:56.2435003+08:00||;True|2025-12-03T22:27:45.6059666+08:00||;True|2025-12-03T15:55:28.0186597+08:00||;False|2025-12-03T15:54:17.5032724+08:00||;True|2025-12-03T15:53:10.2273509+08:00||;True|2025-12-02T22:11:37.4645042+08:00||;False|2025-12-02T22:10:47.1320259+08:00||;True|2025-12-02T14:39:58.8932130+08:00||;True|2025-12-02T14:36:37.1529072+08:00||;True|2025-12-02T12:58:22.0951548+08:00||;True|2025-12-02T09:30:33.7066474+08:00||;True|2025-12-02T09:30:14.5481844+08:00||;True|2025-12-02T09:30:00.3123364+08:00||;False|2025-12-02T09:29:54.4615520+08:00||;True|2025-12-02T09:13:01.7995414+08:00||;False|2025-12-02T09:12:55.8360281+08:00||;True|2025-12-02T09:12:31.0156791+08:00||;True|2025-12-02T08:55:11.3773395+08:00||;True|2025-12-02T08:53:21.3927713+08:00||;False|2025-12-02T08:48:55.8638037+08:00||;True|2025-12-02T07:29:25.2192447+08:00||;False|2025-12-02T07:29:10.2504665+08:00||;True|2025-12-02T07:28:29.0769286+08:00||;True|2025-12-01T21:53:07.6474834+08:00||;True|2025-12-01T21:44:28.1674315+08:00||;True|2025-12-01T21:18:47.2119609+08:00||;True|2025-12-01T20:51:19.9948301+08:00||;True|2025-12-01T20:50:36.9904697+08:00||;True|2025-12-01T20:44:10.1695142+08:00||;True|2025-12-01T19:27:58.0479456+08:00||;True|2025-12-01T19:16:02.2288214+08:00||;False|2025-12-01T19:15:56.0372115+08:00||;True|2025-12-01T19:15:16.4854821+08:00||;False|2025-12-01T19:15:06.7001019+08:00||;True|2025-12-01T17:10:38.9739466+08:00||;False|2025-12-01T17:10:18.8928139+08:00||;True|2025-12-01T17:03:59.3171589+08:00||;True|2025-12-01T17:03:12.5681656+08:00||;True|2025-12-01T16:42:51.4415025+08:00||;True|2025-12-01T01:29:59.6975567+08:00||;True|2025-12-01T01:29:45.1898652+08:00||;False|2025-12-01T01:29:33.1787721+08:00||;True|2025-12-01T01:27:33.1297605+08:00||;True|2025-12-01T01:27:27.3976862+08:00||;False|2025-12-01T01:27:20.5193052+08:00||;True|2025-12-01T01:11:11.0210582+08:00||;True|2025-12-01T01:04:04.3307782+08:00||;</History> <History>True|2025-12-19T01:50:16.9517676Z||;True|2025-12-19T09:49:47.0871734+08:00||;False|2025-12-19T09:49:36.7638757+08:00||;True|2025-12-19T09:35:13.2489248+08:00||;True|2025-12-14T19:09:59.9031104+08:00||;True|2025-12-13T21:21:10.0022707+08:00||;True|2025-12-11T22:07:16.6229994+08:00||;True|2025-12-11T22:05:56.7363206+08:00||;True|2025-12-11T22:01:07.5862406+08:00||;True|2025-12-11T22:00:43.5796594+08:00||;True|2025-12-08T21:20:37.8369271+08:00||;False|2025-12-08T21:20:21.1646252+08:00||;True|2025-12-08T20:51:50.6845619+08:00||;True|2025-12-08T16:43:45.2425324+08:00||;False|2025-12-08T16:42:23.0308163+08:00||;True|2025-12-08T16:41:52.4103868+08:00||;True|2025-12-08T16:41:49.8972006+08:00||;False|2025-12-08T16:41:39.5343442+08:00||;True|2025-12-08T12:40:19.2430740+08:00||;True|2025-12-08T12:02:30.6005542+08:00||;True|2025-12-08T11:34:29.6673185+08:00||;False|2025-12-08T11:30:56.2857042+08:00||;True|2025-12-08T10:52:43.7427594+08:00||;True|2025-12-08T07:05:03.2845531+08:00||;True|2025-12-07T23:02:10.0037815+08:00||;True|2025-12-07T22:48:25.7859648+08:00||;True|2025-12-07T20:49:13.6683281+08:00||;True|2025-12-07T08:47:30.1236366+08:00||;True|2025-12-06T13:14:32.4410202+08:00||;True|2025-12-06T13:07:29.7182102+08:00||;True|2025-12-06T13:05:46.2855366+08:00||;False|2025-12-06T13:05:40.3550904+08:00||;True|2025-12-06T13:03:47.8773880+08:00||;True|2025-12-06T13:03:28.9521030+08:00||;True|2025-12-05T23:11:51.5026151+08:00||;True|2025-12-05T12:46:26.1415079+08:00||;False|2025-12-05T12:46:19.1274332+08:00||;True|2025-12-05T09:04:36.7111717+08:00||;True|2025-12-05T08:22:51.7343317+08:00||;True|2025-12-05T08:20:32.0383739+08:00||;True|2025-12-04T21:58:29.4112766+08:00||;True|2025-12-04T21:58:10.0382218+08:00||;True|2025-12-04T21:57:55.3894059+08:00||;True|2025-12-04T21:10:38.8943797+08:00||;True|2025-12-04T21:09:31.5024569+08:00||;True|2025-12-04T08:22:47.9617427+08:00||;False|2025-12-04T08:22:41.3759733+08:00||;True|2025-12-04T08:14:02.2478893+08:00||;True|2025-12-04T07:57:00.2208139+08:00||;True|2025-12-03T23:58:13.3693303+08:00||;True|2025-12-03T23:57:40.4257893+08:00||;True|2025-12-03T23:56:38.8717769+08:00||;True|2025-12-03T23:56:24.0663568+08:00||;False|2025-12-03T23:55:36.1902974+08:00||;True|2025-12-03T23:51:30.6688504+08:00||;True|2025-12-03T23:34:17.1648971+08:00||;False|2025-12-03T23:34:07.7649161+08:00||;True|2025-12-03T22:32:56.2435003+08:00||;True|2025-12-03T22:27:45.6059666+08:00||;True|2025-12-03T15:55:28.0186597+08:00||;False|2025-12-03T15:54:17.5032724+08:00||;True|2025-12-03T15:53:10.2273509+08:00||;True|2025-12-02T22:11:37.4645042+08:00||;False|2025-12-02T22:10:47.1320259+08:00||;True|2025-12-02T14:39:58.8932130+08:00||;True|2025-12-02T14:36:37.1529072+08:00||;True|2025-12-02T12:58:22.0951548+08:00||;True|2025-12-02T09:30:33.7066474+08:00||;True|2025-12-02T09:30:14.5481844+08:00||;True|2025-12-02T09:30:00.3123364+08:00||;False|2025-12-02T09:29:54.4615520+08:00||;True|2025-12-02T09:13:01.7995414+08:00||;False|2025-12-02T09:12:55.8360281+08:00||;True|2025-12-02T09:12:31.0156791+08:00||;True|2025-12-02T08:55:11.3773395+08:00||;True|2025-12-02T08:53:21.3927713+08:00||;False|2025-12-02T08:48:55.8638037+08:00||;True|2025-12-02T07:29:25.2192447+08:00||;False|2025-12-02T07:29:10.2504665+08:00||;True|2025-12-02T07:28:29.0769286+08:00||;True|2025-12-01T21:53:07.6474834+08:00||;True|2025-12-01T21:44:28.1674315+08:00||;True|2025-12-01T21:18:47.2119609+08:00||;True|2025-12-01T20:51:19.9948301+08:00||;True|2025-12-01T20:50:36.9904697+08:00||;True|2025-12-01T20:44:10.1695142+08:00||;True|2025-12-01T19:27:58.0479456+08:00||;True|2025-12-01T19:16:02.2288214+08:00||;False|2025-12-01T19:15:56.0372115+08:00||;True|2025-12-01T19:15:16.4854821+08:00||;False|2025-12-01T19:15:06.7001019+08:00||;True|2025-12-01T17:10:38.9739466+08:00||;False|2025-12-01T17:10:18.8928139+08:00||;True|2025-12-01T17:03:59.3171589+08:00||;True|2025-12-01T17:03:12.5681656+08:00||;True|2025-12-01T16:42:51.4415025+08:00||;True|2025-12-01T01:29:59.6975567+08:00||;True|2025-12-01T01:29:45.1898652+08:00||;False|2025-12-01T01:29:33.1787721+08:00||;True|2025-12-01T01:27:33.1297605+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+4 -4
View File
@@ -96,8 +96,8 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取,
| 镜像标签 | 架构 | | 镜像标签 | 架构 |
| ----------------- | -------------- | | ----------------- | -------------- |
| `beta_1.8.8` | x86_64 (amd64) | | `beta_1.8.9` | x86_64 (amd64) |
| `arm_1.8.8` | ARM64 | | `arm_1.8.9` | ARM64 |
### 最新镜像查看 ### 最新镜像查看
[镜像列表](http://nas.synology2023.online:10108/api/docker/dysync/1) [镜像列表](http://nas.synology2023.online:10108/api/docker/dysync/1)
@@ -115,7 +115,7 @@ docker run -d --restart=always \
-v /opt/dysync/uper:/app/uper \ -v /opt/dysync/uper:/app/uper \
-p 10103:10101 \ -p 10103:10101 \
--name dysync2025 \ --name dysync2025 \
ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_1.8.8 ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_1.8.9
# 注意:-p 后面的容器端口,可以用环境变量类似:ASPNETCORE_URLS = http://+:10108 指定 # 注意:-p 后面的容器端口,可以用环境变量类似:ASPNETCORE_URLS = http://+:10108 指定
``` ```
@@ -129,7 +129,7 @@ version: '3.8'
services: services:
dysync: dysync:
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_1.8.8 image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_1.8.9
container_name: dysync2025 # 容器名称 container_name: dysync2025 # 容器名称
restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止 restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止
ports: ports:
+161 -93
View File
@@ -5,12 +5,17 @@
<div v-if="activeTab === 'dashboard'" class="tab-content"> <div v-if="activeTab === 'dashboard'" class="tab-content">
<!-- 仅显示核心统计概览无底部详细数据 --> <!-- 仅显示核心统计概览无底部详细数据 -->
<section class="stats-overview"> <section class="stats-overview">
<!-- 总视频数卡片 --> <!-- 合并后的总视频数和空间总计卡片保留原有移动端样式 -->
<div class="stat-card primary-card main-card"> <div class="stat-card primary-card main-card">
<div class="stat-header"> <div class="stat-header">
<div class="header-left"> <div class="header-left">
<span class="stat-meta">视频总数</span> <span class="stat-meta">视频统计</span>
<div class="stat-value">{{ totalVideos }}</div> <div class="stat-value">
<div class="combined-values">
<span class="video-count">{{ totalVideos }}</span>
<span class="size-count">({{ fileSizeTotal }}G)</span>
</div>
</div>
</div> </div>
<div class="stat-icon video-icon"> <div class="stat-icon video-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@@ -20,25 +25,25 @@
</div> </div>
</div> </div>
<div class="stat-subitems"> <div class="stat-subitems">
<div class="subitem" :title="`我喜欢的视频数: ${favoriteCount}`"> <div class="subitem" :title="`我喜欢的视频数: ${favoriteCount} (占用: ${favoriteSize}G)`">
<div class="subitem-icon like-icon"> <div class="subitem-icon like-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path> <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
</svg> </svg>
</div> </div>
<span class="subitem-meta">我喜欢的</span> <span class="subitem-meta">我喜欢的</span>
<span class="subitem-value">{{ favoriteCount }}</span> <span class="subitem-value">{{ favoriteCount }} <span class="unit">({{ favoriteSize }}G)</span></span>
</div> </div>
<div class="subitem" :title="`我收藏的视频数: ${collectCount}`"> <div class="subitem" :title="`我收藏的视频数: ${collectCount} (占用: ${collectSize}G)`">
<div class="subitem-icon collect-icon"> <div class="subitem-icon collect-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path> <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path>
</svg> </svg>
</div> </div>
<span class="subitem-meta">我收藏的</span> <span class="subitem-meta">我收藏的</span>
<span class="subitem-value">{{ collectCount }}</span> <span class="subitem-value">{{ collectCount }} <span class="unit">({{ collectSize }}G)</span></span>
</div> </div>
<div class="subitem" :title="`我关注的视频数: ${followCount}`"> <div class="subitem" :title="`我关注的视频数: ${followCount} (占用: ${followSize}G)`">
<div class="subitem-icon follow-icon"> <div class="subitem-icon follow-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path> <path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
@@ -48,9 +53,9 @@
</svg> </svg>
</div> </div>
<span class="subitem-meta">我关注的</span> <span class="subitem-meta">我关注的</span>
<span class="subitem-value">{{ followCount }}</span> <span class="subitem-value">{{ followCount }} <span class="unit">({{ followSize }}G)</span></span>
</div> </div>
<div class="subitem" :title="`图文视频数: ${graphicVideoCount}`"> <div class="subitem" :title="`图文视频数: ${graphicVideoCount} (占用: ${graphicVideoSize}G)`">
<div class="subitem-icon graphic-icon"> <div class="subitem-icon graphic-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect> <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
@@ -59,74 +64,44 @@
</svg> </svg>
</div> </div>
<span class="subitem-meta">图文视频</span> <span class="subitem-meta">图文视频</span>
<span class="subitem-value">{{ graphicVideoCount }}</span> <span class="subitem-value">{{ graphicVideoCount }} <span class="unit">({{ graphicVideoSize }}G)</span></span>
</div> </div>
</div> </div>
</div> </div>
<!-- 总占用空间卡片 --> <!-- 新增 Top Videos 列表使用原有移动端卡片样式体系 -->
<div class="stat-card secondary-card main-card"> <div class="stat-card secondary-card main-card">
<div class="stat-header"> <div class="stat-header">
<div class="header-left"> <div class="header-left">
<span class="stat-meta">空间总计</span> <span class="stat-meta">最新同步</span>
<div class="stat-value">{{ fileSizeTotal }} <span class="unit">G</span></div> <!-- <div class="stat-value">TOP {{ topVideos.length }}</div> -->
</div> </div>
<div class="stat-icon size-icon"> <div class="stat-icon size-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 12H2v8h20v-8z" /> <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
<path d="M6 18h.01" /> <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
<path d="M10 18h.01" />
</svg> </svg>
</div> </div>
</div> </div>
<div class="stat-subitems"> <div class="stat-subitems video-list-container">
<div class="subitem" :title="`喜欢的视频占用: ${favoriteSize}G`"> <div v-for="(video, index) in topVideos" :key="index" class="subitem video-item" :title="video.title">
<div class="subitem-icon like-icon"> <!-- <div class="subitem-icon video-list-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <span class="video-index">{{ index + 1 }}</span>
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path> </div> -->
</svg> <div class="video-info">
<span class="subitem-meta video-title">{{ video.title }}</span>
<span class="subitem-value video-time">{{ formatVideoTime(video.time) }}</span>
</div> </div>
<span class="subitem-meta">喜欢占用</span>
<span class="subitem-value">{{ favoriteSize }} <span class="unit">G</span></span>
</div> </div>
<div class="subitem" :title="`收藏的视频占用: ${collectSize}G`"> <div v-if="topVideos.length === 0" class="empty-video-list">
<div class="subitem-icon collect-icon"> 暂无热门视频数据
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path>
</svg>
</div>
<span class="subitem-meta">收藏占用</span>
<span class="subitem-value">{{ collectSize }} <span class="unit">G</span></span>
</div>
<div class="subitem" :title="`关注的视频占用: ${followSize}G`">
<div class="subitem-icon follow-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="20" y1="8" x2="20" y2="14"></line>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
</div>
<span class="subitem-meta">关注占用</span>
<span class="subitem-value">{{ followSize }} <span class="unit">G</span></span>
</div>
<div class="subitem" :title="`图文视频占用: ${graphicVideoSize}G`">
<div class="subitem-icon graphic-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
<circle cx="8.5" cy="8.5" r="1.5"></circle>
<polyline points="21 15 16 10 5 21"></polyline>
</svg>
</div>
<span class="subitem-meta">图文占用</span>
<span class="subitem-value">{{ graphicVideoSize }} <span class="unit">G</span></span>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<!-- 日志 Tab 内容 --> <!-- 日志 Tab 内容完全保留原有样式 -->
<div v-if="activeTab === 'log'" class="tab-content log-tab"> <div v-if="activeTab === 'log'" class="tab-content log-tab">
<div class="log-header"> <div class="log-header">
<h2 class="log-title">系统日志</h2> <h2 class="log-title">系统日志</h2>
@@ -151,7 +126,6 @@
</span> </span>
<span class="log-time">{{formatShowDate(log?.date) }}</span> <span class="log-time">{{formatShowDate(log?.date) }}</span>
</div> </div>
<!-- <div class="log-message">{{ log.message }}</div> -->
<div class="log-file">{{ log.fileName }}</div> <div class="log-file">{{ log.fileName }}</div>
</div> </div>
@@ -162,7 +136,7 @@
</div> </div>
</div> </div>
<!-- 底部导航菜单 --> <!-- 底部导航菜单完全保留原有样式 -->
<div class="bottom-nav"> <div class="bottom-nav">
<div class="nav-item" :class="{ active: activeTab === 'dashboard' }" @click="activeTab = 'dashboard'"> <div class="nav-item" :class="{ active: activeTab === 'dashboard' }" @click="activeTab = 'dashboard'">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@@ -183,10 +157,9 @@
</div> </div>
</div> </div>
<!-- 日志详情弹窗 --> <!-- 日志详情弹窗完全保留原有样式 -->
<div v-if="showLogModal" class="log-modal-mask" @click="closeLogModal"> <div v-if="showLogModal" class="log-modal-mask" @click="closeLogModal">
<div class="log-modal-content" @click.stop> <div class="log-modal-content" @click.stop>
<!-- 弹窗头部 -->
<div class="log-modal-header"> <div class="log-modal-header">
<div class="header-left"> <div class="header-left">
<span class="modal-type-tag" :class="currentLog?.type.toLowerCase()"> <span class="modal-type-tag" :class="currentLog?.type.toLowerCase()">
@@ -202,13 +175,11 @@
</button> </button>
</div> </div>
<!-- 弹窗内容 -->
<div class="log-modal-body"> <div class="log-modal-body">
<div class="file-name">{{ currentLog?.fileName }}</div> <div class="file-name">{{ currentLog?.fileName }}</div>
<pre class="log-content">{{ logContent || '加载日志内容中...' }}</pre> <pre class="log-content">{{ logContent || '加载日志内容中...' }}</pre>
</div> </div>
<!-- 弹窗底部 -->
<div class="log-modal-footer"> <div class="log-modal-footer">
<button class="copy-btn" @click="copyLogContent" :disabled="!logContent"> <button class="copy-btn" @click="copyLogContent" :disabled="!logContent">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 6px;"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 6px;">
@@ -251,6 +222,13 @@ interface LogItem {
fileName: string; fileName: string;
} }
// 新增 TopVideo 类型接口
interface TopVideoItem {
title: string;
time: string;
[key: string]: any; // 其他字段
}
// 状态管理(仅保留核心数据) // 状态管理(仅保留核心数据)
const totalVideos = ref<number>(0); const totalVideos = ref<number>(0);
const fileSizeTotal = ref<string>('0.00'); const fileSizeTotal = ref<string>('0.00');
@@ -273,6 +251,9 @@ const showLogModal = ref<boolean>(false);
const currentLog = ref<LogItem | null>(null); const currentLog = ref<LogItem | null>(null);
const logContent = ref<string>(''); const logContent = ref<string>('');
// Top Videos 相关状态
const topVideos = ref<TopVideoItem[]>([]);
// 过滤后的日志列表 // 过滤后的日志列表
const filteredLogs = computed(() => { const filteredLogs = computed(() => {
if (logFilter.value === 'all') { if (logFilter.value === 'all') {
@@ -288,6 +269,7 @@ defineOptions({ name: 'StatsDashboardMobile' });
onMounted(() => { onMounted(() => {
loadDashboardData(); loadDashboardData();
loadLogData(); loadLogData();
TopVideo(); // 加载热门视频数据
}); });
const loadDashboardData = async () => { const loadDashboardData = async () => {
@@ -311,7 +293,6 @@ const loadDashboardData = async () => {
// 加载日志数据(模拟接口,实际项目中替换为真实接口) // 加载日志数据(模拟接口,实际项目中替换为真实接口)
const loadLogData = async () => { const loadLogData = async () => {
try { try {
// 模拟日志数据,实际项目中替换为真实接口调用
useApiStore() useApiStore()
.MobileLogs() .MobileLogs()
.then((res) => { .then((res) => {
@@ -324,11 +305,42 @@ const loadLogData = async () => {
} }
}; };
// 加载热门视频数据
const TopVideo = () => {
useApiStore()
.TopVideo(5)
.then((res) => {
if (res.code == 0) {
topVideos.value = res.data;
}
});
};
// 格式化视频时间显示(适配移动端显示)
const formatVideoTime = (timeStr?: string) => {
if (!timeStr) return '未知时间';
// 移动端适配的时间格式化
if (!isNaN(Number(timeStr))) {
const date = new Date(Number(timeStr));
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date
.getDate()
.toString()
.padStart(2, '0')}`;
}
// 如果是8位数字日期(20251219
if (timeStr.length === 8 && /^\d+$/.test(timeStr)) {
return `${timeStr.slice(0, 4)}-${timeStr.slice(4, 6)}-${timeStr.slice(6, 8)}`;
}
return timeStr;
};
// 打开日志详情弹窗 // 打开日志详情弹窗
const openLogDetail = (log: LogItem) => { const openLogDetail = (log: LogItem) => {
currentLog.value = log; currentLog.value = log;
showLogModal.value = true; showLogModal.value = true;
// 加载日志详情内容
loadLogDetailContent(log); loadLogDetailContent(log);
}; };
@@ -349,11 +361,10 @@ const loadLogDetailContent = (log: LogItem) => {
useApiStore() useApiStore()
.apiGetLogs(requestParams) .apiGetLogs(requestParams)
.then((logContentStr: string) => { .then((logContentStr: string) => {
// 处理时间戳,仅保留时分秒
const formattedLog = formatLogTime(logContentStr); const formattedLog = formatLogTime(logContentStr);
const lines = formattedLog.split('\n'); // 将文本按换行符分割为行数组 const lines = formattedLog.split('\n');
const reversedLines = lines.reverse(); // 对行数组进行倒序操作 const reversedLines = lines.reverse();
const reversedText = reversedLines.join('\n'); // 将行数组重新连接为一个字符串 const reversedText = reversedLines.join('\n');
logContent.value = reversedText; logContent.value = reversedText;
}) })
.catch((err) => { .catch((err) => {
@@ -378,14 +389,13 @@ const formatLogTime = (logContent: string) => {
return logContent.replace(timeRegex, '$1'); return logContent.replace(timeRegex, '$1');
}; };
// 复制日志内容 // 复制日志内容(移动端兼容)
const copyLogContent = () => { const copyLogContent = () => {
if (!logContent.value) { if (!logContent.value) {
message.warn('暂无日志内容可复制'); message.warn('暂无日志内容可复制');
return; return;
} }
// 移动端复制兼容
if (navigator.clipboard) { if (navigator.clipboard) {
navigator.clipboard navigator.clipboard
.writeText(logContent.value) .writeText(logContent.value)
@@ -398,7 +408,7 @@ const copyLogContent = () => {
} }
}; };
// 复制降级方案 // 复制降级方案(适配移动端)
const fallbackCopyTextToClipboard = (text: string) => { const fallbackCopyTextToClipboard = (text: string) => {
const textArea = document.createElement('textarea'); const textArea = document.createElement('textarea');
textArea.value = text; textArea.value = text;
@@ -424,7 +434,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
</script> </script>
<style scoped> <style scoped>
/* 移动端专属样式 */ /* 完全保留原有移动端样式 */
.stats-dashboard-mobile { .stats-dashboard-mobile {
min-height: 100vh; min-height: 100vh;
background-color: #ffffff; background-color: #ffffff;
@@ -442,6 +452,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
box-sizing: border-box; box-sizing: border-box;
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
-webkit-overflow-scrolling: touch; /* 移动端弹性滚动 */
} }
.tab-content { .tab-content {
width: 100%; width: 100%;
@@ -486,7 +497,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
font-weight: 500; font-weight: 500;
} }
.stat-value { .stat-value {
font-size: 32px; font-size: 20px;
font-weight: 700; font-weight: 700;
color: #1a1a1a; color: #1a1a1a;
line-height: 1.1; line-height: 1.1;
@@ -494,6 +505,20 @@ const fallbackCopyTextToClipboard = (text: string) => {
align-items: baseline; align-items: baseline;
gap: 6px; gap: 6px;
} }
/* 合并数值样式(保持移动端视觉统一) */
.combined-values {
display: flex;
align-items: baseline;
gap: 0px;
font-size: 28px;
}
.video-count {
font-size: 26px;
}
.size-count {
font-size: 18px;
color: #666;
}
.unit { .unit {
font-size: 18px; font-size: 18px;
color: #444444; color: #444444;
@@ -561,12 +586,46 @@ const fallbackCopyTextToClipboard = (text: string) => {
background-color: rgba(255, 159, 64, 0.1); background-color: rgba(255, 159, 64, 0.1);
color: #d9091a; color: #d9091a;
} }
/* 视频列表图标样式(沿用原有样式体系) */
.video-list-icon {
background-color: rgba(33, 150, 243, 0.15);
color: #2196f3;
}
.video-index {
font-size: 12px;
font-weight: 600;
}
.subitem-meta { .subitem-meta {
font-size: 13px; font-size: 13px;
color: #666666; color: #666666;
font-weight: 500; font-weight: 500;
flex: 1; flex: 1;
} }
/* 视频列表文字样式(适配移动端) */
.video-title {
display: -webkit-box;
-webkit-line-clamp: 2; /* 显示2行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.4;
max-height: 2.8em; /* 2行 * line-height */
width: 100%;
padding-right: 4px;
}
.video-time {
font-size: 11px !important;
color: #999;
margin-top: 2px;
font-weight: 300 !important;
display: flex;
align-items: center; /* 垂直居中 */
justify-content: flex-end; /* 水平右对齐 */
}
.video-info {
flex: 1;
overflow: hidden;
}
.subitem-value { .subitem-value {
font-size: 15px; font-size: 15px;
font-weight: 600; font-weight: 600;
@@ -587,7 +646,15 @@ const fallbackCopyTextToClipboard = (text: string) => {
border-top: 3px solid #2196f3; border-top: 3px solid #2196f3;
} }
/* 底部导航样式 */ /* 空视频列表样式(适配移动端) */
.empty-video-list {
text-align: center;
padding: 20px 0;
color: #999;
font-size: 14px;
}
/* 底部导航样式(完全保留) */
.bottom-nav { .bottom-nav {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@@ -628,7 +695,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
transform: scale(1.1); transform: scale(1.1);
} }
/* 日志 Tab 样式 */ /* 日志 Tab 样式(完全保留) */
.log-tab { .log-tab {
padding: 10px 0; padding: 10px 0;
} }
@@ -670,7 +737,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
color: #333333; color: #333333;
} }
/* 日志列表样式 */ /* 日志列表样式(完全保留) */
.log-list { .log-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -720,13 +787,6 @@ const fallbackCopyTextToClipboard = (text: string) => {
font-size: 11px; font-size: 11px;
color: #999999; color: #999999;
} }
.log-message {
font-size: 14px;
color: #333333;
font-weight: 500;
margin-bottom: 6px;
line-height: 1.4;
}
.log-file { .log-file {
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
@@ -738,7 +798,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
font-size: 14px; font-size: 14px;
} }
/* 日志详情弹窗样式 */ /* 日志详情弹窗样式(完全保留) */
.log-modal-mask { .log-modal-mask {
position: fixed; position: fixed;
top: 0; top: 0;
@@ -820,7 +880,6 @@ const fallbackCopyTextToClipboard = (text: string) => {
color: #333; color: #333;
font-weight: 600; font-weight: 600;
margin-bottom: 5px; margin-bottom: 5px;
/* padding-bottom: 8px; */
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
} }
.log-content { .log-content {
@@ -867,7 +926,7 @@ const fallbackCopyTextToClipboard = (text: string) => {
background-color: #43a047; background-color: #43a047;
} }
/* 夜间模式 */ /* 夜间模式(完全保留原有样式) */
html.dark-mode .stats-dashboard-mobile { html.dark-mode .stats-dashboard-mobile {
background-color: #1a1a2e; background-color: #1a1a2e;
color: #eaeaea; color: #eaeaea;
@@ -894,6 +953,9 @@ html.dark-mode .stat-meta {
html.dark-mode .stat-value { html.dark-mode .stat-value {
color: #ffffff; color: #ffffff;
} }
html.dark-mode .combined-values .size-count {
color: #d0d0d0;
}
html.dark-mode .unit { html.dark-mode .unit {
color: #d0d0d0; color: #d0d0d0;
} }
@@ -924,8 +986,17 @@ html.dark-mode .follow-icon {
html.dark-mode .graphic-icon { html.dark-mode .graphic-icon {
background-color: rgba(255, 159, 64, 0.2); background-color: rgba(255, 159, 64, 0.2);
} }
html.dark-mode .video-list-icon {
background-color: rgba(33, 150, 243, 0.25);
}
html.dark-mode .video-time {
color: #a0a0b3;
}
html.dark-mode .empty-video-list {
color: #808099;
}
/* 夜间模式 - 底部导航 */ /* 夜间模式 - 底部导航(完全保留) */
html.dark-mode .bottom-nav { html.dark-mode .bottom-nav {
background-color: #16213e; background-color: #16213e;
border-top-color: rgba(255, 255, 255, 0.1); border-top-color: rgba(255, 255, 255, 0.1);
@@ -937,7 +1008,7 @@ html.dark-mode .nav-item.active {
color: #4caf50; color: #4caf50;
} }
/* 夜间模式 - 日志样式 */ /* 夜间模式 - 日志样式(完全保留) */
html.dark-mode .log-title { html.dark-mode .log-title {
color: #ffffff; color: #ffffff;
} }
@@ -955,9 +1026,6 @@ html.dark-mode .log-item {
background-color: rgba(30, 30, 50, 0.9); background-color: rgba(30, 30, 50, 0.9);
border-color: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.05);
} }
html.dark-mode .log-message {
color: #eaeaea;
}
html.dark-mode .log-file { html.dark-mode .log-file {
color: #c0c0d3; color: #c0c0d3;
} }
@@ -965,7 +1033,7 @@ html.dark-mode .empty-log {
color: #808099; color: #808099;
} }
/* 夜间模式 - 弹窗样式 */ /* 夜间模式 - 弹窗样式(完全保留) */
html.dark-mode .log-modal-content { html.dark-mode .log-modal-content {
background-color: #1e1e3f; background-color: #1e1e3f;
border-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.1);
+10
View File
@@ -254,7 +254,17 @@ export const useApiStore = defineStore('coreapi', () => {
}); });
} }
//TOP
async function TopVideo(param: number) {
return http.request<any, Response<any>>('/api/Video/top' + param, 'get').then(r => {
return r.data;
}).finally(() => {
});
}
return { return {
TopVideo,
LogDetail, LogDetail,
MobileLogs, MobileLogs,
ExportConf, ExportConf,
+3 -3
View File
@@ -1,7 +1,7 @@
{ {
"dbconn": "", "dbconn": "",
//"tagName": "arm_1.8.8", //"tagName": "arm_1.8.9",
//"tagName": "dev_1.8.8", //"tagName": "dev_1.8.9",
"tagName": "beta_1.8.8", "tagName": "beta_1.8.9",
"dbtype": "Sqlite" "dbtype": "Sqlite"
} }
+10
View File
@@ -0,0 +1,10 @@
namespace dy.net.dto
{
public class DouyinVideoTopDto
{
public string Title { get; set; }
public string Time { get; set; }
}
}
+1 -1
View File
@@ -311,7 +311,7 @@ namespace dy.net.repository
{ {
return await Db.Queryable<T>().Where(whereExpression).ToListAsync(); return await Db.Queryable<T>().Where(whereExpression).ToListAsync();
} }
/// <summary> /// <summary>
/// 分页查询 /// 分页查询
/// </summary> /// </summary>
+4 -1
View File
@@ -17,7 +17,10 @@ namespace dy.net.repository
public async Task<List<DouyinVideoTopDto>> GetTopsOrderByCreateTime(int top)
{
return await Db.Queryable<DouyinVideo>().Select(x=>new DouyinVideoTopDto { Title=x.VideoTitle,Time=x.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}).Take(top).OrderByDescending(x=>x.Time).ToListAsync();
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
+7 -1
View File
@@ -311,6 +311,12 @@ namespace dy.net.service
} }
} }
public async Task<List<DouyinVideoTopDto>> GetLastTop(int top=5)
{
return await _dyCollectVideoRepository.GetTopsOrderByCreateTime(top);
}
} }
} }