Отчистка кода
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.Compendium;
|
using Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.Compendium;
|
||||||
|
|
||||||
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry
|
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry
|
||||||
|
|||||||
+1
-3
@@ -1,6 +1,4 @@
|
|||||||
using LinqToDB.DataProvider.SapHana;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Npgsql;
|
|
||||||
|
|
||||||
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder
|
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-3
@@ -1,6 +1,4 @@
|
|||||||
using System.Reflection;
|
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder
|
||||||
|
|
||||||
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder
|
|
||||||
{
|
{
|
||||||
[AttributeUsage(AttributeTargets.Class)]
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
internal class Pf2eTypeProcessor(string type) : Attribute
|
internal class Pf2eTypeProcessor(string type) : Attribute
|
||||||
|
|||||||
-1
@@ -2,7 +2,6 @@
|
|||||||
using Pf2eDataScrapper.Model;
|
using Pf2eDataScrapper.Model;
|
||||||
using Pf2eDataScrapper.Model.Enum;
|
using Pf2eDataScrapper.Model.Enum;
|
||||||
using Slugify;
|
using Slugify;
|
||||||
using static LinqToDB.Common.Configuration;
|
|
||||||
|
|
||||||
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder.Processors
|
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder.Processors
|
||||||
{
|
{
|
||||||
|
|||||||
-1
@@ -1,5 +1,4 @@
|
|||||||
using Konsole;
|
using Konsole;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.Compendium;
|
using Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.Compendium;
|
||||||
using Pf2eDataScrapper.SchemaBuilder;
|
using Pf2eDataScrapper.SchemaBuilder;
|
||||||
|
|
||||||
|
|||||||
+1
-6
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Newtonsoft.Json.Linq;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Pf2eDataScrapper.SchemaBuilder;
|
using Pf2eDataScrapper.SchemaBuilder;
|
||||||
using Pf2eDataScrapper.SchemaBuilder.Types;
|
using Pf2eDataScrapper.SchemaBuilder.Types;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
using System;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Reflection;
|
|
||||||
using LinqToDB.SqlQuery;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
using Pf2eDataScrapper.Model;
|
using Pf2eDataScrapper.Model;
|
||||||
using Pf2eDataScrapper.Model.Enum;
|
using Pf2eDataScrapper.Model.Enum;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Pf2eDataScrapper;
|
namespace Pf2eDataScrapper;
|
||||||
|
|
||||||
@@ -103,7 +100,8 @@ public partial class Pf2eTestContext : DbContext
|
|||||||
|
|
||||||
public virtual DbSet<Trait> Traits { get; set; }
|
public virtual DbSet<Trait> Traits { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
{
|
||||||
optionsBuilder.UseNpgsql(EnvSettings.DatabaseConnection,
|
optionsBuilder.UseNpgsql(EnvSettings.DatabaseConnection,
|
||||||
builder =>
|
builder =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -139,7 +139,8 @@ namespace Pf2eDataScrapper.SchemaBuilder
|
|||||||
/// <returns>Строковое представление элемента.</returns>
|
/// <returns>Строковое представление элемента.</returns>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
var result = new Dictionary<string, string>() {
|
var result = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
["type"] = GetTypeName(),
|
["type"] = GetTypeName(),
|
||||||
["path"] = Path,
|
["path"] = Path,
|
||||||
["is_null"] = IsNullable ? "true" : "false",
|
["is_null"] = IsNullable ? "true" : "false",
|
||||||
@@ -204,7 +205,7 @@ namespace Pf2eDataScrapper.SchemaBuilder
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input">Словарь данных.</param>
|
/// <param name="input">Словарь данных.</param>
|
||||||
/// <returns>Строка форматированных данных</returns>
|
/// <returns>Строка форматированных данных</returns>
|
||||||
public static string FormatYaml(params Dictionary<string, string>[] input)
|
public static string FormatYaml(params List<Dictionary<string, string>> input)
|
||||||
{
|
{
|
||||||
var result = "";
|
var result = "";
|
||||||
|
|
||||||
@@ -218,7 +219,7 @@ namespace Pf2eDataScrapper.SchemaBuilder
|
|||||||
return result.Trim();
|
return result.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string, string> MergeDictionaries(params Dictionary<string, string>[] input)
|
public static Dictionary<string, string> MergeDictionaries(params List<Dictionary<string, string>> input)
|
||||||
{
|
{
|
||||||
var result = new Dictionary<string, string>();
|
var result = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ namespace Pf2eDataScrapper.SchemaBuilder.Types
|
|||||||
/// <returns>Словарь данных</returns>
|
/// <returns>Словарь данных</returns>
|
||||||
public override Dictionary<string, string> GetYamlData()
|
public override Dictionary<string, string> GetYamlData()
|
||||||
{
|
{
|
||||||
return new() {
|
return new()
|
||||||
|
{
|
||||||
["schema"] = SchemaNode.FormatYaml(GetSchemaYaml())
|
["schema"] = SchemaNode.FormatYaml(GetSchemaYaml())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Linq.Expressions;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
|
|
||||||
namespace Pf2eDataScrapper.SchemaBuilder.Types
|
namespace Pf2eDataScrapper.SchemaBuilder.Types
|
||||||
{
|
{
|
||||||
@@ -91,7 +90,8 @@ namespace Pf2eDataScrapper.SchemaBuilder.Types
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new() {
|
return new()
|
||||||
|
{
|
||||||
["different_values"] = count.ToString() +
|
["different_values"] = count.ToString() +
|
||||||
((count == Root.Values) ? " (all different)" : "") +
|
((count == Root.Values) ? " (all different)" : "") +
|
||||||
((count == 1) ? " (all same)" : ""),
|
((count == 1) ? " (all same)" : ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user