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:
31
src/Icons/Models/Icon.cs
Normal file
31
src/Icons/Models/Icon.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user