30 lines
776 B
C#
30 lines
776 B
C#
|
|
using System.Text.Json;
|
|||
|
|
using TriliumMind.Data.Entities;
|
|||
|
|
|
|||
|
|
namespace TriliumMind.Models;
|
|||
|
|
|
|||
|
|
public class TriliumNote : JiraIssue
|
|||
|
|
{
|
|||
|
|
public string ParentNoteId { get; set; } = string.Empty;
|
|||
|
|
public TriliumResponse? TriliumNoteData { get; set; } = null;
|
|||
|
|
|
|||
|
|
public TriliumNote(JiraIssue issue, string parentNoteId) : base(issue)
|
|||
|
|
{
|
|||
|
|
this.ParentNoteId = parentNoteId;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public StringContent ToNoteContent()
|
|||
|
|
{
|
|||
|
|
var noteData = new
|
|||
|
|
{
|
|||
|
|
parentNoteId = this.ParentNoteId,
|
|||
|
|
title = $"{this.Key} {this.Summary}",
|
|||
|
|
type = "text",
|
|||
|
|
content = ""
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var jsonContent = JsonSerializer.Serialize(noteData);
|
|||
|
|
return new StringContent(jsonContent, null, "application/json");
|
|||
|
|
}
|
|||
|
|
}
|