Skip to content

Commit 7919b41

Browse files
committed
update database to current model, update dependencies and fix warnings
1 parent f038ce5 commit 7919b41

19 files changed

Lines changed: 175 additions & 153 deletions

PlotSystem-API/Controllers/CityProjectController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.AspNetCore.Mvc;
22
using PlotSystem_API.Extensions;
3-
using PlotSystem_API.Models;
43
using PlotSystem_API.Models.DTO;
54
using PlotSystem_API.Services;
65

PlotSystem-API/Models/BuildTeam.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace PlotSystem_API.Models;
54

@@ -9,15 +8,16 @@ public partial class BuildTeam
98

109
public string Name { get; set; } = null!;
1110

11+
[MaxLength(255)]
1212
public string? ApiKey { get; set; }
1313

1414
public DateTime? ApiCreateDate { get; set; }
1515

16-
public virtual ICollection<Server> Servers { get; set; } = new List<Server>();
17-
1816
public virtual ICollection<CityProject> CityProjects { get; set; } = new List<CityProject>();
1917

20-
public virtual ICollection<Country> CountryCodes { get; set; } = new List<Country>();
18+
public virtual ICollection<Server> Servers { get; set; } = new List<Server>();
19+
20+
public virtual ICollection<ReviewToggleCriterion> CriteriaNames { get; set; } = new List<ReviewToggleCriterion>();
2121

2222
public virtual ICollection<Builder> Uus { get; set; } = new List<Builder>();
2323
}

PlotSystem-API/Models/Builder.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace PlotSystem_API.Models;
54

65
public partial class Builder
76
{
87
public string Uuid { get; set; } = null!;
98

9+
[MaxLength(255)]
1010
public string Name { get; set; } = null!;
1111

1212
public int Score { get; set; }
@@ -19,9 +19,11 @@ public partial class Builder
1919

2020
public int PlotType { get; set; }
2121

22-
public virtual ICollection<BuilderHasPlot> BuilderHasPlots { get; set; } = new List<BuilderHasPlot>();
22+
public virtual ICollection<Plot> PlotsNavigation { get; set; } = new List<Plot>();
2323

2424
public virtual ICollection<BuildTeam> BuildTeams { get; set; } = new List<BuildTeam>();
2525

26+
public virtual ICollection<Plot> Plots { get; set; } = new List<Plot>();
27+
2628
public virtual ICollection<PlotReview> Reviews { get; set; } = new List<PlotReview>();
2729
}

PlotSystem-API/Models/BuilderHasPlot.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace PlotSystem_API.Models;
54

65
public partial class CityProject
76
{
7+
[MaxLength(255)]
88
public string CityProjectId { get; set; } = null!;
99

10+
public int BuildTeamId { get; set; }
11+
1012
public string CountryCode { get; set; } = null!;
1113

14+
[MaxLength(255)]
1215
public string ServerName { get; set; } = null!;
1316

1417
public bool IsVisible { get; set; }
1518

19+
public virtual BuildTeam BuildTeam { get; set; } = null!;
20+
1621
public virtual Country CountryCodeNavigation { get; set; } = null!;
1722

1823
public virtual ICollection<Plot> Plots { get; set; } = new List<Plot>();
1924

2025
public virtual Server ServerNameNavigation { get; set; } = null!;
21-
22-
public virtual ICollection<BuildTeam> BuildTeams { get; set; } = new List<BuildTeam>();
2326
}

PlotSystem-API/Models/Country.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace PlotSystem_API.Models;
54

65
public partial class Country
76
{
87
public string CountryCode { get; set; } = null!;
98

9+
[MaxLength(2)]
1010
public string Continent { get; set; } = null!;
1111

1212
public string Material { get; set; } = null!;
1313

1414
public string? CustomModelData { get; set; }
1515

1616
public virtual ICollection<CityProject> CityProjects { get; set; } = new List<CityProject>();
17-
18-
public virtual ICollection<BuildTeam> BuildTeams { get; set; } = new List<BuildTeam>();
1917
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
namespace PlotSystem_API.Models.DTO
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace PlotSystem_API.Models.DTO
23
{
34
public class CityProjectDto
45
{
5-
public string Id { get; set; }
6-
public string CountryCode { get; set; }
7-
public bool IsVisible { get; set; }
8-
public string Material { get; set; }
6+
public required string Id { get; set; }
7+
public required string CountryCode { get; set; }
8+
public required bool IsVisible { get; set; }
9+
public required string Material { get; set; }
910
public string? CustomModelData { get; set; }
10-
public string ServerName { get; set; }
11+
public required string ServerName { get; set; }
1112
}
1213
}
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
namespace PlotSystem_API.Models.DTO;
1+
// ReSharper disable UnusedAutoPropertyAccessor.Global
2+
namespace PlotSystem_API.Models.DTO;
23

34
public class PlotDto
45
{
5-
public int Id { get; set; }
6-
public string Status { get; set; }
7-
public string CityProjectId { get; set; }
8-
public double PlotVersion { get; set; }
6+
public required int Id { get; set; }
7+
public required string Status { get; set; }
8+
public required string CityProjectId { get; set; }
9+
public required double PlotVersion { get; set; }
910
public string? McVersion { get; set; }
1011
public byte[]? CompletedSchematic { get; set; }
1112
}

PlotSystem-API/Models/Plot.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace PlotSystem_API.Models;
54

65
public partial class Plot
76
{
87
public int PlotId { get; set; }
98

9+
[MaxLength(255)]
1010
public string CityProjectId { get; set; } = null!;
1111

12+
[MaxLength(255)]
1213
public string DifficultyId { get; set; } = null!;
1314

15+
public string? OwnerUuid { get; set; }
16+
17+
[MaxLength(255)]
1418
public string Status { get; set; } = null!;
1519

1620
public int? Score { get; set; }
17-
21+
1822
public string OutlineBounds { get; set; } = null!;
1923

2024
public byte[] InitialSchematic { get; set; } = null!;
@@ -29,15 +33,19 @@ public partial class Plot
2933

3034
public double PlotVersion { get; set; }
3135

36+
public int PlotType { get; set; }
37+
3238
public string CreatedBy { get; set; } = null!;
3339

3440
public DateTime CreateDate { get; set; }
3541

36-
public virtual ICollection<BuilderHasPlot> BuilderHasPlots { get; set; } = new List<BuilderHasPlot>();
37-
3842
public virtual CityProject CityProject { get; set; } = null!;
3943

4044
public virtual PlotDifficulty Difficulty { get; set; } = null!;
4145

46+
public virtual Builder? OwnerUu { get; set; }
47+
4248
public virtual ICollection<PlotReview> PlotReviews { get; set; } = new List<PlotReview>();
49+
50+
public virtual ICollection<Builder> Uus { get; set; } = new List<Builder>();
4351
}

PlotSystem-API/Models/PlotDifficulty.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace PlotSystem_API.Models;
54

65
public partial class PlotDifficulty
76
{
7+
[MaxLength(255)]
88
public string DifficultyId { get; set; } = null!;
99

1010
public decimal? Multiplier { get; set; }

0 commit comments

Comments
 (0)