1
0
mirror of https://github.com/bitwarden/server synced 2025-12-30 15:14:02 +00:00

Add Icons application for serving website icons.

This commit is contained in:
Hinton
2017-10-08 22:23:17 +02:00
parent c7e7734dfc
commit ea5213698d
9 changed files with 251 additions and 0 deletions

31
src/Icons/Models/Icon.cs Normal file
View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
namespace Icons.Models
{
[Serializable]
public class Icon
{
public byte[] Image { get; }
public string Format { get; }
public DateTime CreatedAt { get; }
public Icon(byte[] image, string format)
{
this.Image = image;
this.Format = format;
this.CreatedAt = DateTime.Now;
}
public bool HasNotExpired()
{
return CreatedAt > DateTime.Now.AddDays(-1);
}
}
}