Mail support
Deploy Promiscuity Auth API / deploy (push) Successful in 48s
Deploy Promiscuity Character API / deploy (push) Successful in 59s
Deploy Promiscuity Inventory API / deploy (push) Successful in 46s
Deploy Promiscuity Locations API / deploy (push) Successful in 1m0s
Deploy Promiscuity Mail API / deploy (push) Successful in 1m9s
k8s smoke test / test (push) Successful in 9s
Deploy Promiscuity Auth API / deploy (push) Successful in 48s
Deploy Promiscuity Character API / deploy (push) Successful in 59s
Deploy Promiscuity Inventory API / deploy (push) Successful in 46s
Deploy Promiscuity Locations API / deploy (push) Successful in 1m0s
Deploy Promiscuity Mail API / deploy (push) Successful in 1m9s
k8s smoke test / test (push) Successful in 9s
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace MailApi.Models;
|
||||
|
||||
public class MailMessage
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[BsonElement("senderCharacterId")]
|
||||
public string SenderCharacterId { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("senderCharacterName")]
|
||||
public string SenderCharacterName { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("recipientCharacterId")]
|
||||
public string RecipientCharacterId { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("recipientCharacterName")]
|
||||
public string RecipientCharacterName { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("subject")]
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("body")]
|
||||
public string Body { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("createdUtc")]
|
||||
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[BsonElement("readUtc")]
|
||||
public DateTime? ReadUtc { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace MailApi.Models;
|
||||
|
||||
public class MailMessageResponse
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
public string SenderCharacterId { get; set; } = string.Empty;
|
||||
|
||||
public string SenderCharacterName { get; set; } = string.Empty;
|
||||
|
||||
public string RecipientCharacterId { get; set; } = string.Empty;
|
||||
|
||||
public string RecipientCharacterName { get; set; } = string.Empty;
|
||||
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
|
||||
public string Body { get; set; } = string.Empty;
|
||||
|
||||
public DateTime CreatedUtc { get; set; }
|
||||
|
||||
public DateTime? ReadUtc { get; set; }
|
||||
|
||||
public static MailMessageResponse FromModel(MailMessage message) => new()
|
||||
{
|
||||
Id = message.Id ?? string.Empty,
|
||||
SenderCharacterId = message.SenderCharacterId,
|
||||
SenderCharacterName = message.SenderCharacterName,
|
||||
RecipientCharacterId = message.RecipientCharacterId,
|
||||
RecipientCharacterName = message.RecipientCharacterName,
|
||||
Subject = message.Subject,
|
||||
Body = message.Body,
|
||||
CreatedUtc = message.CreatedUtc,
|
||||
ReadUtc = message.ReadUtc
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace MailApi.Models;
|
||||
|
||||
public class MailboxResponse
|
||||
{
|
||||
public string CharacterId { get; set; } = string.Empty;
|
||||
|
||||
public List<MailMessageResponse> Inbox { get; set; } = [];
|
||||
|
||||
public List<MailMessageResponse> Sent { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace MailApi.Models;
|
||||
|
||||
public class SendMailRequest
|
||||
{
|
||||
public string RecipientCharacterName { get; set; } = string.Empty;
|
||||
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
|
||||
public string Body { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user