1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-06 02:22:49 -05:00

Send APIs (#979)

* send work

* fix sql proj file

* update

* updates

* access id

* delete job

* fix delete job

* local send storage

* update sprocs for null checks
This commit is contained in:
Kyle Spearrin
2020-11-02 15:55:49 -05:00
committed by GitHub
parent a5db233e51
commit 82dd364e65
39 changed files with 1774 additions and 11 deletions

View File

@ -0,0 +1,18 @@
using Bit.Core.Models.Api;
namespace Bit.Core.Models.Data
{
public abstract class SendData
{
public SendData() { }
public SendData(SendRequestModel send)
{
Name = send.Name;
Notes = send.Notes;
}
public string Name { get; set; }
public string Notes { get; set; }
}
}

View File

@ -0,0 +1,37 @@
using System;
using Bit.Core.Models.Api;
using Newtonsoft.Json;
namespace Bit.Core.Models.Data
{
public class SendFileData : SendData
{
private long _size;
public SendFileData() { }
public SendFileData(SendRequestModel send, string fileName)
: base(send)
{
FileName = fileName;
}
[JsonIgnore]
public long Size
{
get { return _size; }
set { _size = value; }
}
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
[JsonProperty("Size")]
public string SizeString
{
get { return _size.ToString(); }
set { _size = Convert.ToInt64(value); }
}
public string Id { get; set; }
public string FileName { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using Bit.Core.Models.Api;
namespace Bit.Core.Models.Data
{
public class SendTextData : SendData
{
public SendTextData() { }
public SendTextData(SendRequestModel send)
: base(send)
{
Text = send.Text.Text;
Hidden = send.Text.Hidden;
}
public string Text { get; set; }
public bool Hidden { get; set; }
}
}