JiraIssue에 대해 Trilium 노트 발급 기능 추가.
This commit is contained in:
@@ -15,9 +15,9 @@ public class Trilium
|
||||
{
|
||||
public string EtapiToken { get; set; } = string.Empty;
|
||||
public string EtapiBaseUrl { get; set; } = "https://localhost/etapi";
|
||||
public string JiraOpenedIssuePageId = string.Empty;
|
||||
public string JiraWorkingIssuePageId = string.Empty;
|
||||
public string JiraResolvedIssuePageId = string.Empty;
|
||||
public string JiraOpenedIssuePageId { get; set; } = string.Empty;
|
||||
public string JiraWorkingIssuePageId { get; set; } = string.Empty;
|
||||
public string JiraResolvedIssuePageId { get; set; } = string.Empty;
|
||||
public string DividendPageId { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
48
Models/TriliumResponse.cs
Normal file
48
Models/TriliumResponse.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
public class TriliumResponse
|
||||
{
|
||||
public Note note { get; set; }
|
||||
public Branch branch { get; set; }
|
||||
}
|
||||
|
||||
public class Note
|
||||
{
|
||||
public string noteId { get; set; }
|
||||
public bool isProtected { get; set; }
|
||||
public string title { get; set; }
|
||||
public string type { get; set; }
|
||||
public string mime { get; set; }
|
||||
public string blobId { get; set; }
|
||||
public string dateCreated { get; set; }
|
||||
public string dateModified { get; set; }
|
||||
public string utcDateCreated { get; set; }
|
||||
public string utcDateModified { get; set; }
|
||||
public string[] parentNoteIds { get; set; }
|
||||
public object[] childNoteIds { get; set; }
|
||||
public string[] parentBranchIds { get; set; }
|
||||
public object[] childBranchIds { get; set; }
|
||||
public Attribute[] attributes { get; set; }
|
||||
}
|
||||
|
||||
public class Attribute
|
||||
{
|
||||
public string attributeId { get; set; }
|
||||
public string noteId { get; set; }
|
||||
public string type { get; set; }
|
||||
public string name { get; set; }
|
||||
public string value { get; set; }
|
||||
public int position { get; set; }
|
||||
public bool isInheritable { get; set; }
|
||||
public string utcDateModified { get; set; }
|
||||
}
|
||||
|
||||
public class Branch
|
||||
{
|
||||
public string branchId { get; set; }
|
||||
public string noteId { get; set; }
|
||||
public string parentNoteId { get; set; }
|
||||
public object prefix { get; set; }
|
||||
public int notePosition { get; set; }
|
||||
public bool isExpanded { get; set; }
|
||||
public string utcDateModified { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user