109 lines
3.9 KiB
C#
109 lines
3.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Sozsoft.Mcp.Dtos;
|
|
|
|
/// <summary>
|
|
/// Istegin kiracisina dusen MCP sunucu kaydinin etkin hali. /mcp ucu hangi araclari
|
|
/// listeleyecegine ve sorgularin hangi satir tavaniyla kosacagina bu kayda bakarak karar verir.
|
|
/// </summary>
|
|
public class McpServerConfigDto
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>Ekranda gosterilen baglanti adresi; sunucu tarafinda yonlendirme icin kullanilmaz.</summary>
|
|
public string? Url { get; set; }
|
|
|
|
/// <summary>Bos ise istegin kapsamindaki varsayilan veri kaynagi kullanilir.</summary>
|
|
public string? DataSourceCode { get; set; }
|
|
|
|
/// <summary>Bos liste "yazma disindaki tum araclar acik" anlamina gelir.</summary>
|
|
public List<string> AllowedTools { get; set; } = [];
|
|
|
|
public int MaxRows { get; set; }
|
|
|
|
public bool AllowWrite { get; set; }
|
|
|
|
public string? Description { get; set; }
|
|
|
|
/// <summary>Istegin cozumlenen kiraci adi; host baglaminda bostur.</summary>
|
|
public string? TenantName { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Veri sozlugunun tazelik bilgisi. Sozluk <c>Sas_H_DbTableColumn</c> tablosunda, sozluk
|
|
/// ureten prosedur tarafindan yazilmis JSON olarak durur.
|
|
/// </summary>
|
|
public class McpSchemaInfoDto
|
|
{
|
|
public bool Available { get; set; }
|
|
public string? CacheKey { get; set; }
|
|
public DateTime? RefreshedAt { get; set; }
|
|
public int FormCount { get; set; }
|
|
public int FieldCount { get; set; }
|
|
public string? TenantName { get; set; }
|
|
public string? DefinitionCultureName { get; set; }
|
|
public string? UiCultureName { get; set; }
|
|
|
|
/// <summary>Sozluk bulunamadiginda ne yapilacagini anlatan mesaj.</summary>
|
|
public string? Message { get; set; }
|
|
}
|
|
|
|
/// <summary>Bir listenin (ListForm) ozet tanimi.</summary>
|
|
public class McpListSummaryDto
|
|
{
|
|
public string ListFormCode { get; set; } = string.Empty;
|
|
public string? DisplayName { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? Description { get; set; }
|
|
|
|
/// <summary>Listenin arkasindaki tablo adi; SELECT tabanli listelerde bostur.</summary>
|
|
public string? TableName { get; set; }
|
|
|
|
/// <summary>Tablo adi ya da SELECT metni — listenin gercek SQL kaynagi.</summary>
|
|
public string? SqlSourceName { get; set; }
|
|
|
|
/// <summary><c>table</c>, <c>selectSql</c> ya da <c>unknown</c>.</summary>
|
|
public string? SourceKind { get; set; }
|
|
|
|
public string? KeyFieldName { get; set; }
|
|
public int FieldCount { get; set; }
|
|
}
|
|
|
|
/// <summary>Bir listenin sutun tanimi.</summary>
|
|
public class McpColumnDto
|
|
{
|
|
public string Field { get; set; } = string.Empty;
|
|
public string? DisplayName { get; set; }
|
|
public string? SqlDataType { get; set; }
|
|
public bool IsVisible { get; set; }
|
|
public bool IsBooleanColumn { get; set; }
|
|
|
|
/// <summary>Lookup tasiyan sutunda hedef tablo; yoksa bostur.</summary>
|
|
public string? LookupTableName { get; set; }
|
|
public string? LookupValueColumn { get; set; }
|
|
public string? LookupDisplayColumn { get; set; }
|
|
|
|
/// <summary>Parola/token/anahtar gibi sutunlarda true; sorgu araclari bunlari onermez.</summary>
|
|
public bool IsSensitive { get; set; }
|
|
|
|
/// <summary>Varsayilan SELECT listesine girmesi uygun olan sutunlarda true.</summary>
|
|
public bool IsDefaultSelectColumn { get; set; }
|
|
}
|
|
|
|
/// <summary>Bir listenin sutunlariyla birlikte tam tanimi.</summary>
|
|
public class McpListDetailDto : McpListSummaryDto
|
|
{
|
|
public List<McpColumnDto> Columns { get; set; } = [];
|
|
}
|
|
|
|
/// <summary>Serbest metin aramasinin tek sonucu.</summary>
|
|
public class McpSchemaMatchDto
|
|
{
|
|
public string ListFormCode { get; set; } = string.Empty;
|
|
public string? DisplayName { get; set; }
|
|
public string? TableName { get; set; }
|
|
|
|
/// <summary>Eslesme yalnizca liste duzeyindeyse bos; sutun duzeyindeyse eslesen sutunlar.</summary>
|
|
public List<McpColumnDto> MatchedColumns { get; set; } = [];
|
|
}
|