Skip to content

Commit

Permalink
調整專案名稱 (還是 use case & domain entity 比較對味)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuChia-Wei committed May 6, 2024
1 parent 2641148 commit 571aba5
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 44 deletions.
4 changes: 2 additions & 2 deletions src/dotnet-lab.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetLab.Application", "dotnetLab.Application\dotnetLab.Application.csproj", "{C42E2B3B-C375-4403-84D3-31BB608C2817}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetLab.UseCase", "dotnetLab.UseCase\dotnetLab.UseCase.csproj", "{C42E2B3B-C375-4403-84D3-31BB608C2817}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetLab.Repository", "dotnetLab.Repository\dotnetLab.Repository.csproj", "{765D773B-47E8-48A8-BF57-CF68DD2D08CF}"
EndProject
Expand All @@ -33,7 +33,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1. Core-Layer-Components",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetLab.GrpcService", "dotnetLab.GrpcService\dotnetLab.GrpcService.csproj", "{0C9E324A-B98C-4BDA-A3A9-479DBFDEB0A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetLab.Domain", "dotnetLab.Domain\dotnetLab.Domain.csproj", "{3A875652-B30E-4313-BB95-7590691199A0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetLab.DomainEntity", "dotnetLab.DomainEntity\dotnetLab.DomainEntity.csproj", "{3A875652-B30E-4313-BB95-7590691199A0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dotnetLab.Domain;
namespace dotnetLab.DomainEntity;

public class SimpleDocumentEntity
{
Expand Down
2 changes: 1 addition & 1 deletion src/dotnetLab.GrpcService/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using dotnetLab.Application;
using dotnetLab.UseCase;
using dotnetLab.GrpcService.Services;
using dotnetLab.Repository;

Expand Down
2 changes: 1 addition & 1 deletion src/dotnetLab.GrpcService/Services/GreeterService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using dotnet.GrpcService;
using dotnetLab.Application.SimpleDocument.Queries;
using dotnetLab.UseCase.SimpleDocument.Queries;
using Grpc.Core;
using Mediator;

Expand Down
2 changes: 1 addition & 1 deletion src/dotnetLab.GrpcService/dotnetLab.GrpcService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\dotnetLab.Application\dotnetLab.Application.csproj" />
<ProjectReference Include="..\dotnetLab.UseCase\dotnetLab.UseCase.csproj" />
<ProjectReference Include="..\dotnetLab.Repository\dotnetLab.Repository.csproj" />
</ItemGroup>

Expand Down
10 changes: 3 additions & 7 deletions src/dotnetLab.Repository/Implements/GrpcSampleDataRepository.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using dotnetLab.Application.SimpleDocument.Ports.Out;
using dotnetLab.Domain;
using dotnetLab.DomainEntity;
using dotnetLab.UseCase.SimpleDocument.Ports.Out;
using Grpc.Net.Client;
using GrpcGreeterClient;

Expand All @@ -12,11 +12,7 @@ public class GrpcSampleDataRepository : ISimpleDocumentRepository
using var channel = GrpcChannel.ForAddress("https://localhost:7130");
var client = new Greeter.GreeterClient(channel);
var result = await client.SayHelloAsync(new SampleQuery { SerialId = serialId });
var sampleTable = new SimpleDocumentEntity
{
SerialId = serialId,
Description = result.Description
};
var sampleTable = new SimpleDocumentEntity { SerialId = serialId, Description = result.Description };
return sampleTable;
}

Expand Down
11 changes: 3 additions & 8 deletions src/dotnetLab.Repository/Implements/MockDataRepository.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using dotnetLab.Application.SimpleDocument.Ports.Out;
using dotnetLab.Domain;
using dotnetLab.DomainEntity;
using dotnetLab.Observability.Tracing;
using dotnetLab.UseCase.SimpleDocument.Ports.Out;

namespace dotnetLab.Repository.Implements;

Expand All @@ -14,12 +14,7 @@ public class MockDataRepository : ISimpleDocumentRepository
/// <returns></returns>
public Task<SimpleDocumentEntity?> GetAsync(int serialId)
{
return Task.FromResult(new SimpleDocumentEntity
{
SerialId = serialId,
Description = "for no db test",
DocumentNum = $"no{serialId}"
});
return Task.FromResult(new SimpleDocumentEntity { SerialId = serialId, Description = "for no db test", DocumentNum = $"no{serialId}" });
}

public Task<int> SaveAsync(SimpleDocumentEntity simpleDocument)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Data;
using Dapper;
using dotnetLab.Application.SimpleDocument.Ports.Out;
using dotnetLab.Database.SampleDb;
using dotnetLab.Database.SampleDb.Entities;
using dotnetLab.Domain;
using dotnetLab.DomainEntity;
using dotnetLab.Repository.Enums;
using dotnetLab.UseCase.SimpleDocument.Ports.Out;

namespace dotnetLab.Repository.Implements;

