-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* convert interface
IPost
to abstract class BasePost
* convert interface `IPostContent` to abstract class `PostContent` * convert interface `IPostWithAuthorExpGrade` to abstract class `PostWithAuthorExpGrade` @ Post * convert interface `IRevision` to abstract class `BaseRevisionWithSplitting` @ Splitting + abstract class `ForumScopedRevision` @ Revision * convert interface `ITimestampedEntity` to abstract class `TimestampedEntity` @ Db @ crawler * convert interface `IEmbedded` to abstract class `Embedded` - interface `IImageMetadata` in favor of `tbm.Shared.Db.EntityWithImageId.AsKey` @ ImageMetadata.cs + abstract class `ImageWithFrameIndex` @ Db @ imagePipeline + abstract class `EntityWithImageId` and its nested abstract class `AsKey` @ Db @ shared @ c#
- Loading branch information
Showing
36 changed files
with
94 additions
and
139 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
3 changes: 2 additions & 1 deletion
3
c#/crawler/src/Db/Post/IPost.cs → c#/crawler/src/Db/Post/BasePost.cs
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
// ReSharper disable UnusedMemberInSuper.Global | ||
namespace tbm.Crawler.Db.Post; | ||
|
||
public interface IPost : ITimestampedEntity, ICloneable | ||
public abstract class BasePost : TimestampedEntity, ICloneable | ||
{ | ||
public ulong Tid { get; set; } | ||
public long AuthorUid { get; set; } | ||
public uint? LastSeenAt { get; set; } | ||
public abstract object Clone(); | ||
} |
2 changes: 1 addition & 1 deletion
2
c#/crawler/src/Db/Post/IPostContent.cs → c#/crawler/src/Db/Post/PostContent.cs
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace tbm.Crawler.Db.Post; | ||
|
||
public interface IPostContent | ||
public abstract class PostContent : RowVersionedEntity | ||
{ | ||
public byte[]? ProtoBufBytes { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...er/src/Db/Post/IPostWithAuthorExpGrade.cs → ...ler/src/Db/Post/PostWithAuthorExpGrade.cs
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// ReSharper disable UnusedMemberInSuper.Global | ||
namespace tbm.Crawler.Db.Post; | ||
|
||
public interface IPostWithAuthorExpGrade : IPost | ||
public abstract class PostWithAuthorExpGrade : BasePost | ||
{ | ||
[NotMapped] public byte AuthorExpGrade { get; set; } | ||
} |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// ReSharper disable PropertyCanBeMadeInitOnly.Global | ||
namespace tbm.Crawler.Db.Post; | ||
|
||
public class ReplyContent : RowVersionedEntity, IPostContent | ||
public class ReplyContent : PostContent | ||
{ | ||
[Key] public ulong Pid { get; set; } | ||
public byte[]? ProtoBufBytes { get; set; } | ||
} |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// ReSharper disable PropertyCanBeMadeInitOnly.Global | ||
namespace tbm.Crawler.Db.Post; | ||
|
||
public class SubReplyContent : RowVersionedEntity, IPostContent | ||
public class SubReplyContent : PostContent | ||
{ | ||
[Key] public ulong Spid { get; set; } | ||
public byte[]? ProtoBufBytes { get; set; } | ||
} |
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 |
---|---|---|
@@ -1,24 +1,18 @@ | ||
// ReSharper disable PropertyCanBeMadeInitOnly.Global | ||
namespace tbm.Crawler.Db.Post; | ||
|
||
public class SubReplyPost : RowVersionedEntity, IPostWithAuthorExpGrade | ||
public class SubReplyPost : PostWithAuthorExpGrade | ||
{ | ||
public ulong Tid { get; set; } | ||
public ulong Pid { get; set; } | ||
[Key] public ulong Spid { get; set; } | ||
[NotMapped] public byte[]? Content { get; set; } | ||
|
||
[JsonConverter(typeof(ProtoBufRepeatedFieldJsonConverter<Content>))] | ||
[NotMapped] | ||
public required RepeatedField<Content> OriginalContents { get; set; } | ||
public long AuthorUid { get; set; } | ||
[NotMapped] public byte AuthorExpGrade { get; set; } | ||
public uint PostedAt { get; set; } | ||
public int? AgreeCount { get; set; } | ||
public int? DisagreeCount { get; set; } | ||
public uint CreatedAt { get; set; } | ||
public uint? UpdatedAt { get; set; } | ||
public uint? LastSeenAt { get; set; } | ||
|
||
public object Clone() => MemberwiseClone(); | ||
public override object Clone() => MemberwiseClone(); | ||
} |
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
// ReSharper disable PropertyCanBeMadeInitOnly.Global | ||
namespace tbm.Crawler.Db.Revision; | ||
|
||
public class ForumModeratorRevision : RowVersionedEntity | ||
public class ForumModeratorRevision : ForumScopedRevision | ||
{ | ||
public uint DiscoveredAt { get; set; } | ||
public uint Fid { get; set; } | ||
public required string Portrait { get; set; } | ||
public required string ModeratorTypes { get; set; } | ||
} |
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,7 @@ | ||
namespace tbm.Crawler.Db.Revision; | ||
|
||
public abstract class ForumScopedRevision : RowVersionedEntity | ||
{ | ||
public uint DiscoveredAt { get; set; } | ||
public uint Fid { get; set; } | ||
} |
4 changes: 2 additions & 2 deletions
4
...er/src/Db/Revision/Splitting/IRevision.cs → ...on/Splitting/BaseRevisionWithSplitting.cs
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// ReSharper disable UnusedMemberInSuper.Global | ||
namespace tbm.Crawler.Db.Revision.Splitting; | ||
|
||
public interface IRevision | ||
public abstract class BaseRevisionWithSplitting : RowVersionedEntity | ||
{ | ||
public uint TakenAt { get; set; } | ||
public ushort? NullFieldsBitMask { get; set; } | ||
public bool IsAllFieldsIsNullExceptSplit(); | ||
public abstract bool IsAllFieldsIsNullExceptSplit(); | ||
} |
10 changes: 3 additions & 7 deletions
10
c#/crawler/src/Db/Revision/Splitting/RevisionWithSplitting.cs
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
2 changes: 1 addition & 1 deletion
2
c#/crawler/src/Db/ITimestampedEntity.cs → c#/crawler/src/Db/TimestampedEntity.cs
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
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
Oops, something went wrong.