JiraIssue에 대해 Trilium 노트 발급 기능 추가.
This commit is contained in:
29
Models/TriliumNote.cs
Normal file
29
Models/TriliumNote.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user