Skip to content

Commit 4f1af65

Browse files
author
cinnazeyy
committed
add OwnerUuid and CreatedByUuid to PlotDto.cs
1 parent b73b816 commit 4f1af65

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

PlotSystem-API/Models/DTO/PlotDto.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ public class PlotDto
99
public required double PlotVersion { get; set; }
1010
public string? McVersion { get; set; }
1111
public byte[]? CompletedSchematic { get; set; }
12+
public string? OwnerUuid { get; set; }
13+
public required string CreatedByUuid { get; set; }
1214
}

PlotSystem-API/Services/PlotRepositorySql.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public class PlotRepositorySql(PlotSystemContext context) : IPlotRepository
1717
Status = plot.Status,
1818
McVersion = plot.McVersion,
1919
PlotVersion = plot.PlotVersion,
20-
CompletedSchematic = plot.CompleteSchematic
20+
CompletedSchematic = plot.CompleteSchematic,
21+
OwnerUuid = plot.OwnerUuid,
22+
CreatedByUuid = plot.CreatedBy
2123
};
2224
}
2325

@@ -31,7 +33,7 @@ public PlotDto CreatePlot(string cityProjectId, string difficultyId, string outl
3133
OutlineBounds = outlineBounds,
3234
CreatedBy = createPlayerUuid,
3335
InitialSchematic = initialSchematic,
34-
PlotVersion = plotVersion
36+
PlotVersion = plotVersion,
3537
};
3638
_ = context.Plots.Add(newPlot);
3739
context.SaveChanges();
@@ -42,7 +44,8 @@ public PlotDto CreatePlot(string cityProjectId, string difficultyId, string outl
4244
Id = newPlotId,
4345
CityProjectId = newPlot.CityProjectId,
4446
Status = newPlot.Status,
45-
PlotVersion = newPlot.PlotVersion
47+
PlotVersion = newPlot.PlotVersion,
48+
CreatedByUuid = newPlot.CreatedBy
4649
};
4750
}
4851

@@ -68,7 +71,9 @@ public List<PlotDto> GetPlotsToPaste()
6871
Status = plot.Status,
6972
McVersion = plot.McVersion,
7073
PlotVersion = plot.PlotVersion,
71-
CompletedSchematic = plot.CompleteSchematic
74+
CompletedSchematic = plot.CompleteSchematic,
75+
CreatedByUuid = plot.CreatedBy,
76+
OwnerUuid = plot.OwnerUuid
7277
})
7378
.ToList();
7479
}

0 commit comments

Comments
 (0)