Expand Down
4 changes: 2 additions & 2 deletions src/dotnetLab.Repository/ServiceCollectionExtension.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using dotnetLab.Application.SimpleDocument.Ports.Out;
using dotnetLab.Database.SampleDb;
using dotnetLab.Database.SampleDb;
using dotnetLab.Repository.Factories;
using dotnetLab.Repository.Implements;
using dotnetLab.UseCase.SimpleDocument.Ports.Out;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down
3 changes: 2 additions & 1 deletion src/dotnetLab.Repository/dotnetLab.Repository.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\dotnetLab.Application\dotnetLab.Application.csproj" />
<ProjectReference Include="..\dotnetLab.UseCase\dotnetLab.UseCase.csproj" />
<ProjectReference Include="..\dotnetLab.Observability\dotnetLab.Observability.csproj" />
<ProjectReference Include="..\dotnetLab.Database.SampleDb\dotnetLab.Database.SampleDb.csproj" />
<ProjectReference Include="..\dotnetLab.UseCase\dotnetLab.UseCase.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.Extensions.DependencyInjection;

namespace dotnetLab.Application;
namespace dotnetLab.UseCase;

public static class ServiceCollectionExtension
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dotnetLab.Application.SimpleDocument.Commands;
namespace dotnetLab.UseCase.SimpleDocument.Commands;

/// <summary>
/// sample command
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using dotnetLab.Application.SimpleDocument.Ports.Out;
using dotnetLab.Domain;
using dotnetLab.DomainEntity;
using dotnetLab.UseCase.SimpleDocument.Ports.Out;

namespace dotnetLab.Application.SimpleDocument.Commands;
namespace dotnetLab.UseCase.SimpleDocument.Commands;

/// <summary>
/// command handler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dotnetLab.Application.SimpleDocument.Dtos;
namespace dotnetLab.UseCase.SimpleDocument.Dtos;

/// <summary>
/// 簡易文件資料
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using dotnetLab.Domain;
using dotnetLab.DomainEntity;

namespace dotnetLab.Application.SimpleDocument.Ports.Out;
namespace dotnetLab.UseCase.SimpleDocument.Ports.Out;

/// <summary>
/// 範例資料 Repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using dotnetLab.Application.SimpleDocument.Dtos;
using dotnetLab.Application.SimpleDocument.Ports.Out;
using dotnetLab.UseCase.SimpleDocument.Dtos;
using dotnetLab.UseCase.SimpleDocument.Ports.Out;

namespace dotnetLab.Application.SimpleDocument.Queries;
namespace dotnetLab.UseCase.SimpleDocument.Queries;

public class SimpleDataQueryHandler : IRequestHandler<SimpleDocQuery, SimpleDocumentDto>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using dotnetLab.Application.SimpleDocument.Dtos;
using dotnetLab.UseCase.SimpleDocument.Dtos;

namespace dotnetLab.Application.SimpleDocument.Queries;
namespace dotnetLab.UseCase.SimpleDocument.Queries;

public class SimpleDocQuery : IRequest<SimpleDocumentDto>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\dotnetLab.Common\dotnetLab.Common.csproj" />
<ProjectReference Include="..\dotnetLab.Observability\dotnetLab.Observability.csproj" />
<ProjectReference Include="..\dotnetLab.Domain\dotnetLab.Domain.csproj" />
<ProjectReference Include="..\dotnetLab.DomainEntity\dotnetLab.DomainEntity.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/dotnetLab.WebApi/Controllers/SampleController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using dotnetLab.Application.SimpleDocument.Commands;
using dotnetLab.Application.SimpleDocument.Queries;
using dotnetLab.UseCase.SimpleDocument.Commands;
using dotnetLab.UseCase.SimpleDocument.Queries;
using Mediator;
using Microsoft.AspNetCore.Mvc;

Expand Down
2 changes: 1 addition & 1 deletion src/dotnetLab.WebApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Asp.Versioning;
using Asp.Versioning.ApiExplorer;
using Asp.Versioning.Conventions;
using dotnetLab.Application;
using dotnetLab.UseCase;
using dotnetLab.Common.OptionModels;
using dotnetLab.Repository;
using dotnetLab.WebApi.Controllers.ViewModels;
Expand Down
2 changes: 1 addition & 1 deletion src/dotnetLab.WebApi/dotnetLab.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
<ProjectReference Include="..\dotnetLab.Common\dotnetLab.Common.csproj" />
<ProjectReference Include="..\dotnetLab.Database.SampleDb\dotnetLab.Database.SampleDb.csproj" />
<ProjectReference Include="..\dotnetLab.Repository\dotnetLab.Repository.csproj" />
<ProjectReference Include="..\dotnetLab.Application\dotnetLab.Application.csproj" />
<ProjectReference Include="..\dotnetLab.UseCase\dotnetLab.UseCase.csproj" />
</ItemGroup>
</Project>

0 comments on commit 571aba5

Please sign in to comment.