Change id types (#114)

* Change id types

* Updated more models

* Saving changes

* Should be it
This commit was merged in pull request #114.
This commit is contained in:
KD
2025-04-03 21:13:05 -04:00
committed by GitHub
parent 12c4f56a22
commit 8abb196e1d
29 changed files with 147 additions and 37 deletions
+19
View File
@@ -0,0 +1,19 @@
# Top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.cs]
# Use 'var' when possible
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# Use expression body for methods
csharp_style_expression_bodied_methods = true:silent
+4 -2
View File
@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Icarus.Models;
@@ -6,11 +7,12 @@ public class AccessLevel
{
#region Properties
[Newtonsoft.Json.JsonProperty("id")]
public int Id { get; set; }
[Key]
public Guid Id { get; set; }
[Newtonsoft.Json.JsonProperty("level")]
public string? Level { get; set; }
[Newtonsoft.Json.JsonProperty("song_id")]
public int SongId { get; set; }
public Guid SongId { get; set; }
#endregion
#region Methods
+3 -1
View File
@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -8,7 +9,8 @@ public class Album
{
#region Properties
[JsonProperty("id")]
public int Id { get; set; }
[Key]
public Guid Id { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("album_artist")]
+3 -1
View File
@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -8,7 +9,8 @@ public class Artist
{
#region Properties
[JsonProperty("id")]
public int Id { get; set; }
[Key]
public Guid Id { get; set; }
[JsonProperty("name")]
[Column("Artist")]
public string? Name { get; set; }
+4 -1
View File
@@ -1,3 +1,5 @@
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace Icarus.Models;
@@ -6,7 +8,8 @@ public class CoverArt
{
#region Properties
[JsonProperty("id")]
public int Id { get; set; }
[Key]
public Guid Id { get; set; }
[JsonProperty("title")]
public string? SongTitle { get; set; }
[JsonIgnore]
-3
View File
@@ -1,6 +1,3 @@
namespace Icarus.Models;
public enum CreateFileResult
+2 -1
View File
@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -8,7 +9,7 @@ public class Genre
{
#region Properties
[JsonProperty("id")]
public int Id { get; set; }
public Guid Id { get; set; }
[JsonProperty("genre")]
[Column("Category")]
public string? GenreName { get; set; }
+1 -1
View File
@@ -6,7 +6,7 @@ public class LoginResult : BaseResult
{
#region Properties
[JsonProperty("user_id")]
public int UserId { get; set; }
public Guid UserId { get; set; }
[JsonProperty("username")]
public string? Username { get; set; }
[JsonProperty("token")]
+8 -6
View File
@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -8,7 +9,8 @@ public class Song
{
#region Properties
[JsonProperty("id")]
public int Id { get; set; }
[Key]
public Guid Id { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("album")]
@@ -39,17 +41,17 @@ public class Song
[JsonProperty("disc_count")]
public int DiscCount { get; set; } = 0;
[JsonIgnore]
public int? AlbumId { get; set; }
public Guid? AlbumId { get; set; }
[JsonIgnore]
public int? ArtistId { get; set; }
public Guid? ArtistId { get; set; }
[JsonIgnore]
public int? GenreId { get; set; }
public Guid? GenreId { get; set; }
[JsonIgnore]
public int? CoverArtId { get; set; }
public Guid? CoverArtId { get; set; }
[JsonProperty("date_created")]
public DateTime DateCreated { get; set; }
[JsonProperty("user_id")]
public int UserId { get; set; }
public Guid UserId { get; set; }
#endregion
+1 -1
View File
@@ -3,7 +3,7 @@ namespace Icarus.Models;
public class SongData
{
#region Properties
public int ID { get; set; }
public Guid ID { get; set; }
public byte[]? Data { get; set; }
public int SongID { get; set; }
#endregion
+1 -1
View File
@@ -12,7 +12,7 @@ public class User
[JsonProperty("id")]
[Column("Id")]
[Key]
public int Id { get; set; }
public Guid Id { get; set; }
[JsonProperty("username")]
public string? Username { get; set; }
[JsonProperty("password")]