datetime etc
This commit is contained in:
parent
0d7da2ea85
commit
59d660165f
7 changed files with 23 additions and 23 deletions
|
@ -3,4 +3,4 @@ using JetBrains.Annotations;
|
||||||
namespace Femto.Api.Controllers.Authors.Dto;
|
namespace Femto.Api.Controllers.Authors.Dto;
|
||||||
|
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public record AuthorPostDto(Guid PostId, string Content, IEnumerable<Uri> Media, DateTime CreatedAt, AuthoPostAuthorDto Author );
|
public record AuthorPostDto(Guid PostId, string Content, IEnumerable<Uri> Media, DateTimeOffset CreatedAt, AuthoPostAuthorDto Author );
|
|
@ -8,5 +8,5 @@ public record PublicPostDto(
|
||||||
Guid PostId,
|
Guid PostId,
|
||||||
string Content,
|
string Content,
|
||||||
IEnumerable<Uri> Media,
|
IEnumerable<Uri> Media,
|
||||||
DateTime CreatedAt
|
DateTimeOffset CreatedAt
|
||||||
);
|
);
|
|
@ -13,7 +13,7 @@ CREATE TABLE blog.post
|
||||||
(
|
(
|
||||||
id uuid PRIMARY KEY,
|
id uuid PRIMARY KEY,
|
||||||
content text NOT NULL,
|
content text NOT NULL,
|
||||||
created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
posted_on timestamptz NOT NULL DEFAULT now(),
|
||||||
author_id uuid NOT NULL REFERENCES blog.author (id) on DELETE CASCADE
|
author_id uuid NOT NULL REFERENCES blog.author (id) on DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ CREATE TABLE blog.outbox
|
||||||
event_type text NOT NULL,
|
event_type text NOT NULL,
|
||||||
aggregate_id uuid NOT NULL,
|
aggregate_id uuid NOT NULL,
|
||||||
payload jsonb NOT NULL,
|
payload jsonb NOT NULL,
|
||||||
created_at timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
created_at timestamp DEFAULT now() NOT NULL,
|
||||||
processed_at timestamp,
|
processed_at timestamp,
|
||||||
next_retry_at timestamp,
|
next_retry_at timestamp,
|
||||||
retry_count int DEFAULT 0 NOT NULL,
|
retry_count int DEFAULT 0 NOT NULL,
|
||||||
|
@ -47,7 +47,7 @@ CREATE SCHEMA media;
|
||||||
CREATE TABLE media.saved_blob
|
CREATE TABLE media.saved_blob
|
||||||
(
|
(
|
||||||
id uuid PRIMARY KEY,
|
id uuid PRIMARY KEY,
|
||||||
created_on timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
uploaded_on timestamp DEFAULT now() NOT NULL,
|
||||||
type varchar(64) NOT NULL,
|
type varchar(64) NOT NULL,
|
||||||
size int
|
size int
|
||||||
);
|
);
|
|
@ -1,3 +1,3 @@
|
||||||
namespace Femto.Modules.Blog.Domain.Posts.Commands.GetPosts.Dto;
|
namespace Femto.Modules.Blog.Domain.Posts.Commands.GetPosts.Dto;
|
||||||
|
|
||||||
public record PostDto(Guid PostId, string Text, IList<PostMediaDto> Media, DateTime CreatedAt, PostAuthorDto Author);
|
public record PostDto(Guid PostId, string Text, IList<PostMediaDto> Media, DateTimeOffset CreatedAt, PostAuthorDto Author);
|
|
@ -40,7 +40,7 @@ public class GetPostsQueryHandler(IDbConnectionFactory connectionFactory)
|
||||||
page.id as PostId,
|
page.id as PostId,
|
||||||
page.content as Content,
|
page.content as Content,
|
||||||
blog.post_media.url as MediaUrl,
|
blog.post_media.url as MediaUrl,
|
||||||
page.created_on as CreatedAt,
|
page.posted_on as PostedOn,
|
||||||
page.Username,
|
page.Username,
|
||||||
page.AuthorId
|
page.AuthorId
|
||||||
from page
|
from page
|
||||||
|
@ -76,7 +76,7 @@ public class GetPostsQueryHandler(IDbConnectionFactory connectionFactory)
|
||||||
postId,
|
postId,
|
||||||
post.Content,
|
post.Content,
|
||||||
media,
|
media,
|
||||||
post.CreatedAt,
|
post.PostedOn,
|
||||||
new PostAuthorDto(post.AuthorId, post.Username)
|
new PostAuthorDto(post.AuthorId, post.Username)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
@ -92,7 +92,7 @@ public class GetPostsQueryHandler(IDbConnectionFactory connectionFactory)
|
||||||
public Guid PostId { get; set; }
|
public Guid PostId { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
public string? MediaUrl { get; set; }
|
public string? MediaUrl { get; set; }
|
||||||
public DateTime CreatedAt { get; set; }
|
public DateTimeOffset PostedOn { get; set; }
|
||||||
public Guid AuthorId { get; set; }
|
public Guid AuthorId { get; set; }
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,6 @@ public class PostCreatedIntegrationEventHandler : INotificationHandler<PostCreat
|
||||||
{
|
{
|
||||||
public async Task Handle(PostCreatedIntegrationEvent notification, CancellationToken cancellationToken)
|
public async Task Handle(PostCreatedIntegrationEvent notification, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
// todo
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,14 +6,14 @@ namespace Femto.Modules.Media.Data;
|
||||||
internal class SavedBlob
|
internal class SavedBlob
|
||||||
{
|
{
|
||||||
public Guid Id { get; private set; }
|
public Guid Id { get; private set; }
|
||||||
public DateTime CreatedOn { get; private set; }
|
public DateTime UploadedOn { get; private set; }
|
||||||
public string Type { get; private set; }
|
public string Type { get; private set; }
|
||||||
public long? Size { get; private set; }
|
public long? Size { get; private set; }
|
||||||
|
|
||||||
public SavedBlob(Guid id, string type, long? size)
|
public SavedBlob(Guid id, string type, long? size)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
CreatedOn = DateTime.UtcNow;
|
UploadedOn = DateTime.UtcNow;
|
||||||
Type = type;
|
Type = type;
|
||||||
Size = size;
|
Size = size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue