From e51b52eb757c5a45260b60f4c40d6f6b91a0755d Mon Sep 17 00:00:00 2001 From: David Manuguerra Date: Sat, 4 Apr 2026 22:28:18 +0200 Subject: [PATCH] init --- .dockerignore | 30 ++ .gitignore | 430 ++++++++++++++++++ ApiCarburant.slnx | 3 + ApiCarburant/ApiCarburant.csproj | 19 + ApiCarburant/ApiCarburant.http | 9 + .../Controllers/CarburantController.cs | 57 +++ ApiCarburant/Dockerfile | 29 ++ ApiCarburant/Pompe.Detail.cs | 17 + ApiCarburant/Pompe.cs | 17 + ApiCarburant/Program.cs | 29 ++ ApiCarburant/Properties/launchSettings.json | 22 + ApiCarburant/Readme.txt | 16 + ApiCarburant/Services/PompeService.cs | 134 ++++++ ApiCarburant/appsettings.Development.json | 8 + ApiCarburant/appsettings.json | 9 + ApiCarburant/dotnet-tools.json | 13 + ApiCarburant/wwwroot/index.html | 45 ++ 17 files changed, 887 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 ApiCarburant.slnx create mode 100644 ApiCarburant/ApiCarburant.csproj create mode 100644 ApiCarburant/ApiCarburant.http create mode 100644 ApiCarburant/Controllers/CarburantController.cs create mode 100644 ApiCarburant/Dockerfile create mode 100644 ApiCarburant/Pompe.Detail.cs create mode 100644 ApiCarburant/Pompe.cs create mode 100644 ApiCarburant/Program.cs create mode 100644 ApiCarburant/Properties/launchSettings.json create mode 100644 ApiCarburant/Readme.txt create mode 100644 ApiCarburant/Services/PompeService.cs create mode 100644 ApiCarburant/appsettings.Development.json create mode 100644 ApiCarburant/appsettings.json create mode 100644 ApiCarburant/dotnet-tools.json create mode 100644 ApiCarburant/wwwroot/index.html diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c67139 --- /dev/null +++ b/.gitignore @@ -0,0 +1,430 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates +*.env + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ + +[Dd]ebug/x64/ +[Dd]ebugPublic/x64/ +[Rr]elease/x64/ +[Rr]eleases/x64/ +bin/x64/ +obj/x64/ + +[Dd]ebug/x86/ +[Dd]ebugPublic/x86/ +[Rr]elease/x86/ +[Rr]eleases/x86/ +bin/x86/ +obj/x86/ + +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +[Aa][Rr][Mm]64[Ee][Cc]/ +bld/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Build results on 'Bin' directories +**/[Bb]in/* +# Uncomment if you have tasks that rely on *.refresh files to move binaries +# (https://github.com/github/gitignore/pull/3736) +#!**/[Bb]in/*.refresh + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* +*.trx + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Approval Tests result files +*.received.* + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.idb +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +# but not Directory.Build.rsp, as it configures directory-level build defaults +!Directory.Build.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +**/.paket/paket.exe +paket-files/ + +# FAKE - F# Make +**/.fake/ + +# CodeRush personal settings +**/.cr/personal + +# Python Tools for Visual Studio (PTVS) +**/__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +#tools/** +#!tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog +MSBuild_Logs/ + +# AWS SAM Build and Temporary Artifacts folder +.aws-sam + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +**/.mfractor/ + +# Local History for Visual Studio +**/.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +**/.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp +.vs +**/bin diff --git a/ApiCarburant.slnx b/ApiCarburant.slnx new file mode 100644 index 0000000..3a4c588 --- /dev/null +++ b/ApiCarburant.slnx @@ -0,0 +1,3 @@ + + + diff --git a/ApiCarburant/ApiCarburant.csproj b/ApiCarburant/ApiCarburant.csproj new file mode 100644 index 0000000..b6b3ae5 --- /dev/null +++ b/ApiCarburant/ApiCarburant.csproj @@ -0,0 +1,19 @@ + + + + net10.0 + enable + enable + Linux + + + + + + + + + + + + diff --git a/ApiCarburant/ApiCarburant.http b/ApiCarburant/ApiCarburant.http new file mode 100644 index 0000000..f5ad261 --- /dev/null +++ b/ApiCarburant/ApiCarburant.http @@ -0,0 +1,9 @@ +@ApiCarburant_HostAddress = http://localhost:5244 + +GET {{ApiCarburant_HostAddress}}/Carburant/ +Accept: application/json + +### +GET {{ApiCarburant_HostAddress}}/Carburant/Refresh +Accept: application/json + diff --git a/ApiCarburant/Controllers/CarburantController.cs b/ApiCarburant/Controllers/CarburantController.cs new file mode 100644 index 0000000..fd4ec81 --- /dev/null +++ b/ApiCarburant/Controllers/CarburantController.cs @@ -0,0 +1,57 @@ +using ApiCarburant.Services; + +using Microsoft.AspNetCore.Mvc; + +using System.Threading.Tasks; + +namespace ApiCarburant.Controllers; + +[ApiController] +[Route("[controller]")] +public class CarburantController : ControllerBase +{ + + /// + /// Retrieves a collection of fuel stations located near the specified geographic coordinates. + /// + /// The longitude of the location to search for nearby stations. Must be a valid longitude value between -180 and + /// 180. + /// The latitude of the location to search for nearby stations. Must be a valid latitude value between -90 and 90. + /// An enumerable collection of stations near the specified coordinates. The collection is empty if no stations are + /// found. + /// Thrown if an error occurs while retrieving the station data. + /// + /// ?lon=4.816992463720462&lat=43.9291477523281 + /// + [HttpGet(Name = "GetCarburant")] + public async Task> Get([FromServices] PompeService pompeService, + [FromQuery] double? lon, [FromQuery] double? lat, [FromQuery] long dist) + + { + dist = dist == 0 ? 10000 : dist; + double lon1 = lon ?? 4.816992463720462; + double lat1 = lat ?? 43.9291477523281; + if (pompeService.Station == null) + { await pompeService.RefreshAsync(); } + return pompeService.Station.Select(s => new { distance = 110574 * Math.Sqrt((s.Latitude - lat1) * (s.Latitude - lat1) + (s.Longitude - lon1) * (s.Longitude - lon1)), station = s }) + .Where(x => x.distance < dist) + .OrderBy(x => x.distance) + .Select(x => x.station) + .ToList(); + // .OrderBy(x => x.Prix.OrderBy(p => p.Valeur).Select(p => p.Valeur).FirstOrDefault()??15).ToList(); + //throw new Exception("Test exception"); + //return Enumerable.Range(1, 5).Select(index => new WeatherForecast + //{ + // Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + // TemperatureC = Random.Shared.Next(-20, 55), + // Summary = Summaries[Random.Shared.Next(Summaries.Length)] + //}) + //.ToArray(); + } + [HttpGet("refresh", Name = "GetRefreshCarburant")] + public async Task Refresh([FromServices] PompeService pompeService) + { + await pompeService.RefreshAsync(); + return NoContent(); + } +} \ No newline at end of file diff --git a/ApiCarburant/Dockerfile b/ApiCarburant/Dockerfile new file mode 100644 index 0000000..c0ca2bd --- /dev/null +++ b/ApiCarburant/Dockerfile @@ -0,0 +1,29 @@ +# Consultez https://aka.ms/customizecontainer pour savoir comment personnaliser votre conteneur de débogage et comment Visual Studio utilise ce Dockerfile pour générer vos images afin d’accélérer le débogage. + +# Cet index est utilisé lors de l’exécution à partir de VS en mode rapide (par défaut pour la configuration de débogage) +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 + + +# Cette phase est utilisée pour générer le projet de service +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["ApiCarburant/ApiCarburant.csproj", "ApiCarburant/"] +RUN dotnet restore "./ApiCarburant/ApiCarburant.csproj" +COPY . . +WORKDIR "/src/ApiCarburant" +RUN dotnet build "./ApiCarburant.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# Cette étape permet de publier le projet de service à copier dans la phase finale +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./ApiCarburant.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# Cette phase est utilisée en production ou lors de l’exécution à partir de VS en mode normal (par défaut quand la configuration de débogage n’est pas utilisée) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "ApiCarburant.dll"] \ No newline at end of file diff --git a/ApiCarburant/Pompe.Detail.cs b/ApiCarburant/Pompe.Detail.cs new file mode 100644 index 0000000..ba205bc --- /dev/null +++ b/ApiCarburant/Pompe.Detail.cs @@ -0,0 +1,17 @@ +namespace ApiCarburant +{ + public class Prix + { + public string Id { get; set; } + public string? nom { get; set; } + public decimal Valeur { get; set; } + public DateTime Maj { get; set; } + } + + public enum TypeCarburant + { + E85, + SP95, + + } +} diff --git a/ApiCarburant/Pompe.cs b/ApiCarburant/Pompe.cs new file mode 100644 index 0000000..8c5a798 --- /dev/null +++ b/ApiCarburant/Pompe.cs @@ -0,0 +1,17 @@ +namespace ApiCarburant; + +public class Station +{ + public string Id { get; set; } + public double Latitude { get; set; } + public double Longitude { get; set; } + + public string cp { get; set; } + + + public string Ville { get; set; } + public string Adresse { get; set; } + + + public List Prix { get; set; } = new(); +} \ No newline at end of file diff --git a/ApiCarburant/Program.cs b/ApiCarburant/Program.cs new file mode 100644 index 0000000..50a5e95 --- /dev/null +++ b/ApiCarburant/Program.cs @@ -0,0 +1,29 @@ +using ApiCarburant.Services; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddControllers(); + +// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi +builder.Services.AddOpenApi(); +builder.Services.AddSingleton(); + +var app = builder.Build(); +// Example Minimal API endpoint replacing a controller action +//app.MapGet("/api/hello", () => new { Message = "Hello from Minimal API!" }); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.MapOpenApi(); +} + +app.UseAuthorization(); + +app.UseDefaultFiles(); +app.UseStaticFiles(); + +app.MapControllers(); + +app.Run(); diff --git a/ApiCarburant/Properties/launchSettings.json b/ApiCarburant/Properties/launchSettings.json new file mode 100644 index 0000000..dc1ec1c --- /dev/null +++ b/ApiCarburant/Properties/launchSettings.json @@ -0,0 +1,22 @@ +{ + "profiles": { + "http": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5244" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": false + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file diff --git a/ApiCarburant/Readme.txt b/ApiCarburant/Readme.txt new file mode 100644 index 0000000..0febd67 --- /dev/null +++ b/ApiCarburant/Readme.txt @@ -0,0 +1,16 @@ +# 1. Builder l'image en la taguant avec ton registry +docker build -t registry.leonhome2.ddns.net/mon-app:latest . + +# 2. Se connecter au registry (à faire une seule fois) +docker login registry.leonhome2.ddns.net + +# 3. Pusher l'image +docker push registry.leonhome2.ddns.net/mon-app:latest + + +docker build \ + -t registry.leonhome2.ddns.net/mon-app:1.0.0 \ + -t registry.leonhome2.ddns.net/mon-app:latest \ + . + +docker push registry.leonhome2.ddns.net/mon-app --all-tags \ No newline at end of file diff --git a/ApiCarburant/Services/PompeService.cs b/ApiCarburant/Services/PompeService.cs new file mode 100644 index 0000000..933a44b --- /dev/null +++ b/ApiCarburant/Services/PompeService.cs @@ -0,0 +1,134 @@ +using System.IO.Compression; +using System.Net.Security; +using System.Text.Json; +using System.Xml; + +using static System.Collections.Specialized.BitVector32; + +namespace ApiCarburant.Services +{ + public class PompeService + { + public async Task RefreshAsync() + { + //https://www.prix-carburants.gouv.fr/rubrique/opendata/ + //get https://donnees.roulez-eco.fr/opendata/instantane + HttpClient client = new HttpClient(); + client.BaseAddress = new Uri("https://donnees.roulez-eco.fr/opendata/"); + await using var stream = await client.GetStreamAsync("instantane"); + await using var zip = new ZipArchive(stream, ZipArchiveMode.Read); + var entry = zip.Entries.First(); + await using var xmlStream = await entry.OpenAsync(); + using var reader = XmlReader.Create(xmlStream, new XmlReaderSettings + { + IgnoreWhitespace = true, + Async = true + }); + + var stations = new List(); + + Station currentStation = null; + /* + + 16 BD DES MARTYRS NANTAIS + NANTES + + Toilettes publiques + Boutique alimentaire + Boutique non alimentaire + Station de gonflage + Piste poids lourds + Lavage manuel + Vente de gaz domestique (Butane, Propane) + + + + + + + 16 rue chateaubriand + Br�han*/ + + while (await reader.ReadAsync()) + { + + if (reader.Name == "pdv") + { + if (reader.NodeType == XmlNodeType.Element) + { + currentStation = new Station + { + Id = reader.GetAttribute("id"), + Latitude = double.Parse(reader.GetAttribute("latitude")) / 100000, + Longitude = double.Parse(reader.GetAttribute("longitude")) / 100000, + + + }; + } + else if (reader.NodeType == XmlNodeType.EndElement) + { + stations.Add(currentStation); + currentStation = null; + } + } + else if (reader.Name == "adresse" && currentStation != null) + { + await reader.ReadAsync(); + currentStation.Adresse=reader.Value; + await reader.ReadAsync(); + } + else if (reader.Name == "ville" && currentStation != null) + { + await reader.ReadAsync(); + currentStation.Ville = reader.Value; + await reader.ReadAsync(); + } + else if (reader.Name == "prix" && currentStation != null) + { + Prix? prix = null; + if (reader.NodeType == XmlNodeType.Element) + { + prix = new Prix + { + nom = reader.GetAttribute("nom"), + Valeur = decimal.Parse(reader.GetAttribute("valeur")), + Maj = DateTime.Parse(reader.GetAttribute("maj")) + }; + currentStation.Prix.Add(prix); + } + else + { + + } + } + + + } + + this.Station = stations; + // 5. JSON direct + //var json = JsonSerializer.Serialize(stations, new JsonSerializerOptions + //{ + // WriteIndented = true + //}); + + //Console.WriteLine(json); + + //Load and return a pump + //return new Pompe + //{ + // Date = DateTimeOffset.Now, + // Ville = "Paris", + // Adresse = "10 rue de la paix", + // Latitude = 48.8566, + // Longitude = 2.3522, + // PrixCarburant = new[] + // { + // new PrixCarburant(){Prix=2,TypeCarburant=TypeCarburant.SP95} + // } + //}; + } + + public List Station { get; set; } + } +} diff --git a/ApiCarburant/appsettings.Development.json b/ApiCarburant/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/ApiCarburant/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/ApiCarburant/appsettings.json b/ApiCarburant/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/ApiCarburant/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/ApiCarburant/dotnet-tools.json b/ApiCarburant/dotnet-tools.json new file mode 100644 index 0000000..b6f4c2f --- /dev/null +++ b/ApiCarburant/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "10.0.5", + "commands": [ + "dotnet-ef" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/ApiCarburant/wwwroot/index.html b/ApiCarburant/wwwroot/index.html new file mode 100644 index 0000000..6c0b8aa --- /dev/null +++ b/ApiCarburant/wwwroot/index.html @@ -0,0 +1,45 @@ + + + + + Stations carburant + + + +

Stations autour de moi

+

Coucou

+ +

+
+
+
+
\ No newline at end of file