💥 Update activity data format
This commit is contained in:
@ -2,31 +2,25 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using NodaTime;
|
||||
|
||||
namespace DysonNetwork.Sphere.Activity
|
||||
namespace DysonNetwork.Sphere.Activity;
|
||||
|
||||
public class DiscoveryActivity(List<DiscoveryItem> items) : IActivity
|
||||
{
|
||||
public class DiscoveryActivity : IActivity
|
||||
public List<DiscoveryItem> Items { get; set; } = items;
|
||||
|
||||
public Activity ToActivity()
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public List<object> Items { get; set; }
|
||||
|
||||
public DiscoveryActivity(string title, List<object> items)
|
||||
var now = SystemClock.Instance.GetCurrentInstant();
|
||||
return new Activity
|
||||
{
|
||||
Title = title;
|
||||
Items = items;
|
||||
}
|
||||
|
||||
public Activity ToActivity()
|
||||
{
|
||||
var now = SystemClock.Instance.GetCurrentInstant();
|
||||
return new Activity
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Type = "discovery",
|
||||
ResourceIdentifier = "discovery",
|
||||
Data = this,
|
||||
CreatedAt = now,
|
||||
UpdatedAt = now,
|
||||
};
|
||||
}
|
||||
Id = Guid.NewGuid(),
|
||||
Type = "discovery",
|
||||
ResourceIdentifier = "discovery",
|
||||
Data = this,
|
||||
CreatedAt = now,
|
||||
UpdatedAt = now,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public record DiscoveryItem(string Type, object Data);
|
Reference in New Issue
Block a user