Skip to content

Commit

Permalink
feat(plugins/qqstat4soraplugin/): update
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyungent committed Aug 3, 2023
1 parent f53ad21 commit b039ee9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 520 deletions.
221 changes: 0 additions & 221 deletions plugins/QQStat4SoraPlugin/Controllers/CalendarController.cs

This file was deleted.

10 changes: 5 additions & 5 deletions plugins/QQStat4SoraPlugin/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
using Microsoft.AspNetCore.Mvc;
using PluginCore;

namespace QQStatPlugin.Controllers
namespace QQStat4SoraPlugin.Controllers
{
/// <summary>
/// 其实也可以不写这个, 直接访问 Plugins/QQStatPlugin/index.html
/// 其实也可以不写这个, 直接访问 Plugins/QQStat4SoraPlugin/index.html
///
/// 下面的方法, 是去掉 index.html
///
/// 若 wwwroot 下有其它需要访问的文件, 如何 css, js, 而你又不想每次新增 action 指定返回, 则 Route 必须 Plugins/{PluginId},
/// 这样访问 Plugins/HelloWorldPlugin/css/main.css 就会访问到你插件下的 wwwroot/css/main.css
/// </summary>
[Route($"Plugins/{nameof(QQStatPlugin)}")]
[Route($"Plugins/{nameof(QQStat4SoraPlugin)}")]
public class HomeController : Controller
{
public async Task<ActionResult> Get()
{
string indexFilePath = System.IO.Path.Combine(PluginPathProvider.PluginWwwRootDir(nameof(QQStatPlugin)), "index.html");
string indexFilePath = System.IO.Path.Combine(PluginPathProvider.PluginWwwRootDir(nameof(QQStat4SoraPlugin)), "index.html");

return PhysicalFile(indexFilePath, "text/html");
}
Expand All @@ -34,7 +34,7 @@ public async Task<ActionResult> Download()
var fileStream = System.IO.File.OpenRead(dbFilePath);
//System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();

return File(fileStream: fileStream, contentType: "application/x-sqlite3", fileDownloadName: $"{nameof(QQStatPlugin)}.sqlite", enableRangeProcessing: true);
return File(fileStream: fileStream, contentType: "application/x-sqlite3", fileDownloadName: $"{nameof(QQStat4SoraPlugin)}.sqlite", enableRangeProcessing: true);
}
}
}
Loading

0 comments on commit b039ee9

Please sign in to comment.