mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-13 15:29:03 +00:00
Fix score, photo, and comment activities
This commit is contained in:
parent
15dbf562aa
commit
0c9c8fd7b2
2 changed files with 27 additions and 7 deletions
|
@ -196,6 +196,7 @@ public class ActivityEventHandlerTests
|
|||
HeartedLevelId = 1,
|
||||
UserId = 1,
|
||||
SlotId = 1,
|
||||
Slot = slot,
|
||||
};
|
||||
|
||||
eventHandler.OnEntityInserted(database, heartedLevel);
|
||||
|
|
|
@ -35,25 +35,44 @@ public class ActivityEntityEventHandler : IEntityEventHandler
|
|||
},
|
||||
_ => null,
|
||||
},
|
||||
CommentEntity comment => comment.TargetSlot?.Type switch
|
||||
CommentEntity comment => comment.Type switch
|
||||
{
|
||||
SlotType.User => new CommentActivityEntity
|
||||
CommentType.Level => comment.TargetSlot?.Type switch
|
||||
{
|
||||
Type = comment.Type == CommentType.Level ? EventType.CommentOnLevel : EventType.CommentOnUser,
|
||||
SlotType.User => new CommentActivityEntity
|
||||
{
|
||||
Type = EventType.CommentOnLevel,
|
||||
CommentId = comment.CommentId,
|
||||
UserId = comment.PosterUserId,
|
||||
},
|
||||
_ => null,
|
||||
},
|
||||
CommentType.Profile => new CommentActivityEntity
|
||||
{
|
||||
Type = EventType.CommentOnUser,
|
||||
CommentId = comment.CommentId,
|
||||
UserId = comment.PosterUserId,
|
||||
},
|
||||
},
|
||||
_ => null,
|
||||
},
|
||||
PhotoEntity photo => photo.Slot?.Type switch
|
||||
PhotoEntity photo => photo.SlotId switch
|
||||
{
|
||||
SlotType.User => new PhotoActivityEntity
|
||||
null => new PhotoActivityEntity
|
||||
{
|
||||
Type = EventType.UploadPhoto,
|
||||
PhotoId = photo.PhotoId,
|
||||
UserId = photo.CreatorId,
|
||||
},
|
||||
_ => null,
|
||||
_ => photo.Slot?.Type switch
|
||||
{
|
||||
SlotType.User => new PhotoActivityEntity
|
||||
{
|
||||
Type = EventType.UploadPhoto,
|
||||
PhotoId = photo.PhotoId,
|
||||
UserId = photo.CreatorId,
|
||||
},
|
||||
_ => null,
|
||||
},
|
||||
},
|
||||
ScoreEntity score => score.Slot.Type switch
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue