Merged Models into Server as Server.Models
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json;
|
||||
using Models;
|
||||
using System.Text.Json.Nodes;
|
||||
using Server.Models;
|
||||
namespace Server.Controllers;
|
||||
|
||||
[ApiController]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Models;
|
||||
using Server.Models;
|
||||
|
||||
namespace Server.Controllers;
|
||||
|
||||
|
||||
75
src/Server/Models/EntityResults.cs
Normal file
75
src/Server/Models/EntityResults.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Server.Models;
|
||||
|
||||
|
||||
public class EntityQueryResults
|
||||
{
|
||||
[JsonPropertyName("Results")]
|
||||
public required List<EntityQueryResult> Results { get; set; }
|
||||
}
|
||||
|
||||
public class EntityQueryResult
|
||||
{
|
||||
[JsonPropertyName("Name")]
|
||||
public required string Name { get; set; }
|
||||
[JsonPropertyName("Value")]
|
||||
public float Value { get; set; }
|
||||
}
|
||||
|
||||
public class EntityIndexResult
|
||||
{
|
||||
[JsonPropertyName("Success")]
|
||||
public required bool Success { get; set; }
|
||||
}
|
||||
|
||||
public class EntityListResults
|
||||
{
|
||||
[JsonPropertyName("Results")]
|
||||
public required List<EntityListResult> Results { get; set; }
|
||||
[JsonPropertyName("Success")]
|
||||
public required bool Success { get; set; }
|
||||
}
|
||||
|
||||
public class EntityListResult
|
||||
{
|
||||
[JsonPropertyName("Name")]
|
||||
public required string Name { get; set; }
|
||||
[JsonPropertyName("Attributes")]
|
||||
public required List<AttributeResult> Attributes { get; set; }
|
||||
[JsonPropertyName("Datapoints")]
|
||||
public required List<DatapointResult> Datapoints { get; set; }
|
||||
}
|
||||
|
||||
public class AttributeResult
|
||||
{
|
||||
[JsonPropertyName("Name")]
|
||||
public required string Name { get; set; }
|
||||
[JsonPropertyName("Value")]
|
||||
public required string Value { get; set; }
|
||||
}
|
||||
|
||||
public class DatapointResult
|
||||
{
|
||||
[JsonPropertyName("Name")]
|
||||
public required string Name { get; set; }
|
||||
[JsonPropertyName("ProbMethod")]
|
||||
public required string ProbMethod { get; set; }
|
||||
[JsonPropertyName("Embeddings")]
|
||||
public required List<EmbeddingResult>? Embeddings { get; set; }
|
||||
}
|
||||
|
||||
public class EmbeddingResult
|
||||
{
|
||||
[JsonPropertyName("Model")]
|
||||
public required string Model { get; set; }
|
||||
[JsonPropertyName("Embeddings")]
|
||||
public required float[] Embeddings { get; set; }
|
||||
}
|
||||
|
||||
public class EntityDeleteResults
|
||||
{
|
||||
[JsonPropertyName("Success")]
|
||||
public required bool Success { get; set; }
|
||||
}
|
||||
|
||||
32
src/Server/Models/SearchdomainResults.cs
Normal file
32
src/Server/Models/SearchdomainResults.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Server.Models;
|
||||
|
||||
public class SearchdomainListResults
|
||||
{
|
||||
[JsonPropertyName("Searchdomains")] // Otherwise the api returns {"searchdomains": [...]} and the client requires {"Searchdomains": [...]}
|
||||
public required List<string> Searchdomains { get; set; }
|
||||
}
|
||||
|
||||
public class SearchdomainCreateResults
|
||||
{
|
||||
[JsonPropertyName("Success")]
|
||||
public required bool Success { get; set; }
|
||||
|
||||
[JsonPropertyName("Id")]
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
|
||||
public class SearchdomainUpdateResults
|
||||
{
|
||||
[JsonPropertyName("Success")]
|
||||
public required bool Success { get; set; }
|
||||
}
|
||||
|
||||
public class SearchdomainDeleteResults
|
||||
{
|
||||
[JsonPropertyName("Success")]
|
||||
public required bool Success { get; set; }
|
||||
[JsonPropertyName("DeletedEntities")]
|
||||
public required int DeletedEntities { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user