-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
88 changed files
with
3,683 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '3.8' | ||
services: | ||
pokedata_mssql: | ||
image: mcr.microsoft.com/mssql/server:2022-latest | ||
container_name: PokeData_mssql | ||
ports: | ||
- 27945:1433 | ||
environment: | ||
ACCEPT_EULA: 'Y' | ||
MSSQL_SA_PASSWORD: m7tPnE6dB5TQxYCW | ||
|
||
pokedata_api: | ||
build: | ||
context: . | ||
dockerfile: /src/PokeData/Dockerfile | ||
image: pokedata_api | ||
container_name: PokeData_api | ||
depends_on: | ||
- pokedata_mssql | ||
restart: unless-stopped | ||
environment: | ||
ASPNETCORE_Environment: Development | ||
SQLCONNSTR_Master: Server=pokedata_mssql,27945;Database=Pokemon;User Id=SA;Password=m7tPnE6dB5TQxYCW;Persist Security Info=False;Encrypt=False; | ||
ports: | ||
- 43551:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using PokeData.Domain.Resources; | ||
|
||
namespace PokeData.Application.Caching; | ||
|
||
public interface ICacheService | ||
{ | ||
Resource? GetResource(Uri source); | ||
void SetResource(Resource resource); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace PokeData.Application; | ||
|
||
public static class DependencyInjectionExtensions | ||
{ | ||
public static IServiceCollection AddPokeDataApplication(this IServiceCollection services) | ||
{ | ||
return services.AddMediatR(config => config.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using PokeData.Domain.Species; | ||
|
||
namespace PokeData.Application; | ||
|
||
public interface IResourceService | ||
{ | ||
Task<PokemonSpecies?> GetSpeciesAsync(string id, CancellationToken cancellationToken = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<WarningsAsErrors>Nullable</WarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="MediatR" Version="12.2.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\PokeData.Domain\PokeData.Domain.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="System.Reflection" /> | ||
</ItemGroup> | ||
|
||
</Project> |
5 changes: 5 additions & 0 deletions
5
src/PokeData.Application/Species/Commands/ImportSpeciesCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using MediatR; | ||
|
||
namespace PokeData.Application.Species.Commands; | ||
|
||
public record ImportSpeciesCommand(IEnumerable<string> Ids) : INotification; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using PokeData.Domain.Regions; | ||
|
||
namespace PokeData.Domain.Generations; | ||
|
||
public class Generation | ||
{ | ||
public byte Number { get; set; } | ||
|
||
public string UniqueName { get; set; } = string.Empty; | ||
public string? DisplayName { get; set; } | ||
|
||
public Region? MainRegion { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<WarningsAsErrors>Nullable</WarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Logitar.EventSourcing" Version="5.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace PokeData.Domain; | ||
|
||
public class PokemonType | ||
{ | ||
public byte Number { get; set; } | ||
|
||
public string UniqueName { get; set; } = string.Empty; | ||
public string? DisplayName { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using PokeData.Domain.Generations; | ||
|
||
namespace PokeData.Domain.Regions; | ||
|
||
public class Region | ||
{ | ||
public byte Number { get; set; } | ||
|
||
public string UniqueName { get; set; } = string.Empty; | ||
public string? DisplayName { get; set; } | ||
|
||
public Generation? MainGeneration { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace PokeData.Domain.Resources; | ||
|
||
public record Content(string Type, string Text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace PokeData.Domain.Resources; | ||
|
||
public interface IResourceRepository | ||
{ | ||
Task<IEnumerable<Resource>> GetAsync(CancellationToken cancellationToken = default); | ||
Task<Resource?> GetAsync(Uri source, CancellationToken cancellationToken = default); | ||
Task SaveAsync(Resource resource, CancellationToken cancellationToken = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace PokeData.Domain.Resources; | ||
|
||
public record Resource(Uri Source, Content Content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using PokeData.Domain.Generations; | ||
|
||
namespace PokeData.Domain.Species; | ||
|
||
public class PokemonSpecies | ||
{ | ||
public ushort Number { get; set; } | ||
public ushort Order { get; set; } | ||
|
||
public bool IsBaby { get; set; } | ||
public bool IsLegendary { get; set; } | ||
public bool IsMythical { get; set; } | ||
public bool HasGenderDifferences { get; set; } | ||
public bool CanSwitchForm { get; set; } | ||
|
||
public string UniqueName { get; set; } = string.Empty; | ||
public string? DisplayName { get; set; } | ||
public string? Category { get; set; } | ||
|
||
public double? GenderRatio { get; set; } | ||
public byte CatchRate { get; set; } | ||
public byte HatchTime { get; set; } | ||
|
||
public byte BaseFriendship { get; set; } | ||
|
||
public Generation? Generation { get; set; } | ||
|
||
public List<PokemonVariety> Varieties { get; set; } = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace PokeData.Domain.Species; | ||
|
||
public class PokemonVariety | ||
{ | ||
public ushort Number { get; set; } | ||
public ushort Order { get; set; } | ||
|
||
public string UniqueName { get; set; } = string.Empty; | ||
|
||
public PokemonType? PrimaryType { get; set; } | ||
public PokemonType? SecondaryType { get; set; } | ||
|
||
public double Height { get; set; } | ||
public double Weight { get; set; } | ||
|
||
public ushort BaseExperienceYield { get; set; } | ||
|
||
public PokemonSpecies? Species { get; set; } | ||
public bool IsDefault { get; set; } | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.