-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from fit-ctu-discord/v2022.4
V2022.4
- Loading branch information
Showing
70 changed files
with
2,146 additions
and
2,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace HonzaBotner.Database.Mappers; | ||
|
||
internal sealed class NewsConfigMapper : IEntityMapper<NewsConfig> | ||
{ | ||
public void Map(EntityTypeBuilder<NewsConfig> builder) | ||
{ | ||
builder.HasKey(c => c.Id); | ||
builder.HasIndex(c => c.Name).IsUnique(); | ||
|
||
builder.Ignore(c => c.Channels); | ||
|
||
builder.Property(c => c.Name).IsRequired(); | ||
builder.Property(c => c.Source).IsRequired(); | ||
builder.Property(c => c.ChannelsData).IsRequired(); | ||
builder.Property(c => c.NewsProviderType).IsRequired(); | ||
builder.Property(c => c.PublisherType).IsRequired(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace HonzaBotner.Database; | ||
|
||
public class NewsConfig | ||
{ | ||
public int Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
public string Source { get; set; } | ||
public DateTime LastFetched { get; set; } | ||
public string ChannelsData { get; set; } | ||
|
||
public ulong[] Channels | ||
{ | ||
get | ||
{ | ||
if (ChannelsData == string.Empty) return Array.Empty<ulong>(); | ||
return ChannelsData.Split(";").Select(ulong.Parse).ToArray(); | ||
} | ||
set => ChannelsData = string.Join(';', value); | ||
} | ||
|
||
public string NewsProviderType { get; set; } | ||
public string PublisherType { get; set; } | ||
|
||
public bool Active { get; set; } | ||
} |
18 changes: 0 additions & 18 deletions
18
src/HonzaBotner.Discord.Services/Attributes/CustomBaseAttribute.cs
This file was deleted.
Oops, something went wrong.
114 changes: 0 additions & 114 deletions
114
src/HonzaBotner.Discord.Services/Attributes/RequireAllowlistAttribute.cs
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
src/HonzaBotner.Discord.Services/Attributes/RequireModAttribute.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.