Skip to content

Commit

Permalink
显示权限过期时间
Browse files Browse the repository at this point in the history
  • Loading branch information
kaedei committed Jun 27, 2020
1 parent 6daa8e5 commit a07d744
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

2. 然后在[Github发布页面](https://github.com/kaedei/dandanplay-resmonitor/releases)下载编译好的最新版本,将所有文件解压到本地的某个文件夹中。比如说 `C:\dandanplay-resmonitor\`

3. 进入此文件夹,使用编辑器软件打开 `appsettings.json` 文件,修改软件配置。这里将会有一篇详细的说明文档:[TODO]()。建议修改完成后备份此配置文件,免得将来升级时被不小心覆盖。
3. 进入此文件夹,使用编辑器软件打开 `appsettings.json` 文件,修改软件配置。这里将会有一篇详细的说明文档:[本机运行](https://github.com/kaedei/dandanplay-resmonitor/wiki/%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE#%E6%9C%AC%E6%9C%BA%E8%BF%90%E8%A1%8C)。建议修改完成后备份此配置文件,免得将来升级时被不小心覆盖。

4. 使用命令行(cmd Terminal等)进入此文件夹,然后执行 `dotnet ResourceMonitor.dll` 命令,即可启动。启动后将会持续运行,直到你关闭窗口或是按 Ctrl+C 结束进程。

Expand All @@ -63,7 +63,7 @@

1. 运行命令 `docker run -it kaedei/dandanplay-resmonitor` 即可启动此工具

2. 添加 `-e` 参数可以(通过改变环境变量的方式)自定义程序运行参数。这一步是必需的,详情请参考文档 [TODO]()
2. 添加 `-e` 参数可以(通过改变环境变量的方式)自定义程序运行参数。这一步是必需的,详情请参考文档 [docker部署](https://github.com/kaedei/dandanplay-resmonitor/wiki/%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE#docker)

3. 添加 `-d` 参数可以让容器在后台持续运行

Expand Down Expand Up @@ -91,4 +91,4 @@

- 为了保证程序可以随时启动、终止并保证状态一致,代码中没有设计存储层,即不会将状态保存到外部数据库、Redis、文件系统中。

- 可以通过扩展实现 `IDownloader` 接口来支持更多的下载工具
- 可以通过扩展实现 `IDownloader` 接口来支持更多的下载工具

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ public class LoginResponse : ResponseBase
public string userType { get; set; }
public string screenName { get; set; }
public string appScope { get; set; }

public UserPrivileges privileges { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace ResourceMonitor.Models.DandanplayApi
{
public class UserPrivileges
{
public DateTime? resmonitor { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ private async Task<bool> DoWork()
}

}

_logger.LogInformation($"当前用户使用 ResMonitor 的时限为: 北京时间 {_lastLoginResponse.privileges?.resmonitor:yyyy-MM-dd HH:mm:ss}");

//尝试同步下载规则
//获取服务器上当前用户最新版本的规则
Expand Down
6 changes: 3 additions & 3 deletions ResourceMonitor/ResourceMonitor/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<IDownloader, TransmissionDownloader>();
break;
}

services.AddHostedService<SyncRulesBackgroundService>();
services.AddHostedService<CheckNewResourcesBackgroundService>();

//User-Agent: dandanplay/resmonitor 1.2.3.4
var userAgent = string.Format(Configuration["Api:UserAgent"],
Expand Down Expand Up @@ -73,6 +70,9 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<IRulesContainer, RulesContainer>();
services.AddTransient<ITorrentService, TorrentService>();

services.AddHostedService<SyncRulesBackgroundService>();
services.AddHostedService<CheckNewResourcesBackgroundService>();

services.AddControllers().AddNewtonsoftJson();
}

Expand Down

0 comments on commit a07d744

Please sign in to comment.