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:
18
src/Core/Models/Data/SendData.cs
Normal file
18
src/Core/Models/Data/SendData.cs
Normal 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; }
|
||||
}
|
||||
}
|
37
src/Core/Models/Data/SendFileData.cs
Normal file
37
src/Core/Models/Data/SendFileData.cs
Normal 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; }
|
||||
}
|
||||
}
|
19
src/Core/Models/Data/SendTextData.cs
Normal file
19
src/Core/Models/Data/SendTextData.cs
Normal 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; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user