Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
dotnet-version: '10.x'

- name: Run focused tests
run: dotnet test src/HuaJiBot.NET.UnitTest --filter 'FullyQualifiedName~DailySummaryTest|FullyQualifiedName~AsciiArtToolsTest|FullyQualifiedName~WebDataServiceTest|FullyQualifiedName~VisionInputTest|FullyQualifiedName~FlueBridgeTest|FullyQualifiedName~ClubAffairsReminderTest|FullyQualifiedName~CalendarOutputTest|FullyQualifiedName~TicketReminderTest'
run: dotnet test src/HuaJiBot.NET.UnitTest --filter 'FullyQualifiedName~DailySummaryTest|FullyQualifiedName~AsciiArtToolsTest|FullyQualifiedName~WebDataServiceTest|FullyQualifiedName~VisionInputTest|FullyQualifiedName~FlueBridgeTest|FullyQualifiedName~ClubAffairsReminderTest|FullyQualifiedName~CalendarOutputTest|FullyQualifiedName~TicketReminderTest|FullyQualifiedName~PluginPostTest'

format-check:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/HuaJiBot.NET.Plugin.RepairTeam/PluginMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ from line in e.Description.ReplaceLineEndings("\n").Trim().Split('\n')
return new(string.Join("\n", lines), FormatEvent(e))
{
Tags = StateTag(e.Action) is { } tag ? ["维修", tag] : ["维修"],
Links = [new("去处理", TicketDigest.PortalUrl)],
Links = [new("去处理", TicketDigest.TicketUrl(e.EventId))],
};
}

Expand Down
4 changes: 3 additions & 1 deletion src/HuaJiBot.NET.Plugin.RepairTeam/TicketDigest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ namespace HuaJiBot.NET.Plugin.RepairTeam;

internal static class TicketDigest
{
public const string PortalUrl = "https://repair.nbtca.space";
public const string PortalUrl = "https://nbtca.space/repair/admin";

public static string TicketUrl(long id) => $"{PortalUrl}?eventid={id}";

private static readonly (string Status, string Title)[] Stages =
[
Expand Down
4 changes: 2 additions & 2 deletions src/HuaJiBot.NET.UnitTest/PluginPostTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task RepairEvent_ShowsTicketAndLinksPortal()
Is.EqualTo("🛠 **#900001 新报修**\nThinkPad · 无法开机\n\n> 进水了\n\n张三 · 09-21 11:45")
);
Assert.That(post.Tags, Is.EqualTo(new[] { "维修", "新报修" }));
Assert.That(post.Links, Is.EqualTo(new[] { new LinkMessage("去处理", TicketDigest.PortalUrl) }));
Assert.That(post.Links, Is.EqualTo(new[] { new LinkMessage("去处理", "https://nbtca.space/repair/admin?eventid=900001") }));
Assert.That(fallback, Is.EqualTo(new SendingMessageBase[] { new TextMessage(RepairPlugin.FormatEvent(e)) }));
});
}
Expand All @@ -90,7 +90,7 @@ public void TicketDigest_ListsStagesAsBulletLists()
)
);
Assert.That(post.Tags, Is.EqualTo(new[] { "维修", "提醒" }));
Assert.That(post.Links.Single().Url, Is.EqualTo(TicketDigest.PortalUrl));
Assert.That(post.Links.Single().Url, Is.EqualTo("https://nbtca.space/repair/admin"));
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/HuaJiBot.NET.UnitTest/TicketReminderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void Format_GroupsByStageAndLinksThePortal()
#790 天选4 · 清灰 · Skillful Li · 已 5 天
待审核:
#785 小新14 · 清灰 · 已 3 天
去处理:https://repair.nbtca.space
去处理:https://nbtca.space/repair/admin
""".ReplaceLineEndings("\n")
)
);
Expand Down
Loading