mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
open source Notesnook API
This commit is contained in:
43
Notesnook.API/Models/Monograph.cs
Normal file
43
Notesnook.API/Models/Monograph.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using Notesnook.API.Interfaces;
|
||||
using Streetwriters.Data.Attributes;
|
||||
|
||||
namespace Notesnook.API.Models
|
||||
{
|
||||
[BsonCollection("notesnook", "monographs")]
|
||||
public class Monograph : IMonograph
|
||||
{
|
||||
public Monograph()
|
||||
{
|
||||
Id = ObjectId.GenerateNewId().ToString();
|
||||
}
|
||||
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; }
|
||||
|
||||
[JsonPropertyName("userId")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("selfDestruct")]
|
||||
public bool SelfDestruct { get; set; }
|
||||
|
||||
[JsonPropertyName("encryptedContent")]
|
||||
public EncryptedData EncryptedContent { get; set; }
|
||||
|
||||
[JsonPropertyName("datePublished")]
|
||||
public long DatePublished { get; set; }
|
||||
|
||||
[JsonPropertyName("content")]
|
||||
[BsonIgnore]
|
||||
public string Content { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public byte[] CompressedContent { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user