1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-19 09:43:27 +00:00

setup more models

This commit is contained in:
Kyle Spearrin
2019-04-12 10:06:47 -04:00
parent a1ba2bf60b
commit c89805d123
14 changed files with 412 additions and 7 deletions

View File

@@ -0,0 +1,34 @@
using Bit.Core.Enums;
using Bit.Core.Models.Domain;
namespace Bit.Core.Models.View
{
public class LoginUriView : View
{
private string _uri;
private string _domain;
private string _hostname;
private bool? _canLaunch;
public LoginUriView() { }
public LoginUriView(LoginUri u)
{
Match = u.Match;
}
public UriMatchType? Match { get; set; }
public string Uri
{
get => _uri;
set
{
_uri = value;
_domain = null;
_canLaunch = null;
}
}
// TODO
}
}

View File

@@ -0,0 +1,27 @@
using Bit.Core.Models.Domain;
using System;
using System.Collections.Generic;
namespace Bit.Core.Models.View
{
public class LoginView : View
{
public LoginView() { }
public LoginView(Login l)
{
PasswordRevisionDate = l.PasswordRevisionDate;
}
public string Username { get; set; }
public string Password { get; set; }
public DateTime? PasswordRevisionDate { get; set; }
public string Totp { get; set; }
public List<LoginUriView> Uris { get; set; }
public string Uri => HashUris ? Uris[0].Uri : null;
public string MaskedPassword => Password != null ? "••••••••" : null;
public string SubTitle => Username;
// TODO: uri launch props
public bool HashUris => (Uris?.Count ?? 0) > 0;
}
}