-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67ead7e
commit fdeab9f
Showing
31 changed files
with
39,457 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
DOTNET_PROJ=mixyboos-api | ||
export DOTNET_PROJ=mixyboos-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,48 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Threading.Channels; | ||
using Mapster; | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.EntityFrameworkCore; | ||
using MixyBoos.Api.Data.DTO; | ||
using MixyBoos.Api.Data.Utils; | ||
|
||
namespace MixyBoos.Api.Data.Models; | ||
|
||
[Index(nameof(Slug), IsUnique = true)] | ||
public class MixyBoosUser : IdentityUser<Guid>, ISluggedEntity { | ||
public MixyBoosUser() { | ||
this.Followers = new List<MixyBoosUser>(); | ||
this.Following = new List<MixyBoosUser>(); | ||
this.Likes = new List<MixLike>(); | ||
this.Plays = new List<MixPlay>(); | ||
this.Shares = new List<MixShare>(); | ||
this.Downloads = new List<MixDownload>(); | ||
} | ||
|
||
[MaxLength(50)] public string Title { get; set; } | ||
[MaxLength(30)] public string DisplayName { get; set; } | ||
public string ProfileImage { get; set; } | ||
public string HeaderImage { get; set; } | ||
|
||
[SlugField(SourceField = "UserName")] | ||
public string Slug { get; set; } | ||
|
||
[MaxLength(100)] public string City { get; set; } | ||
[MaxLength(100)] public string Country { get; set; } | ||
[MaxLength(2048)] public string Biography { get; set; } | ||
public string StreamKey { get; set; } | ||
|
||
public ICollection<MixyBoosUser> Followers { get; set; } | ||
public ICollection<MixyBoosUser> Following { get; set; } | ||
|
||
public ICollection<MixPlay> Plays { get; set; } | ||
public ICollection<MixLike>? Likes { get; set; } | ||
public ICollection<MixShare>? Shares { get; set; } | ||
public ICollection<MixDownload>? Downloads { get; set; } | ||
[MaxLength(50)] public string Title { get; set; } | ||
[MaxLength(30)] public string DisplayName { get; set; } | ||
public string ProfileImage { get; set; } | ||
public string HeaderImage { get; set; } | ||
|
||
[SlugField(SourceField = "UserName")] | ||
public string Slug { get; set; } | ||
|
||
[MaxLength(100)] public string City { get; set; } | ||
[MaxLength(100)] public string Country { get; set; } | ||
[MaxLength(2048)] public string Biography { get; set; } | ||
public string StreamKey { get; set; } | ||
|
||
public ICollection<MixyBoosUser> Followers { get; set; } = new List<MixyBoosUser>(); | ||
public ICollection<MixyBoosUser> Following { get; set; } = new List<MixyBoosUser>(); | ||
|
||
public ICollection<MixPlay> Plays { get; set; } = new List<MixPlay>(); | ||
public ICollection<MixLike> Likes { get; set; } = new List<MixLike>(); | ||
public ICollection<MixShare> Shares { get; set; } = new List<MixShare>(); | ||
public ICollection<MixDownload> Downloads { get; set; } = new List<MixDownload>(); | ||
|
||
|
||
public void FromDto(ProfileDTO profile) { | ||
Slug = profile.Slug; | ||
Title = profile.Title; | ||
DisplayName = profile.DisplayName; | ||
City = profile.City; | ||
Country = profile.Country; | ||
Biography = profile.Biography; | ||
PhoneNumber = profile.PhoneNumber; | ||
} | ||
|
||
public ProfileDTO ToDto() => this.Adapt<ProfileDTO>(); | ||
} |
Oops, something went wrong.