35 lines
929 B
C#
35 lines
929 B
C#
using Gameboard.ShogiUI.Sockets.Models;
|
|
using System;
|
|
|
|
namespace Gameboard.ShogiUI.Sockets.Repositories.CouchModels
|
|
{
|
|
public class UserDocument : CouchDocument
|
|
{
|
|
|
|
public string Name { get; set; }
|
|
public WhichLoginPlatform Platform { get; set; }
|
|
/// <summary>
|
|
/// The browser session ID saved via Set-Cookie headers.
|
|
/// Only used with guest accounts.
|
|
/// </summary>
|
|
public Guid? WebSessionId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Constructor for JSON deserializing.
|
|
/// </summary>
|
|
public UserDocument() : base(WhichDocumentType.User)
|
|
{
|
|
Name = string.Empty;
|
|
}
|
|
|
|
public UserDocument(string name, Guid? webSessionId = null) : base($"org.couchdb.user:{name}", WhichDocumentType.User)
|
|
{
|
|
Name = name;
|
|
WebSessionId = webSessionId;
|
|
Platform = WebSessionId.HasValue
|
|
? WhichLoginPlatform.Guest
|
|
: WhichLoginPlatform.Microsoft;
|
|
}
|
|
}
|
|
}
|