Browse Source

rename reference class.

master
Savorboard 7 years ago
parent
commit
9acbbe20a4
4 changed files with 18 additions and 23 deletions
  1. +2
    -7
      src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs
  2. +12
    -10
      src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs
  3. +2
    -3
      src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs
  4. +2
    -3
      src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs

+ 2
- 7
src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs View File

@@ -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();
}


+ 12
- 10
src/DotNetCore.CAP/Dashboard/DashboardRoutes.cs View File

@@ -1,6 +1,6 @@
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());



+ 2
- 3
src/DotNetCore.CAP/Dashboard/Pages/PublishedPage.cs View File

@@ -1,5 +1,4 @@
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();
}


+ 2
- 3
src/DotNetCore.CAP/Dashboard/Pages/ReceivedPage.cs View File

@@ -1,5 +1,4 @@
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();
}


Loading…
Cancel
Save