Commit 9acbbe20 authored by Savorboard's avatar Savorboard

rename reference class.

parent ffc33990
......@@ -151,17 +151,12 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
return new MySqlFetchedMessage(fetchedMessage.MessageId, fetchedMessage.MessageType, connection, transaction);
}
public List<string> GetRangeFromSet(string key, int startingFrom, int endingAt)
public bool ChangePublishedState(int messageId, string state)
{
throw new NotImplementedException();
}
public bool ChangePublishedState(int messageId, IState state)
{
throw new NotImplementedException();
}
public bool ChangeReceivedState(int messageId, IState state)
public bool ChangeReceivedState(int messageId, string state)
{
throw new NotImplementedException();
}
......
using System.Reflection;
using DotNetCore.CAP.Dashboard.Pages;
using DotNetCore.CAP.Processor.States;
using DotNetCore.CAP.Infrastructure;
namespace DotNetCore.CAP.Dashboard
{
......@@ -32,7 +32,7 @@ namespace DotNetCore.CAP.Dashboard
Routes = new RouteCollection();
Routes.AddRazorPage("/", x => new HomePage());
Routes.Add("/stats", new JsonStats());
Routes.Add("/health",new OkStats());
Routes.Add("/health", new OkStats());
#region Embedded static content
......@@ -88,23 +88,25 @@ namespace DotNetCore.CAP.Dashboard
var id = int.Parse(x.UriMatch.Groups["Id"].Value);
var message = x.Storage.GetConnection().GetReceivedMessageAsync(id).GetAwaiter().GetResult();
return message.Content;
});
});
Routes.AddPublishBatchCommand(
"/published/requeue",
(client, messageId) => client.Storage.GetConnection().ChangePublishedState(messageId, new ScheduledState()));
"/published/requeue",
(client, messageId) =>
client.Storage.GetConnection().ChangePublishedState(messageId, StatusName.Scheduled));
Routes.AddPublishBatchCommand(
"/received/requeue",
(client, messageId) => client.Storage.GetConnection().ChangeReceivedState(messageId, new ScheduledState()));
"/received/requeue",
(client, messageId) =>
client.Storage.GetConnection().ChangeReceivedState(messageId, StatusName.Scheduled));
Routes.AddRazorPage(
"/published/(?<StatusName>.+)",
x => new PublishedPage(x.Groups["StatusName"].Value));
x => new PublishedPage(x.Groups["StatusName"].Value));
Routes.AddRazorPage(
"/received/(?<StatusName>.+)",
"/received/(?<StatusName>.+)",
x => new ReceivedPage(x.Groups["StatusName"].Value));
Routes.AddRazorPage("/subscribers", x => new SubscriberPage());
Routes.AddRazorPage("/subscribers", x => new SubscriberPage());
Routes.AddRazorPage("/nodes", x => new NodePage());
......
using System;
using DotNetCore.CAP.Processor.States;
namespace DotNetCore.CAP.Dashboard.Pages
{
......@@ -14,11 +13,11 @@ namespace DotNetCore.CAP.Dashboard.Pages
public int GetTotal(IMonitoringApi api)
{
if (string.Equals(StatusName, SucceededState.StateName, StringComparison.CurrentCultureIgnoreCase))
if (string.Equals(StatusName, Infrastructure.StatusName.Succeeded, StringComparison.CurrentCultureIgnoreCase))
{
return api.PublishedSucceededCount();
}
if (string.Equals(StatusName, ProcessingState.StateName, StringComparison.CurrentCultureIgnoreCase))
if (string.Equals(StatusName, Infrastructure.StatusName.Processing, StringComparison.CurrentCultureIgnoreCase))
{
return api.PublishedProcessingCount();
}
......
using System;
using DotNetCore.CAP.Processor.States;
namespace DotNetCore.CAP.Dashboard.Pages
{
......@@ -14,11 +13,11 @@ namespace DotNetCore.CAP.Dashboard.Pages
public int GetTotal(IMonitoringApi api)
{
if (string.Equals(StatusName, SucceededState.StateName, StringComparison.CurrentCultureIgnoreCase))
if (string.Equals(StatusName, Infrastructure.StatusName.Succeeded, StringComparison.CurrentCultureIgnoreCase))
{
return api.ReceivedSucceededCount();
}
if (string.Equals(StatusName, ProcessingState.StateName, StringComparison.CurrentCultureIgnoreCase))
if (string.Equals(StatusName, Infrastructure.StatusName.Processing, StringComparison.CurrentCultureIgnoreCase))
{
return api.ReceivedProcessingCount();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment