Skip to content

Commit

Permalink
Merge pull request #6 from thisisnabi/refactor/project-structure
Browse files Browse the repository at this point in the history
Refactor/project structure
  • Loading branch information
thisisnabi authored Apr 27, 2024
2 parents 2f13b51 + de878b4 commit c8bd610
Show file tree
Hide file tree
Showing 187 changed files with 319 additions and 876 deletions.
7 changes: 7 additions & 0 deletions Thisisnabi.Blogger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blogger.FunctionalTests", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blogger.UnitTests", "tests\Blogger.UnitTests\Blogger.UnitTests.csproj", "{51E5814B-9063-4B3F-8617-478F4D7DCB07}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blogger.IntegrationTests", "tests\Blogger.IntegrationTests\Blogger.IntegrationTests.csproj", "{D2790D2D-B93D-44C5-BC8B-BCA3F3631996}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -55,6 +57,10 @@ Global
{51E5814B-9063-4B3F-8617-478F4D7DCB07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51E5814B-9063-4B3F-8617-478F4D7DCB07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51E5814B-9063-4B3F-8617-478F4D7DCB07}.Release|Any CPU.Build.0 = Release|Any CPU
{D2790D2D-B93D-44C5-BC8B-BCA3F3631996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2790D2D-B93D-44C5-BC8B-BCA3F3631996}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2790D2D-B93D-44C5-BC8B-BCA3F3631996}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2790D2D-B93D-44C5-BC8B-BCA3F3631996}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -67,6 +73,7 @@ Global
{6652F99E-5CFE-47D6-8A27-CCDDC223889A} = {D4AB33E9-9464-4BE3-BBF2-B93AD34BE891}
{96C26B22-037D-433C-A2B6-088875C5DCEC} = {D4AB33E9-9464-4BE3-BBF2-B93AD34BE891}
{51E5814B-9063-4B3F-8617-478F4D7DCB07} = {D4AB33E9-9464-4BE3-BBF2-B93AD34BE891}
{D2790D2D-B93D-44C5-BC8B-BCA3F3631996} = {D4AB33E9-9464-4BE3-BBF2-B93AD34BE891}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {79594A78-23A6-4103-92DA-71BD4586160D}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.CreateArticle;
using Blogger.Application.Articles.CreateArticle;

namespace Blogger.APIs.Contracts.CreateArticle;
namespace Blogger.APIs.Endpoints.Articles.CreateArticle;

public class CreateArticleEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Blogger.Application.Usecases.CreateArticle;
using Blogger.Application.Articles.CreateArticle;
using Blogger.Domain.ArticleAggregate;
using System.Collections.Immutable;

namespace Blogger.APIs.Contracts.CreateArticle;
namespace Blogger.APIs.Endpoints.Articles.CreateArticle;

public class CreateArticleMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Blogger.APIs.Contracts.CreateArticle;
namespace Blogger.APIs.Endpoints.Articles.CreateArticle;

public record CreateArticleRequest(string Title, string Body, string Summary, string[] Tags);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.CreateArticle;
namespace Blogger.APIs.Endpoints.Articles.CreateArticle;

public class CreateArticleRequestValidator : AbstractValidator<CreateArticleRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Blogger.Domain.ArticleAggregate;
namespace Blogger.APIs.Contracts.CreateArticle;
namespace Blogger.APIs.Endpoints.Articles.CreateArticle;

public record CreateArticleResponse(string ArticleId);
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.GetArchive;
using Blogger.Application.Articles.GetArchive;

namespace Blogger.APIs.Contracts.GetArchive;
namespace Blogger.APIs.Endpoints.Articles.GetArchive;

public class GetArchiveEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Blogger.Application.Usecases.GetArchive;
using Blogger.Application.Articles.GetArchive;

namespace Blogger.APIs.Contracts.GetArchive;
namespace Blogger.APIs.Endpoints.Articles.GetArchive;

