Skip to content

Commit

Permalink
Add Application Configuration (#197)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
csharpfritz and github-actions[bot] committed Sep 18, 2023
1 parent 23b6012 commit f0a2429
Show file tree
Hide file tree
Showing 122 changed files with 6,864 additions and 5,756 deletions.
8 changes: 8 additions & 0 deletions src/TagzApp.Common/IApplicationConfigurationRepository.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Ignore Spelling: Css

namespace TagzApp.Common;

public interface IApplicationConfigurationRepository
{
Task SetValues(ApplicationConfiguration config);
}
18 changes: 8 additions & 10 deletions src/TagzApp.Common/IContentSubscriber.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using TagzApp.Common.Models;

namespace TagzApp.Common;

public interface IContentSubscriber
{

void SubscribeToContent(Hashtag tag, Action<Content> onNewContent);

}
namespace TagzApp.Common;

public interface IContentSubscriber
{

void SubscribeToContent(Hashtag tag, Action<Content> onNewContent);

}
15 changes: 8 additions & 7 deletions src/TagzApp.Common/IHasNewestId.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace TagzApp.Common;

public interface IHasNewestId {

string NewestId { get; set; }

}
namespace TagzApp.Common;

public interface IHasNewestId
{

string NewestId { get; set; }

}
46 changes: 23 additions & 23 deletions src/TagzApp.Common/IMessagingService.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
using Microsoft.Extensions.Hosting;

namespace TagzApp.Web.Services;

public interface IMessagingService : IHostedService
{
IEnumerable<string> TagsTracked { get; }

Task AddHashtagToWatch(string tag);

Task<Content?> GetContentByIds(string provider, string providerId);

Task<IEnumerable<Content>> GetExistingContentForTag(string tag);
// TODO: Needs checking if a non-nullable ModerationAction makes problems!
Task<IEnumerable<(Content, ModerationAction)>> GetContentByTagForModeration(string tag);

Task<IEnumerable<Content>> GetApprovedContentByTag(string tag);

IEnumerable<ISocialMediaProvider> Providers { get; }

string GetLatestProviderIdByTagAndProvider(string tag, string provider);

}
using Microsoft.Extensions.Hosting;

namespace TagzApp.Web.Services;

public interface IMessagingService : IHostedService
{
IEnumerable<string> TagsTracked { get; }

Task AddHashtagToWatch(string tag);

Task<Content?> GetContentByIds(string provider, string providerId);

Task<IEnumerable<Content>> GetExistingContentForTag(string tag);
// TODO: Needs checking if a non-nullable ModerationAction makes problems!
Task<IEnumerable<(Content, ModerationAction)>> GetContentByTagForModeration(string tag);

Task<IEnumerable<Content>> GetApprovedContentByTag(string tag);

IEnumerable<ISocialMediaProvider> Providers { get; }

string GetLatestProviderIdByTagAndProvider(string tag, string provider);

}
24 changes: 11 additions & 13 deletions src/TagzApp.Common/INotifyNewMessages.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using TagzApp.Common.Models;

namespace TagzApp.Web.Services;

public interface INotifyNewMessages
{
void NotifyNewContent(string hashtag, Content content);

void NotifyApprovedContent(string hashtag, Content content, ModerationAction action);

void NotifyRejectedContent(string hashtag, Content content, ModerationAction action);

}
namespace TagzApp.Web.Services;

public interface INotifyNewMessages
{
void NotifyNewContent(string hashtag, Content content);

void NotifyApprovedContent(string hashtag, Content content, ModerationAction action);

void NotifyRejectedContent(string hashtag, Content content, ModerationAction action);

}
66 changes: 32 additions & 34 deletions src/TagzApp.Common/ISocialMediaProvider.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
using TagzApp.Common.Models;

namespace TagzApp.Common;

/// <summary>
/// Defines the interface for a Social Media Provider that delivers content to TagzApp
/// </summary>
public interface ISocialMediaProvider
{

/// <summary>
/// Unique identifier for the provider
/// </summary>
string Id { get; }

/// <summary>
/// Display name for the provider
/// </summary>
string DisplayName { get; }

/// <summary>
/// How frequently new content should be retrieved from the provider
/// </summary>
TimeSpan NewContentRetrievalFrequency { get; }

/// <summary>
/// Get a collection of content for a given hashtag
/// </summary>
/// <param name="tag">Tag to search for</param>
/// <param name="since">Datestamp to search for content since</param>
/// <returns></returns>
Task<IEnumerable<Content>> GetContentForHashtag(Hashtag tag, DateTimeOffset since);

}
namespace TagzApp.Common;

/// <summary>
/// Defines the interface for a Social Media Provider that delivers content to TagzApp
/// </summary>
public interface ISocialMediaProvider
{

/// <summary>
/// Unique identifier for the provider
/// </summary>
string Id { get; }

/// <summary>
/// Display name for the provider
/// </summary>
string DisplayName { get; }

/// <summary>
/// How frequently new content should be retrieved from the provider
/// </summary>
TimeSpan NewContentRetrievalFrequency { get; }

/// <summary>
/// Get a collection of content for a given hashtag
/// </summary>
/// <param name="tag">Tag to search for</param>
/// <param name="since">Datestamp to search for content since</param>
/// <returns></returns>
Task<IEnumerable<Content>> GetContentForHashtag(Hashtag tag, DateTimeOffset since);

}
Loading

0 comments on commit f0a2429

Please sign in to comment.