添加项目文件。
This commit is contained in:
31
LeetCodeSharp.Fetcher/Models/Query.cs
Normal file
31
LeetCodeSharp.Fetcher/Models/Query.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace LeetCodeSharp.Fetcher.Models;
|
||||
|
||||
internal class Query
|
||||
{
|
||||
[JsonPropertyName("operationName")]
|
||||
public string OperationName { get; init; }
|
||||
|
||||
public Dictionary<string, string> Variables { get; } = [];
|
||||
|
||||
[JsonPropertyName("query")]
|
||||
public string QueryString { get; init; }
|
||||
|
||||
public Query(string title)
|
||||
{
|
||||
OperationName = "questionData";
|
||||
Variables.Add("titleSlug", title);
|
||||
QueryString = """
|
||||
query questionData($titleSlug: String!) {
|
||||
question(titleSlug: $titleSlug) {
|
||||
content
|
||||
stats
|
||||
codeDefinition
|
||||
sampleTestCase
|
||||
metaData
|
||||
}
|
||||
}
|
||||
""";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user