public class GetArchiveMappingProfile : IRegister
{
public void Register(TypeAdapterConfig config)
{
{
config.ForType<GetArchiveQueryResponse, GetArchiveResponse>()
.Map(x => x.Articles , src => src.Articles);
.Map(x => x.Articles, src => src.Articles);

config.ForType<ArticleOnArchive,GetArchiveItemResponse>()
config.ForType<ArticleOnArchive, GetArchiveItemResponse>()
.Map(x => x.ArticleId, src => src.ArticleId.ToString())
.Map(x => x.Title, src => src.Title)
.Map(x => x.Day, src => src.Day);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.GetArchive;
namespace Blogger.APIs.Endpoints.Articles.GetArchive;

public record GetArchiveResponse(
int Year,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.GetArticle;
using Blogger.Application.Articles.GetArticle;

namespace Blogger.APIs.Contracts.GetArticle;
namespace Blogger.APIs.Endpoints.Articles.GetArticle;

public class GetArticleEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.Application.Usecases.GetArticle;
using Blogger.Application.Articles.GetArticle;
using Blogger.Domain.ArticleAggregate;

namespace Blogger.APIs.Contracts.GetArticle;
namespace Blogger.APIs.Endpoints.Articles.GetArticle;

public class GetArticleMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Blogger.APIs.Endpoints.Articles.GetArticle;

public record GetArticleRequest([FromRoute(Name = "article-id")] string ArticleId);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.GetArticle;
namespace Blogger.APIs.Endpoints.Articles.GetArticle;

public class GetArticleRequestValidator : AbstractValidator<GetArticleRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.GetArticle;
namespace Blogger.APIs.Endpoints.Articles.GetArticle;

public record GetArticleResponse(string ArticleId,
string Title,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.GetArticles;
using Blogger.Application.Articles.GetArticles;

namespace Blogger.APIs.Contracts.GetArticles;
namespace Blogger.APIs.Endpoints.Articles.GetArticles;

public class GetArticlesEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Blogger.Application.Usecases.GetArticles;
using Blogger.Application.Articles.GetArticles;

namespace Blogger.APIs.Contracts.GetArticles;
namespace Blogger.APIs.Endpoints.Articles.GetArticles;

public class GetArticlesMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Blogger.APIs.Contracts.GetArticles;
namespace Blogger.APIs.Endpoints.Articles.GetArticles;

public record GetArticlesRequest([FromQuery] int Page = 1, [FromQuery] int Size = 10);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.GetArticles;
namespace Blogger.APIs.Endpoints.Articles.GetArticles;

public record GetArticlesResponse(
string ArticleId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.GetPopularArticles;
using Blogger.Application.Articles.GetPopularArticles;

namespace Blogger.APIs.Contracts.GetPopularArticles;
namespace Blogger.APIs.Endpoints.Articles.GetPopularArticles;

public class GetPopularArticlesEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Blogger.Application.Usecases.GetPopularArticles;
using Blogger.Application.Articles.GetPopularArticles;

namespace Blogger.APIs.Contracts.GetPopularArticles;
namespace Blogger.APIs.Endpoints.Articles.GetPopularArticles;

public class GetPopularArticlesMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Blogger.APIs.Contracts.GetPopularArticles;
namespace Blogger.APIs.Endpoints.Articles.GetPopularArticles;

public record GetPopularArticlesResponse(string Title, string ArticleId);
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Blogger.APIs.Endpoints;
using Blogger.APIs.Endpoints.GetPopularTags;
using Blogger.Application.Usecases.GetPopularTags;
using Blogger.Application.Articles.GetPopularTags;

namespace Blogger.APIs.Contracts.GetPopularTags;
namespace Blogger.APIs.Endpoints.Articles.GetPopularTags;

public class GetPopularTagsEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Blogger.APIs.Endpoints.GetPopularTags;
using Blogger.Application.Usecases.GetPopularTags;
using Blogger.Application.Articles.GetPopularTags;

namespace Blogger.APIs.Contracts.GetPopularTags;
namespace Blogger.APIs.Endpoints.Articles.GetPopularTags;

public class GetPopularTagsMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Blogger.APIs.Endpoints.Articles.GetPopularTags;

public record GetPopularTagsResponse(string Name);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.GetTaggedArticles;
using Blogger.Application.Articles.GetTaggedArticles;

namespace Blogger.APIs.Contracts.GetTaggedArticles;
namespace Blogger.APIs.Endpoints.Articles.GetTaggedArticles;

public class GetTaggedArticlesEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.Application.Usecases.GetTaggedArticles;
using Blogger.Application.Articles.GetTaggedArticles;
using Blogger.Domain.ArticleAggregate;

namespace Blogger.APIs.Contracts.GetTaggedArticles;
namespace Blogger.APIs.Endpoints.Articles.GetTaggedArticles;

public class GetTaggedArticlesMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Blogger.APIs.Contracts.GetTaggedArticles;
namespace Blogger.APIs.Endpoints.Articles.GetTaggedArticles;

public record GetTaggedArticlesRequest([FromQuery] string Tag);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.GetTaggedArticles;
namespace Blogger.APIs.Endpoints.Articles.GetTaggedArticles;

public record GetTaggedArticlesResponse(
string ArticleId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Blogger.APIs.Endpoints;
using Blogger.APIs.Endpoints.GetTags;
using Blogger.Application.Usecases.GetTags;
using Blogger.Application.Articles.GetTags;

namespace Blogger.APIs.Contracts.GetTags;
namespace Blogger.APIs.Endpoints.Articles.GetTags;

public class GetTagsEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Blogger.APIs.Endpoints.GetTags;
using Blogger.Application.Usecases.GetTags;
using Blogger.Application.Articles.GetTags;

namespace Blogger.APIs.Contracts.GetTags;
namespace Blogger.APIs.Endpoints.Articles.GetTags;

public class GetTagsMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Blogger.APIs.Endpoints.GetTags;
namespace Blogger.APIs.Endpoints.Articles.GetTags;

public record GetTagsResponse(string Name, int Count);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.MakeDraft;
using Blogger.Application.Articles.MakeDraft;

namespace Blogger.APIs.Contracts.MakeDraft;
namespace Blogger.APIs.Endpoints.Articles.MakeDraft;

public class MakeCommentEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Blogger.Application.Usecases.MakeDraft;
using Blogger.Application.Articles.MakeDraft;
using Blogger.Domain.ArticleAggregate;

namespace Blogger.APIs.Contracts.MakeDraft;
namespace Blogger.APIs.Endpoints.Articles.MakeDraft;

public class MakeDraftMappingProfile : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<MakeDraftRequest, MakeDraftCommand>()

.Map(x => x.Tags, src => src.Tags.Select(x => Tag.Create(x))
.ToImmutableList());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Blogger.APIs.Contracts.MakeDraft;
namespace Blogger.APIs.Endpoints.Articles.MakeDraft;

public record MakeDraftRequest(string Title, string Body, string Summary, string[] Tags);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.MakeDraft;
namespace Blogger.APIs.Endpoints.Articles.MakeDraft;

public class MakeDraftRequestValidator : AbstractValidator<MakeDraftRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Blogger.APIs.Endpoints.Articles.MakeDraft;

public record MakeDraftResponse(string DraftId);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.PublishDraft;
using Blogger.Application.Articles.PublishDraft;

namespace Blogger.APIs.Contracts.PublishDraft;
namespace Blogger.APIs.Endpoints.Articles.PublishDraft;

public class PublishDraftEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.Application.Usecases.PublishDraft;
using Blogger.Application.Articles.PublishDraft;
using Blogger.Domain.ArticleAggregate;

namespace Blogger.APIs.Contracts.PublishDraft;
namespace Blogger.APIs.Endpoints.Articles.PublishDraft;

public class PublishDraftMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Blogger.APIs.Endpoints.Articles.PublishDraft;

public record PublishDraftRequest([FromRoute(Name = "draft-id")] string DraftId);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.PublishDraft;
namespace Blogger.APIs.Endpoints.Articles.PublishDraft;

public class PublishDraftRequestValidator : AbstractValidator<PublishDraftRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.UpdateDraft;
using Blogger.Application.Articles.UpdateDraft;

namespace Blogger.APIs.Contracts.UpdateDraft;
namespace Blogger.APIs.Endpoints.Articles.UpdateDraft;

public class UpdateDraftEndpoint : IEndpoint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.Application.Usecases.UpdateDraft;
using Blogger.Application.Articles.UpdateDraft;
using Blogger.Domain.ArticleAggregate;

namespace Blogger.APIs.Contracts.UpdateDraft;
namespace Blogger.APIs.Endpoints.Articles.UpdateDraft;

public class UpdateDraftMappingProfile : IRegister
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Blogger.APIs.Endpoints.Articles.UpdateDraft;

public record UpdateDraftRequest(string DraftId, string Title, string Body, string Summary, string[] Tags);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Blogger.APIs.Contracts.UpdateDraft;
namespace Blogger.APIs.Endpoints.Articles.UpdateDraft;

public class UpdateDraftRequestValidator : AbstractValidator<UpdateDraftRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Blogger.APIs.Endpoints;
using Blogger.Application.Usecases.ApproveComment;
using Blogger.Application.Comments.ApproveComment;

namespace Blogger.APIs.Contracts.ApproveComment;
namespace Blogger.APIs.Endpoints.Comments.ApproveComment;

public class ApproveCommentEndpoint : IEndpoint
{
Expand Down
Loading

0 comments on commit c8bd610

Please sign in to comment.