Initial files
This commit is contained in:
commit
691e049103
65 changed files with 4312 additions and 0 deletions
14
Start/Server/Models/ApplicationUser.cs
Normal file
14
Start/Server/Models/ApplicationUser.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using Microsoft.AspNetCore.Identity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Start.Server.Models
|
||||
{
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
/// <summary>The <see cref="BookmarkContainer"/>s that belong to this user</summary>
|
||||
public List<BookmarkContainer>? BookmarkContainers { get; set; }
|
||||
}
|
||||
}
|
||||
37
Start/Server/Models/Bookmark.cs
Normal file
37
Start/Server/Models/Bookmark.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Start.Server.Models {
|
||||
/// <summary>A bookmark with display text and a URL to link to</summary>
|
||||
public class Bookmark {
|
||||
/// <summary>A unique ID for the bookmark</summary>
|
||||
[Key]
|
||||
public int BookmarkId { get; set; }
|
||||
|
||||
/// <summary>The text to display for the bookmark</summary>
|
||||
[MaxLength(300)]
|
||||
public string Title { get; set; }
|
||||
/// <summary>The URL the bookmark links to</summary>
|
||||
[MaxLength(2000)] // De facto max length of URLs
|
||||
public string Url { get; set; }
|
||||
/// <summary>Arbitrary notes about the bookmark</summary>
|
||||
[MaxLength(5000)]
|
||||
public string? Notes { get; set; }
|
||||
|
||||
/// <summary>The unique ID for the group the bookmark is in</summary>
|
||||
public int BookmarkGroupId { get; set; }
|
||||
/// <summary>The group the bookmark is in</summary>
|
||||
public BookmarkGroup? BookmarkGroup { get; set; }
|
||||
|
||||
public Bookmark(string title, string url, int bookmarkGroupId) {
|
||||
this.Title = title;
|
||||
this.Url = url;
|
||||
this.BookmarkGroupId = bookmarkGroupId;
|
||||
}
|
||||
|
||||
public Bookmark(int bookmarkId, string title, string url, int bookmarkGroupId)
|
||||
: this(title, url, bookmarkGroupId) {
|
||||
this.BookmarkId = bookmarkId;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Start/Server/Models/BookmarkContainer.cs
Normal file
32
Start/Server/Models/BookmarkContainer.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Start.Server.Models {
|
||||
/// <summary>A group of <see cref="BookmarkGroup"/>s</summary>
|
||||
public class BookmarkContainer {
|
||||
/// <summary>A unique ID for the container</summary>
|
||||
[Key]
|
||||
public int BookmarkContainerId { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>The unique ID of the user that this container belongs to</summary>
|
||||
public string ApplicationUserId { get; set; }
|
||||
/// <summary>The user that this container belongs to</summary>
|
||||
public ApplicationUser? ApplicationUser { get; set; }
|
||||
|
||||
/// <summary>The <see cref="BookmarkGroup"/>s in this container</summary>
|
||||
public List<BookmarkGroup>? BookmarkGroups { get; set; }
|
||||
|
||||
public BookmarkContainer(string applicationUserId, string title) {
|
||||
this.ApplicationUserId = applicationUserId;
|
||||
this.Title = title;
|
||||
}
|
||||
|
||||
public BookmarkContainer(int bookmarkContainerId, string applicationUserId, string title)
|
||||
: this(applicationUserId, title) {
|
||||
this.BookmarkContainerId = bookmarkContainerId;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Start/Server/Models/BookmarkGroup.cs
Normal file
36
Start/Server/Models/BookmarkGroup.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Start.Server.Models {
|
||||
/// <summary>A group of <see cref="Bookmark"/>s</summary>
|
||||
public class BookmarkGroup {
|
||||
/// <summary>A unique ID for the group</summary>
|
||||
[Key]
|
||||
public int BookmarkGroupId { get; set; }
|
||||
|
||||
/// <summary>The title of the group</summary>
|
||||
[MaxLength(300)]
|
||||
public string Title { get; set; }
|
||||
/// <summary>A hex color for the group</summary>
|
||||
[MaxLength(6)]
|
||||
public string Color { get; set; }
|
||||
|
||||
/// <summary>The unique ID of the container this group is in</summary>
|
||||
public int BookmarkContainerId { get; set; }
|
||||
/// <summary>The container this group is in</summary>
|
||||
public BookmarkContainer? BookmarkContainer { get; set; }
|
||||
|
||||
/// <summary>The bookmarks in this group</summary>
|
||||
public List<Bookmark>? Bookmarks { get; set; }
|
||||
|
||||
public BookmarkGroup(string title, string color) {
|
||||
this.Title = title;
|
||||
this.Color = color;
|
||||
}
|
||||
|
||||
public BookmarkGroup(int bookmarkGroupId, string title, string color) : this(title, color) {
|
||||
this.BookmarkGroupId = bookmarkGroupId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue