From 7d59c15b0efd2aa5a27aef356a265f850a2e7e2f Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 13 Jan 2026 06:24:07 +0800 Subject: Add JSON result getters for command outputs --- .../JsonResults/Implements/ShareSeeResult.cs | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs (limited to 'CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs') diff --git a/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs b/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs new file mode 100644 index 0000000..c965b25 --- /dev/null +++ b/CommandLineWrapper/JsonResults/Implements/ShareSeeResult.cs @@ -0,0 +1,37 @@ +using CommandLineWrapper; +using CommandLineWrapper.JsonResults; +using System.Text.Json.Serialization; + +public class ShareSeeResultGetter : JsonResultGetter +{ + private string _shareId; + + public ShareSeeResultGetter(string shareId) + => _shareId = shareId; + + protected override Task ExecCommand(JVCSWorkspace workspace) + => workspace.ShareSee(_shareId); +} + +public struct SeeShareResult +{ + public string ShareId { get; set; } + public string Sharer { get; set; } + public string Description { get; set; } + public Dictionary Mappings { get; set; } +} + +public struct SheetMappingMetadata +{ + // TIPS + // Since SheetMappingMetadata in the serialized output of the command-line tool `jv sheet see ` + // comes directly from the version control repository, + // its property names use the original lowercase snake_case naming, + // so JsonPropertyName must be explicitly specified for mapping. + + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("ver")] + public string Version { get; set; } +} -- cgit