Compare commits
3 Commits
63fc18ea74
...
5a682bb6d7
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a682bb6d7 | |||
| bb5a89a06d | |||
| 3036eec3af |
@@ -0,0 +1,17 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["TravelMate.Backend.csproj", "./"]
|
||||
RUN dotnet restore "TravelMate.Backend.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/."
|
||||
RUN dotnet build "TravelMate.Backend.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "TravelMate.Backend.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
EXPOSE 8080
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
ENTRYPOINT ["dotnet", "TravelMate.Backend.dll"]
|
||||
@@ -0,0 +1,186 @@
|
||||
using DotNetEnv;
|
||||
using Google.Apis.AnalyticsData.v1beta;
|
||||
using Google.Apis.AnalyticsData.v1beta.Data;
|
||||
using Google.Apis.Auth.OAuth2;
|
||||
using Google.Apis.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
Env.Load();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
// Register Google Analytics Data Client
|
||||
builder.Services.AddSingleton<AnalyticsDataService>(sp =>
|
||||
{
|
||||
GoogleCredential credential;
|
||||
try
|
||||
{
|
||||
// Tries to find credentials from GOOGLE_APPLICATION_CREDENTIALS environment variable
|
||||
// or default cloud environment credentials.
|
||||
credential = GoogleCredential.GetApplicationDefault();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Fallback for local development if env var not set (User might need to run 'gcloud auth application-default login')
|
||||
// Or we warn them. For now, we assume it's set up or will fail at runtime.
|
||||
throw new InvalidOperationException("Could not load Google Credentials. Set GOOGLE_APPLICATION_CREDENTIALS or run 'gcloud auth application-default login'.");
|
||||
}
|
||||
|
||||
if (credential.IsCreateScopedRequired)
|
||||
{
|
||||
credential = credential.CreateScoped(AnalyticsDataService.Scope.AnalyticsReadonly);
|
||||
}
|
||||
|
||||
var service = new AnalyticsDataService(new BaseClientService.Initializer
|
||||
{
|
||||
HttpClientInitializer = credential,
|
||||
ApplicationName = "TravelMate Backend",
|
||||
});
|
||||
|
||||
return service;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
string? ga4PropertyId = Environment.GetEnvironmentVariable("GA4_PROPERTY_ID");
|
||||
if (string.IsNullOrEmpty(ga4PropertyId))
|
||||
{
|
||||
Console.WriteLine("Warning: GA4_PROPERTY_ID not set in .env");
|
||||
// Default or error? Let's just hold it and fail in the endpoint if needed, or fail startup.
|
||||
// For now, let's allow it to start but endpoint will likely fail.
|
||||
}
|
||||
|
||||
app.MapGet("/api/metrics/daily", async (
|
||||
[FromServices] AnalyticsDataService service,
|
||||
[FromQuery] string from,
|
||||
[FromQuery] string to) =>
|
||||
{
|
||||
// Basic validation
|
||||
// Basic validation: Check if it's a valid date OR a valid GA4 keyword
|
||||
bool IsValidDate(string date)
|
||||
{
|
||||
return DateTime.TryParse(date, out _) ||
|
||||
date == "today" ||
|
||||
date == "yesterday" ||
|
||||
date.EndsWith("daysAgo");
|
||||
}
|
||||
|
||||
if (!IsValidDate(from) || !IsValidDate(to))
|
||||
{
|
||||
return Results.BadRequest(new { error = "Invalid date format. Use YYYY-MM-DD, 'today', 'yesterday', or 'NdaysAgo'." });
|
||||
}
|
||||
|
||||
var request = new RunReportRequest
|
||||
{
|
||||
Property = $"properties/{ga4PropertyId}",
|
||||
DateRanges = new List<DateRange>
|
||||
{
|
||||
new DateRange { StartDate = from, EndDate = to }
|
||||
},
|
||||
Dimensions = new List<Dimension>
|
||||
{
|
||||
new Dimension { Name = "date" }
|
||||
},
|
||||
Metrics = new List<Metric>
|
||||
{
|
||||
new Metric { Name = "activeUsers" } // equivalent to Daily Active Users in this context often
|
||||
// Or strictly "activeUsers"
|
||||
}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
var response = await service.Properties.RunReport(request, $"properties/{ga4PropertyId}").ExecuteAsync();
|
||||
|
||||
var result = response.Rows?.Select(row => new
|
||||
{
|
||||
date = FormatDate(row.DimensionValues[0].Value), // GA4 returns date as YYYYMMDD string usually
|
||||
dailyActiveUsers = int.Parse(row.MetricValues[0].Value)
|
||||
}) ?? Enumerable.Empty<object>();
|
||||
|
||||
return Results.Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error: {ex}");
|
||||
return Results.Problem($"Analytics API Error: {ex.Message}");
|
||||
}
|
||||
})
|
||||
.WithName("GetDailyMetrics")
|
||||
.WithOpenApi();
|
||||
|
||||
app.MapGet("/api/metrics/general", async (
|
||||
[FromServices] AnalyticsDataService service) =>
|
||||
{
|
||||
// "Global" means all time ideally, or a very long range.
|
||||
// GA4 retention might limit this for user-level data, but aggregated metrics usually go back further.
|
||||
var startDate = "2023-01-01"; // Arbitrary start date for the app
|
||||
var endDate = "today";
|
||||
|
||||
var request = new RunReportRequest
|
||||
{
|
||||
Property = $"properties/{ga4PropertyId}",
|
||||
DateRanges = new List<DateRange>
|
||||
{
|
||||
new DateRange { StartDate = startDate, EndDate = endDate }
|
||||
},
|
||||
Metrics = new List<Metric>
|
||||
{
|
||||
new Metric { Name = "totalUsers" }, // Proxy for "nb de comptes"
|
||||
new Metric { Name = "eventCount" } // Proxy for "nb de requètes"
|
||||
}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
var response = await service.Properties.RunReport(request, $"properties/{ga4PropertyId}").ExecuteAsync();
|
||||
|
||||
var totalUsers = 0;
|
||||
var eventCount = 0;
|
||||
|
||||
if (response.Rows != null && response.Rows.Count > 0)
|
||||
{
|
||||
var row = response.Rows[0];
|
||||
totalUsers = int.Parse(row.MetricValues[0].Value);
|
||||
eventCount = int.Parse(row.MetricValues[1].Value);
|
||||
}
|
||||
|
||||
return Results.Ok(new
|
||||
{
|
||||
totalAccounts = totalUsers,
|
||||
totalRequests = eventCount
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error: {ex}");
|
||||
return Results.Problem($"Analytics API Error: {ex.Message}");
|
||||
}
|
||||
})
|
||||
.WithName("GetGeneralMetrics")
|
||||
.WithOpenApi();
|
||||
|
||||
app.Run();
|
||||
|
||||
// Helper to format GA4 YYYYMMDD to YYYY-MM-DD
|
||||
static string FormatDate(string gaDate)
|
||||
{
|
||||
if (gaDate.Length == 8)
|
||||
{
|
||||
return $"{gaDate.Substring(0, 4)}-{gaDate.Substring(4, 2)}-{gaDate.Substring(6, 2)}";
|
||||
}
|
||||
return gaDate;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotNetEnv" Version="3.1.1" />
|
||||
<PackageReference Include="Google.Apis.AnalyticsData.v1beta" Version="1.68.0.3608" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Executable
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,291 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"TravelMate.Backend/1.0.0": {
|
||||
"dependencies": {
|
||||
"DotNetEnv": "3.1.1",
|
||||
"Google.Apis.AnalyticsData.v1beta": "1.68.0.3608",
|
||||
"Microsoft.AspNetCore.OpenApi": "8.0.1",
|
||||
"Swashbuckle.AspNetCore": "6.5.0"
|
||||
},
|
||||
"runtime": {
|
||||
"TravelMate.Backend.dll": {}
|
||||
}
|
||||
},
|
||||
"DotNetEnv/3.1.1": {
|
||||
"dependencies": {
|
||||
"Sprache": "2.3.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard1.3/DotNetEnv.dll": {
|
||||
"assemblyVersion": "3.1.1.0",
|
||||
"fileVersion": "3.1.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Google.Apis/1.68.0": {
|
||||
"dependencies": {
|
||||
"Google.Apis.Core": "1.68.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/Google.Apis.dll": {
|
||||
"assemblyVersion": "1.68.0.0",
|
||||
"fileVersion": "1.68.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Google.Apis.AnalyticsData.v1beta/1.68.0.3608": {
|
||||
"dependencies": {
|
||||
"Google.Apis": "1.68.0",
|
||||
"Google.Apis.Auth": "1.68.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/Google.Apis.AnalyticsData.v1beta.dll": {
|
||||
"assemblyVersion": "1.68.0.3608",
|
||||
"fileVersion": "1.68.0.3608"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Google.Apis.Auth/1.68.0": {
|
||||
"dependencies": {
|
||||
"Google.Apis": "1.68.0",
|
||||
"Google.Apis.Core": "1.68.0",
|
||||
"System.Management": "7.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/Google.Apis.Auth.dll": {
|
||||
"assemblyVersion": "1.68.0.0",
|
||||
"fileVersion": "1.68.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Google.Apis.Core/1.68.0": {
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/Google.Apis.Core.dll": {
|
||||
"assemblyVersion": "1.68.0.0",
|
||||
"fileVersion": "1.68.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.AspNetCore.OpenApi/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.OpenApi": "1.4.3"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.AspNetCore.OpenApi.dll": {
|
||||
"assemblyVersion": "8.0.1.0",
|
||||
"fileVersion": "8.0.123.58008"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.OpenApi/1.4.3": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.OpenApi.dll": {
|
||||
"assemblyVersion": "1.4.3.0",
|
||||
"fileVersion": "1.4.3.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Sprache/2.3.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/Sprache.dll": {
|
||||
"assemblyVersion": "2.3.1.0",
|
||||
"fileVersion": "2.3.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore/6.5.0": {
|
||||
"dependencies": {
|
||||
"Swashbuckle.AspNetCore.Swagger": "6.5.0",
|
||||
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0",
|
||||
"Swashbuckle.AspNetCore.SwaggerUI": "6.5.0"
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.Swagger/6.5.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.OpenApi": "1.4.3"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net7.0/Swashbuckle.AspNetCore.Swagger.dll": {
|
||||
"assemblyVersion": "6.5.0.0",
|
||||
"fileVersion": "6.5.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerGen/6.5.0": {
|
||||
"dependencies": {
|
||||
"Swashbuckle.AspNetCore.Swagger": "6.5.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net7.0/Swashbuckle.AspNetCore.SwaggerGen.dll": {
|
||||
"assemblyVersion": "6.5.0.0",
|
||||
"fileVersion": "6.5.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerUI/6.5.0": {
|
||||
"runtime": {
|
||||
"lib/net7.0/Swashbuckle.AspNetCore.SwaggerUI.dll": {
|
||||
"assemblyVersion": "6.5.0.0",
|
||||
"fileVersion": "6.5.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.CodeDom/7.0.0": {
|
||||
"runtime": {
|
||||
"lib/net7.0/System.CodeDom.dll": {
|
||||
"assemblyVersion": "7.0.0.0",
|
||||
"fileVersion": "7.0.22.51805"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Management/7.0.2": {
|
||||
"dependencies": {
|
||||
"System.CodeDom": "7.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net7.0/System.Management.dll": {
|
||||
"assemblyVersion": "7.0.0.2",
|
||||
"fileVersion": "7.0.723.27404"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/win/lib/net7.0/System.Management.dll": {
|
||||
"rid": "win",
|
||||
"assetType": "runtime",
|
||||
"assemblyVersion": "7.0.0.2",
|
||||
"fileVersion": "7.0.723.27404"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"TravelMate.Backend/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"DotNetEnv/3.1.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-o4SqUVCq0pqHF/HYsZk6k22XGIVmvsDVo+Dy7l0ubq9uQ45JkXswrMRJmYvhGLXWFYF0M5OupMonytB+0zvpGQ==",
|
||||
"path": "dotnetenv/3.1.1",
|
||||
"hashPath": "dotnetenv.3.1.1.nupkg.sha512"
|
||||
},
|
||||
"Google.Apis/1.68.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-s2MymhdpH+ybZNBeZ2J5uFgFHApBp+QXf9FjZSdM1lk/vx5VqIknJwnaWiuAzXxPrLEkesX0Q+UsiWn39yZ9zw==",
|
||||
"path": "google.apis/1.68.0",
|
||||
"hashPath": "google.apis.1.68.0.nupkg.sha512"
|
||||
},
|
||||
"Google.Apis.AnalyticsData.v1beta/1.68.0.3608": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-y9BdpAyCIKmRSFPUZEwyD2CtqXgzC8L0gqCqfoeDIn2bBu3RBp+uiLfCe/ns20AuArfnyIJgR4unmvap+9CpHQ==",
|
||||
"path": "google.apis.analyticsdata.v1beta/1.68.0.3608",
|
||||
"hashPath": "google.apis.analyticsdata.v1beta.1.68.0.3608.nupkg.sha512"
|
||||
},
|
||||
"Google.Apis.Auth/1.68.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-hFx8Qz5bZ4w0hpnn4tSmZaaFpjAMsgVElZ+ZgVLUZ2r9i+AKcoVgwiNfv1pruNS5cCvpXqhKECbruBCfRezPHA==",
|
||||
"path": "google.apis.auth/1.68.0",
|
||||
"hashPath": "google.apis.auth.1.68.0.nupkg.sha512"
|
||||
},
|
||||
"Google.Apis.Core/1.68.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-pAqwa6pfu53UXCR2b7A/PAPXeuVg6L1OFw38WckN27NU2+mf+KTjoEg2YGv/f0UyKxzz7DxF1urOTKg/6dTP9g==",
|
||||
"path": "google.apis.core/1.68.0",
|
||||
"hashPath": "google.apis.core.1.68.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.AspNetCore.OpenApi/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-JF0U31SByntKEhZNC8ch3CD87BLZb5AzSujOBppLdvnjYu3W2XZvlsol5hUJfxiaHOp720cUiL6wzG8Bv0fI2Q==",
|
||||
"path": "microsoft.aspnetcore.openapi/8.0.1",
|
||||
"hashPath": "microsoft.aspnetcore.openapi.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.OpenApi/1.4.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-rURwggB+QZYcSVbDr7HSdhw/FELvMlriW10OeOzjPT7pstefMo7IThhtNtDudxbXhW+lj0NfX72Ka5EDsG8x6w==",
|
||||
"path": "microsoft.openapi/1.4.3",
|
||||
"hashPath": "microsoft.openapi.1.4.3.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
},
|
||||
"Sprache/2.3.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-Q+mXeiTxiUYG3lKYF6TS82/SyB4F2613Q1yXTMwg4jWGHEEVC3yrzHtNcI4B3qnDI0+eJsezGJ0V+cToUytHWw==",
|
||||
"path": "sprache/2.3.1",
|
||||
"hashPath": "sprache.2.3.1.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore/6.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-FK05XokgjgwlCI6wCT+D4/abtQkL1X1/B9Oas6uIwHFmYrIO9WUD5aLC9IzMs9GnHfUXOtXZ2S43gN1mhs5+aA==",
|
||||
"path": "swashbuckle.aspnetcore/6.5.0",
|
||||
"hashPath": "swashbuckle.aspnetcore.6.5.0.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore.Swagger/6.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-XWmCmqyFmoItXKFsQSwQbEAsjDKcxlNf1l+/Ki42hcb6LjKL8m5Db69OTvz5vLonMSRntYO1XLqz0OP+n3vKnA==",
|
||||
"path": "swashbuckle.aspnetcore.swagger/6.5.0",
|
||||
"hashPath": "swashbuckle.aspnetcore.swagger.6.5.0.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerGen/6.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-Y/qW8Qdg9OEs7V013tt+94OdPxbRdbhcEbw4NiwGvf4YBcfhL/y7qp/Mjv/cENsQ2L3NqJ2AOu94weBy/h4KvA==",
|
||||
"path": "swashbuckle.aspnetcore.swaggergen/6.5.0",
|
||||
"hashPath": "swashbuckle.aspnetcore.swaggergen.6.5.0.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerUI/6.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-OvbvxX+wL8skxTBttcBsVxdh73Fag4xwqEU2edh4JMn7Ws/xJHnY/JB1e9RoCb6XpDxUF3hD9A0Z1lEUx40Pfw==",
|
||||
"path": "swashbuckle.aspnetcore.swaggerui/6.5.0",
|
||||
"hashPath": "swashbuckle.aspnetcore.swaggerui.6.5.0.nupkg.sha512"
|
||||
},
|
||||
"System.CodeDom/7.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-GLltyqEsE5/3IE+zYRP5sNa1l44qKl9v+bfdMcwg+M9qnQf47wK3H0SUR/T+3N4JEQXF3vV4CSuuo0rsg+nq2A==",
|
||||
"path": "system.codedom/7.0.0",
|
||||
"hashPath": "system.codedom.7.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Management/7.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-/qEUN91mP/MUQmJnM5y5BdT7ZoPuVrtxnFlbJ8a3kBJGhe2wCzBfnPFtK2wTtEEcf3DMGR9J00GZZfg6HRI6yA==",
|
||||
"path": "system.management/7.0.2",
|
||||
"hashPath": "system.management.7.0.2.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App",
|
||||
"version": "8.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.GC.Server": true,
|
||||
"System.Globalization.Invariant": true,
|
||||
"System.Globalization.PredefinedCulturesOnly": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"Version":1,"ManifestType":"Build","Endpoints":[]}
|
||||
Binary file not shown.
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
PROJECT_ID="travelmate-a47f5"
|
||||
SERVICE_NAME="travelmate-backend"
|
||||
REGION="europe-west1" # Vous pourrez changer ceci si besoin
|
||||
|
||||
echo "🚀 Déploiement de $SERVICE_NAME sur $PROJECT_ID..."
|
||||
|
||||
# Vérification de gcloud
|
||||
if ! command -v gcloud &> /dev/null
|
||||
then
|
||||
echo "❌ gcloud n'est pas installé."
|
||||
echo "👉 Installez le Google Cloud SDK : https://cloud.google.com/sdk/docs/install"
|
||||
echo "Puis lancez 'gcloud auth login' et 'gcloud auth application-default login'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build sur Cloud Build (plus simple que Docker local et push)
|
||||
echo "📦 Construction de l'image sur Google Cloud Build..."
|
||||
gcloud builds submit --tag gcr.io/$PROJECT_ID/$SERVICE_NAME --project $PROJECT_ID .
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Échec du build."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Déploiement sur Cloud Run
|
||||
echo "🚀 Déploiement sur Cloud Run..."
|
||||
gcloud run deploy $SERVICE_NAME \
|
||||
--image gcr.io/$PROJECT_ID/$SERVICE_NAME \
|
||||
--platform managed \
|
||||
--region $REGION \
|
||||
--project $PROJECT_ID \
|
||||
--allow-unauthenticated \
|
||||
--set-env-vars GA4_PROPERTY_ID=507003174
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Déploiement terminé avec succès !"
|
||||
echo "ℹ️ Récupérez l'URL ci-dessus pour votre MauiProgram.cs"
|
||||
else
|
||||
echo "❌ Échec du déploiement."
|
||||
fi
|
||||
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("TravelMate.Backend")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+63fc18ea740090c0a2233c46af179b2dbe32a9b8")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("TravelMate.Backend")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("TravelMate.Backend")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Généré par la classe MSBuild WriteCodeFragment.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0aab77bc3ae598fb4e009b4ecda3aeffcfb640a524b7ecc7591b10a25aa5c92a
|
||||
@@ -0,0 +1,23 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||
build_property.TargetFrameworkVersion = v8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb = true
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization = true
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = TravelMate.Backend
|
||||
build_property.RootNamespace = TravelMate.Backend
|
||||
build_property.ProjectDir = /Users/dayronvanleemput/Documents/Coding/travel_mate/backend/
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.RazorLangVersion = 8.0
|
||||
build_property.SupportLocalizedComponentNames =
|
||||
build_property.GenerateRazorMetadataSourceChecksumAttributes =
|
||||
build_property.MSBuildProjectDirectory = /Users/dayronvanleemput/Documents/Coding/travel_mate/backend
|
||||
build_property._RazorSourceGeneratorDebug =
|
||||
build_property.EffectiveAnalysisLevelStyle = 8.0
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
@@ -0,0 +1,17 @@
|
||||
// <auto-generated/>
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Routing;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Hosting;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.IO;
|
||||
global using System.Linq;
|
||||
global using System.Net.Http;
|
||||
global using System.Net.Http.Json;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Microsoft.AspNetCore.OpenApi")]
|
||||
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")]
|
||||
|
||||
// Généré par la classe MSBuild WriteCodeFragment.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
564fc6ab625b9b4d1fd8dff0a4b24b86b698bd2655c9670266b6506278a91b74
|
||||
@@ -0,0 +1,44 @@
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.csproj.AssemblyReference.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/rpswa.dswa.cache.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.GeneratedMSBuildEditorConfig.editorconfig
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.AssemblyInfoInputs.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.AssemblyInfo.cs
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.csproj.CoreCompileInputs.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.MvcApplicationPartsAssemblyInfo.cs
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.MvcApplicationPartsAssemblyInfo.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/TravelMate.Backend.staticwebassets.endpoints.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/TravelMate.Backend
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/TravelMate.Backend.deps.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/TravelMate.Backend.runtimeconfig.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/TravelMate.Backend.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/TravelMate.Backend.pdb
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Google.Apis.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Google.Apis.AnalyticsData.v1beta.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Google.Apis.Auth.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Google.Apis.Core.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Microsoft.AspNetCore.OpenApi.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Microsoft.OpenApi.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Newtonsoft.Json.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Swashbuckle.AspNetCore.Swagger.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/System.CodeDom.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/System.Management.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/runtimes/win/lib/net7.0/System.Management.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/rjimswa.dswa.cache.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/rjsmrazor.dswa.cache.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/rjsmcshtml.dswa.cache.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/scopedcss/bundle/TravelMate.Backend.styles.css
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/staticwebassets.build.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/staticwebassets.build.json.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/staticwebassets.development.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/staticwebassets.build.endpoints.json
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/swae.build.ex.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMa.030FF4D7.Up2Date
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/refint/TravelMate.Backend.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.pdb
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/TravelMate.Backend.genruntimeconfig.cache
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/Debug/net8.0/ref/TravelMate.Backend.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/DotNetEnv.dll
|
||||
/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/bin/Debug/net8.0/Sprache.dll
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
f79f58c3a8e99961a1a88dcd08a90777e8913bfe44cb3f95b85212ac836b242e
|
||||
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"GlobalPropertiesHash":"mgx0JdLooAvG36KewBSjBhnWYhsOqFG08xB+ZULwM34=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["eZ2qkZPO/MYAX3sbEVnqz208bqpLunsDjAZG7XY4wtU=","KNz8obfBglIfZZ8oXDHzHOqsrgOcLsm\u002BNZPmnNIlemg="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||
@@ -0,0 +1 @@
|
||||
{"GlobalPropertiesHash":"q+hAwBrcPnVtSgGz/Kp6kP1qVOxpDSxk/3MpYyK9dDk=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["eZ2qkZPO/MYAX3sbEVnqz208bqpLunsDjAZG7XY4wtU=","KNz8obfBglIfZZ8oXDHzHOqsrgOcLsm\u002BNZPmnNIlemg="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||
@@ -0,0 +1 @@
|
||||
{"Version":1,"ManifestType":"Build","Endpoints":[]}
|
||||
@@ -0,0 +1 @@
|
||||
{"Version":1,"Hash":"Zp2AayENaHwwegD1S3er2B42GEf0rjybz+5iZ/TMps0=","Source":"TravelMate.Backend","BasePath":"/","Mode":"Root","ManifestType":"Build","ReferencedProjectsConfiguration":[],"DiscoveryPatterns":[],"Assets":[],"Endpoints":[]}
|
||||
@@ -0,0 +1 @@
|
||||
Zp2AayENaHwwegD1S3er2B42GEf0rjybz+5iZ/TMps0=
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/TravelMate.Backend.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/TravelMate.Backend.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/TravelMate.Backend.csproj",
|
||||
"projectName": "TravelMate.Backend",
|
||||
"projectPath": "/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/TravelMate.Backend.csproj",
|
||||
"packagesPath": "/Users/dayronvanleemput/.nuget/packages/",
|
||||
"outputPath": "/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/Users/dayronvanleemput/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"/usr/local/share/dotnet/library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "10.0.100"
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"dependencies": {
|
||||
"DotNetEnv": {
|
||||
"target": "Package",
|
||||
"version": "[3.1.1, )"
|
||||
},
|
||||
"Google.Apis.AnalyticsData.v1beta": {
|
||||
"target": "Package",
|
||||
"version": "[1.68.0.3608, )"
|
||||
},
|
||||
"Microsoft.AspNetCore.OpenApi": {
|
||||
"target": "Package",
|
||||
"version": "[8.0.1, )"
|
||||
},
|
||||
"Swashbuckle.AspNetCore": {
|
||||
"target": "Package",
|
||||
"version": "[6.5.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"downloadDependencies": [
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App.Ref",
|
||||
"version": "[8.0.22, 8.0.22]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Host.osx-arm64",
|
||||
"version": "[8.0.22, 8.0.22]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Ref",
|
||||
"version": "[8.0.22, 8.0.22]"
|
||||
}
|
||||
],
|
||||
"frameworkReferences": {
|
||||
"Microsoft.AspNetCore.App": {
|
||||
"privateAssets": "none"
|
||||
},
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.100/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/dayronvanleemput/.nuget/packages/</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/dayronvanleemput/.nuget/packages/</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="/Users/dayronvanleemput/.nuget/packages/" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server/6.0.5/build/Microsoft.Extensions.ApiDescription.Server.props" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server/6.0.5/build/Microsoft.Extensions.ApiDescription.Server.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)swashbuckle.aspnetcore/6.5.0/build/Swashbuckle.AspNetCore.props" Condition="Exists('$(NuGetPackageRoot)swashbuckle.aspnetcore/6.5.0/build/Swashbuckle.AspNetCore.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">/Users/dayronvanleemput/.nuget/packages/microsoft.extensions.apidescription.server/6.0.5</PkgMicrosoft_Extensions_ApiDescription_Server>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server/6.0.5/build/Microsoft.Extensions.ApiDescription.Server.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server/6.0.5/build/Microsoft.Extensions.ApiDescription.Server.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "6JHw9LAEeo0=",
|
||||
"success": true,
|
||||
"projectFilePath": "/Users/dayronvanleemput/Documents/Coding/travel_mate/backend/TravelMate.Backend.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"/Users/dayronvanleemput/.nuget/packages/dotnetenv/3.1.1/dotnetenv.3.1.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/google.apis/1.68.0/google.apis.1.68.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/google.apis.analyticsdata.v1beta/1.68.0.3608/google.apis.analyticsdata.v1beta.1.68.0.3608.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/google.apis.auth/1.68.0/google.apis.auth.1.68.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/google.apis.core/1.68.0/google.apis.core.1.68.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.aspnetcore.openapi/8.0.1/microsoft.aspnetcore.openapi.8.0.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.extensions.apidescription.server/6.0.5/microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.extensions.configuration/1.1.2/microsoft.extensions.configuration.1.1.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.extensions.configuration.abstractions/1.1.2/microsoft.extensions.configuration.abstractions.1.1.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.extensions.primitives/1.1.1/microsoft.extensions.primitives.1.1.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.netcore.platforms/1.1.1/microsoft.netcore.platforms.1.1.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.netcore.targets/1.1.3/microsoft.netcore.targets.1.1.3.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.openapi/1.4.3/microsoft.openapi.1.4.3.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.win32.primitives/4.3.0/microsoft.win32.primitives.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/netstandard.library/1.6.1/netstandard.library.1.6.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.native.system/4.3.0/runtime.native.system.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.native.system.io.compression/4.3.0/runtime.native.system.io.compression.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.native.system.net.http/4.3.0/runtime.native.system.net.http.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.native.system.security.cryptography.apple/4.3.0/runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.native.system.security.cryptography.openssl/4.3.2/runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/sprache/2.3.1/sprache.2.3.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/swashbuckle.aspnetcore/6.5.0/swashbuckle.aspnetcore.6.5.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/swashbuckle.aspnetcore.swagger/6.5.0/swashbuckle.aspnetcore.swagger.6.5.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/swashbuckle.aspnetcore.swaggergen/6.5.0/swashbuckle.aspnetcore.swaggergen.6.5.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/swashbuckle.aspnetcore.swaggerui/6.5.0/swashbuckle.aspnetcore.swaggerui.6.5.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.appcontext/4.3.0/system.appcontext.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.buffers/4.3.0/system.buffers.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.codedom/7.0.0/system.codedom.7.0.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.collections/4.3.0/system.collections.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.collections.concurrent/4.3.0/system.collections.concurrent.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.console/4.3.0/system.console.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.diagnostics.debug/4.3.0/system.diagnostics.debug.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.diagnostics.diagnosticsource/4.3.0/system.diagnostics.diagnosticsource.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.diagnostics.tools/4.3.0/system.diagnostics.tools.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.diagnostics.tracing/4.3.0/system.diagnostics.tracing.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.globalization/4.3.0/system.globalization.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.globalization.calendars/4.3.0/system.globalization.calendars.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.globalization.extensions/4.3.0/system.globalization.extensions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.io/4.3.0/system.io.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.io.compression/4.3.0/system.io.compression.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.io.compression.zipfile/4.3.0/system.io.compression.zipfile.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.io.filesystem/4.3.0/system.io.filesystem.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.io.filesystem.primitives/4.3.0/system.io.filesystem.primitives.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.linq/4.3.0/system.linq.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.linq.expressions/4.3.0/system.linq.expressions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.management/7.0.2/system.management.7.0.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.net.http/4.3.4/system.net.http.4.3.4.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.net.primitives/4.3.0/system.net.primitives.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.net.sockets/4.3.0/system.net.sockets.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.objectmodel/4.3.0/system.objectmodel.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.private.uri/4.3.2/system.private.uri.4.3.2.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection/4.3.0/system.reflection.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection.emit/4.3.0/system.reflection.emit.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection.emit.ilgeneration/4.3.0/system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection.emit.lightweight/4.3.0/system.reflection.emit.lightweight.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection.extensions/4.3.0/system.reflection.extensions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection.primitives/4.3.0/system.reflection.primitives.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.reflection.typeextensions/4.3.0/system.reflection.typeextensions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.resources.resourcemanager/4.3.0/system.resources.resourcemanager.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime/4.3.1/system.runtime.4.3.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime.compilerservices.unsafe/4.3.0/system.runtime.compilerservices.unsafe.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime.extensions/4.3.0/system.runtime.extensions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime.handles/4.3.0/system.runtime.handles.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime.interopservices/4.3.0/system.runtime.interopservices.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime.interopservices.runtimeinformation/4.3.0/system.runtime.interopservices.runtimeinformation.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.runtime.numerics/4.3.0/system.runtime.numerics.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.algorithms/4.3.0/system.security.cryptography.algorithms.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.cng/4.3.0/system.security.cryptography.cng.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.csp/4.3.0/system.security.cryptography.csp.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.encoding/4.3.0/system.security.cryptography.encoding.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.openssl/4.3.0/system.security.cryptography.openssl.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.primitives/4.3.0/system.security.cryptography.primitives.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.security.cryptography.x509certificates/4.3.0/system.security.cryptography.x509certificates.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.text.encoding/4.3.0/system.text.encoding.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.text.encoding.extensions/4.3.0/system.text.encoding.extensions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.text.regularexpressions/4.3.1/system.text.regularexpressions.4.3.1.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.threading/4.3.0/system.threading.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.threading.tasks/4.3.0/system.threading.tasks.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.threading.tasks.extensions/4.3.0/system.threading.tasks.extensions.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.threading.timer/4.3.0/system.threading.timer.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.xml.readerwriter/4.3.0/system.xml.readerwriter.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/system.xml.xdocument/4.3.0/system.xml.xdocument.4.3.0.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.aspnetcore.app.ref/8.0.22/microsoft.aspnetcore.app.ref.8.0.22.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.netcore.app.host.osx-arm64/8.0.22/microsoft.netcore.app.host.osx-arm64.8.0.22.nupkg.sha512",
|
||||
"/Users/dayronvanleemput/.nuget/packages/microsoft.netcore.app.ref/8.0.22/microsoft.netcore.app.ref.8.0.22.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"dateRanges": [
|
||||
{
|
||||
"startDate": "2023-01-01",
|
||||
"endDate": "today"
|
||||
}
|
||||
],
|
||||
"metrics": [
|
||||
{
|
||||
"name": "totalUsers"
|
||||
},
|
||||
{
|
||||
"name": "eventCount"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -174,7 +174,11 @@ class ActivityBloc extends Bloc<ActivityEvent, ActivityState> {
|
||||
'Erreur recherche activités: $e',
|
||||
stackTrace,
|
||||
);
|
||||
emit(const ActivityError('Impossible de rechercher les activités'));
|
||||
// Extraire le message d'erreur si disponible
|
||||
final errorMessage = e.toString().replaceAll('Exception: ', '');
|
||||
emit(
|
||||
ActivityError('Impossible de rechercher les activités: $errorMessage'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||
body: BlocConsumer<AuthBloc, AuthState>(
|
||||
listener: (context, state) {
|
||||
if (state is AuthAuthenticated) {
|
||||
Navigator.pushReplacementNamed(context, '/home');
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context,
|
||||
'/home',
|
||||
(route) => false,
|
||||
);
|
||||
} else if (state is AuthError) {
|
||||
ErrorService().showError(message: state.message);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,11 @@ class _SignUpPageState extends State<SignUpPage> {
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
Navigator.pushReplacementNamed(context, '/home');
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context,
|
||||
'/home',
|
||||
(route) => false,
|
||||
);
|
||||
} else if (state is AuthError) {
|
||||
_errorService.showError(message: state.message);
|
||||
}
|
||||
|
||||
@@ -37,83 +37,75 @@ class ActivityPlacesService {
|
||||
int maxResults = 20,
|
||||
int offset = 0,
|
||||
}) async {
|
||||
try {
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Recherche d\'activités pour: $destination (max: $maxResults, offset: $offset)',
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Recherche d\'activités pour: $destination (max: $maxResults, offset: $offset)',
|
||||
);
|
||||
|
||||
// 1. Géocoder la destination
|
||||
final coordinates = await _geocodeDestination(destination);
|
||||
|
||||
// 2. Rechercher les activités par catégorie ou toutes les catégories
|
||||
List<Activity> allActivities = [];
|
||||
|
||||
if (category != null) {
|
||||
final activities = await _searchByCategory(
|
||||
coordinates['lat']!,
|
||||
coordinates['lng']!,
|
||||
category,
|
||||
tripId,
|
||||
radius,
|
||||
);
|
||||
allActivities.addAll(activities);
|
||||
} else {
|
||||
// Rechercher dans toutes les catégories principales
|
||||
final mainCategories = [
|
||||
ActivityCategory.attraction,
|
||||
ActivityCategory.museum,
|
||||
ActivityCategory.restaurant,
|
||||
ActivityCategory.culture,
|
||||
ActivityCategory.nature,
|
||||
];
|
||||
|
||||
// 1. Géocoder la destination
|
||||
final coordinates = await _geocodeDestination(destination);
|
||||
|
||||
// 2. Rechercher les activités par catégorie ou toutes les catégories
|
||||
List<Activity> allActivities = [];
|
||||
|
||||
if (category != null) {
|
||||
for (final cat in mainCategories) {
|
||||
final activities = await _searchByCategory(
|
||||
coordinates['lat']!,
|
||||
coordinates['lng']!,
|
||||
category,
|
||||
cat,
|
||||
tripId,
|
||||
radius,
|
||||
);
|
||||
allActivities.addAll(activities);
|
||||
} else {
|
||||
// Rechercher dans toutes les catégories principales
|
||||
final mainCategories = [
|
||||
ActivityCategory.attraction,
|
||||
ActivityCategory.museum,
|
||||
ActivityCategory.restaurant,
|
||||
ActivityCategory.culture,
|
||||
ActivityCategory.nature,
|
||||
];
|
||||
|
||||
for (final cat in mainCategories) {
|
||||
final activities = await _searchByCategory(
|
||||
coordinates['lat']!,
|
||||
coordinates['lng']!,
|
||||
cat,
|
||||
tripId,
|
||||
radius,
|
||||
);
|
||||
allActivities.addAll(activities);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Supprimer les doublons et trier par note
|
||||
final uniqueActivities = _removeDuplicates(allActivities);
|
||||
uniqueActivities.sort((a, b) => (b.rating ?? 0).compareTo(a.rating ?? 0));
|
||||
// 3. Supprimer les doublons et trier par note
|
||||
final uniqueActivities = _removeDuplicates(allActivities);
|
||||
uniqueActivities.sort((a, b) => (b.rating ?? 0).compareTo(a.rating ?? 0));
|
||||
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: ${uniqueActivities.length} activités trouvées au total',
|
||||
);
|
||||
|
||||
// 4. Appliquer la pagination
|
||||
final startIndex = offset;
|
||||
final endIndex = (startIndex + maxResults).clamp(
|
||||
0,
|
||||
uniqueActivities.length,
|
||||
);
|
||||
|
||||
if (startIndex >= uniqueActivities.length) {
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: ${uniqueActivities.length} activités trouvées au total',
|
||||
'ActivityPlacesService: Offset $startIndex dépasse le nombre total (${uniqueActivities.length})',
|
||||
);
|
||||
|
||||
// 4. Appliquer la pagination
|
||||
final startIndex = offset;
|
||||
final endIndex = (startIndex + maxResults).clamp(
|
||||
0,
|
||||
uniqueActivities.length,
|
||||
);
|
||||
|
||||
if (startIndex >= uniqueActivities.length) {
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Offset $startIndex dépasse le nombre total (${uniqueActivities.length})',
|
||||
);
|
||||
return [];
|
||||
}
|
||||
|
||||
final paginatedResults = uniqueActivities.sublist(startIndex, endIndex);
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Retour de ${paginatedResults.length} activités (offset: $offset, max: $maxResults)',
|
||||
);
|
||||
|
||||
return paginatedResults;
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur lors de la recherche: $e',
|
||||
);
|
||||
_errorService.logError('activity_places_service', e);
|
||||
return [];
|
||||
}
|
||||
|
||||
final paginatedResults = uniqueActivities.sublist(startIndex, endIndex);
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Retour de ${paginatedResults.length} activités (offset: $offset, max: $maxResults)',
|
||||
);
|
||||
|
||||
return paginatedResults;
|
||||
}
|
||||
|
||||
/// Géocode une destination pour obtenir les coordonnées
|
||||
@@ -191,50 +183,52 @@ class ActivityPlacesService {
|
||||
String tripId,
|
||||
int radius,
|
||||
) async {
|
||||
try {
|
||||
final url =
|
||||
'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
|
||||
'?location=$lat,$lng'
|
||||
'&radius=$radius'
|
||||
'&type=${category.googlePlaceType}'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
final url =
|
||||
'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
|
||||
'?location=$lat,$lng'
|
||||
'&radius=$radius'
|
||||
'&type=${category.googlePlaceType}'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
|
||||
final response = await http.get(Uri.parse(url));
|
||||
final response = await http.get(Uri.parse(url));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
|
||||
for (final place in data['results']) {
|
||||
try {
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
for (final place in data['results']) {
|
||||
try {
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
}
|
||||
|
||||
return activities;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur recherche par catégorie: $e',
|
||||
);
|
||||
return [];
|
||||
return activities;
|
||||
} else if (data['status'] == 'ZERO_RESULTS') {
|
||||
return [];
|
||||
} else {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur API Places: ${data['status']} - ${data['error_message']}',
|
||||
);
|
||||
throw Exception(
|
||||
'API Places Error: ${data['status']} - ${data['error_message']}',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
throw Exception('Erreur HTTP ${response.statusCode}');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,62 +351,62 @@ class ActivityPlacesService {
|
||||
required String tripId,
|
||||
int radius = 5000,
|
||||
}) async {
|
||||
try {
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Recherche textuelle: $query à $destination',
|
||||
);
|
||||
LoggerService.info(
|
||||
'ActivityPlacesService: Recherche textuelle: $query à $destination',
|
||||
);
|
||||
|
||||
// Géocoder la destination
|
||||
final coordinates = await _geocodeDestination(destination);
|
||||
// Géocoder la destination
|
||||
final coordinates = await _geocodeDestination(destination);
|
||||
|
||||
final encodedQuery = Uri.encodeComponent(query);
|
||||
final url =
|
||||
'https://maps.googleapis.com/maps/api/place/textsearch/json'
|
||||
'?query=$encodedQuery in $destination'
|
||||
'&location=${coordinates['lat']},${coordinates['lng']}'
|
||||
'&radius=$radius'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
final encodedQuery = Uri.encodeComponent(query);
|
||||
final url =
|
||||
'https://maps.googleapis.com/maps/api/place/textsearch/json'
|
||||
'?query=$encodedQuery in $destination'
|
||||
'&location=${coordinates['lat']},${coordinates['lng']}'
|
||||
'&radius=$radius'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
|
||||
final response = await http.get(Uri.parse(url));
|
||||
final response = await http.get(Uri.parse(url));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
|
||||
for (final place in data['results']) {
|
||||
try {
|
||||
// Déterminer la catégorie basée sur les types du lieu
|
||||
final types = List<String>.from(place['types'] ?? []);
|
||||
final category = _determineCategoryFromTypes(types);
|
||||
for (final place in data['results']) {
|
||||
try {
|
||||
// Déterminer la catégorie basée sur les types du lieu
|
||||
final types = List<String>.from(place['types'] ?? []);
|
||||
final category = _determineCategoryFromTypes(types);
|
||||
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
}
|
||||
|
||||
return activities;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur recherche textuelle: $e',
|
||||
);
|
||||
return [];
|
||||
return activities;
|
||||
} else if (data['status'] == 'ZERO_RESULTS') {
|
||||
return [];
|
||||
} else {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur API Places Text Search: ${data['status']}',
|
||||
);
|
||||
throw Exception('API Error: ${data['status']}');
|
||||
}
|
||||
} else {
|
||||
throw Exception('Erreur HTTP ${response.statusCode}');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,70 +517,63 @@ class ActivityPlacesService {
|
||||
int pageSize,
|
||||
String? nextPageToken,
|
||||
) async {
|
||||
try {
|
||||
String url =
|
||||
'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
|
||||
'?location=$lat,$lng'
|
||||
'&radius=$radius'
|
||||
'&type=${category.googlePlaceType}'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
String url =
|
||||
'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
|
||||
'?location=$lat,$lng'
|
||||
'&radius=$radius'
|
||||
'&type=${category.googlePlaceType}'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
|
||||
if (nextPageToken != null) {
|
||||
url += '&pagetoken=$nextPageToken';
|
||||
}
|
||||
if (nextPageToken != null) {
|
||||
url += '&pagetoken=$nextPageToken';
|
||||
}
|
||||
|
||||
final response = await http.get(Uri.parse(url));
|
||||
final response = await http.get(Uri.parse(url));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
final results = data['results'] as List? ?? [];
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
final results = data['results'] as List? ?? [];
|
||||
|
||||
// Limiter à pageSize résultats
|
||||
final limitedResults = results.take(pageSize).toList();
|
||||
// Limiter à pageSize résultats
|
||||
final limitedResults = results.take(pageSize).toList();
|
||||
|
||||
for (final place in limitedResults) {
|
||||
try {
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
for (final place in limitedResults) {
|
||||
try {
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
'activities': activities,
|
||||
'nextPageToken': data['next_page_token'],
|
||||
'hasMoreData': data['next_page_token'] != null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
'activities': <Activity>[],
|
||||
'nextPageToken': null,
|
||||
'hasMoreData': false,
|
||||
};
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur recherche catégorie paginée: $e',
|
||||
);
|
||||
return {
|
||||
'activities': <Activity>[],
|
||||
'nextPageToken': null,
|
||||
'hasMoreData': false,
|
||||
};
|
||||
return {
|
||||
'activities': activities,
|
||||
'nextPageToken': data['next_page_token'],
|
||||
'hasMoreData': data['next_page_token'] != null,
|
||||
};
|
||||
} else if (data['status'] == 'ZERO_RESULTS') {
|
||||
return {
|
||||
'activities': <Activity>[],
|
||||
'nextPageToken': null,
|
||||
'hasMoreData': false,
|
||||
};
|
||||
} else {
|
||||
throw Exception('API Error: ${data['status']}');
|
||||
}
|
||||
} else {
|
||||
throw Exception('Erreur HTTP ${response.statusCode}');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,75 +586,68 @@ class ActivityPlacesService {
|
||||
int pageSize,
|
||||
String? nextPageToken,
|
||||
) async {
|
||||
try {
|
||||
// Pour toutes les catégories, on utilise une recherche plus générale
|
||||
String url =
|
||||
'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
|
||||
'?location=$lat,$lng'
|
||||
'&radius=$radius'
|
||||
'&type=tourist_attraction'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
// Pour toutes les catégories, on utilise une recherche plus générale
|
||||
String url =
|
||||
'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
|
||||
'?location=$lat,$lng'
|
||||
'&radius=$radius'
|
||||
'&type=tourist_attraction'
|
||||
'&key=$_apiKey'
|
||||
'&language=fr';
|
||||
|
||||
if (nextPageToken != null) {
|
||||
url += '&pagetoken=$nextPageToken';
|
||||
}
|
||||
if (nextPageToken != null) {
|
||||
url += '&pagetoken=$nextPageToken';
|
||||
}
|
||||
|
||||
final response = await http.get(Uri.parse(url));
|
||||
final response = await http.get(Uri.parse(url));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
final results = data['results'] as List? ?? [];
|
||||
if (data['status'] == 'OK') {
|
||||
final List<Activity> activities = [];
|
||||
final results = data['results'] as List? ?? [];
|
||||
|
||||
// Limiter à pageSize résultats
|
||||
final limitedResults = results.take(pageSize).toList();
|
||||
// Limiter à pageSize résultats
|
||||
final limitedResults = results.take(pageSize).toList();
|
||||
|
||||
for (final place in limitedResults) {
|
||||
try {
|
||||
// Déterminer la catégorie basée sur les types du lieu
|
||||
final types = List<String>.from(place['types'] ?? []);
|
||||
final category = _determineCategoryFromTypes(types);
|
||||
for (final place in limitedResults) {
|
||||
try {
|
||||
// Déterminer la catégorie basée sur les types du lieu
|
||||
final types = List<String>.from(place['types'] ?? []);
|
||||
final category = _determineCategoryFromTypes(types);
|
||||
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
final activity = await _convertPlaceToActivity(
|
||||
place,
|
||||
tripId,
|
||||
category,
|
||||
);
|
||||
if (activity != null) {
|
||||
activities.add(activity);
|
||||
}
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur conversion place: $e',
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
'activities': activities,
|
||||
'nextPageToken': data['next_page_token'],
|
||||
'hasMoreData': data['next_page_token'] != null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
'activities': <Activity>[],
|
||||
'nextPageToken': null,
|
||||
'hasMoreData': false,
|
||||
};
|
||||
} catch (e) {
|
||||
LoggerService.error(
|
||||
'ActivityPlacesService: Erreur recherche toutes catégories paginée: $e',
|
||||
);
|
||||
return {
|
||||
'activities': <Activity>[],
|
||||
'nextPageToken': null,
|
||||
'hasMoreData': false,
|
||||
};
|
||||
return {
|
||||
'activities': activities,
|
||||
'nextPageToken': data['next_page_token'],
|
||||
'hasMoreData': data['next_page_token'] != null,
|
||||
};
|
||||
} else if (data['status'] == 'ZERO_RESULTS') {
|
||||
return {
|
||||
'activities': <Activity>[],
|
||||
'nextPageToken': null,
|
||||
'hasMoreData': false,
|
||||
};
|
||||
} else {
|
||||
throw Exception('API Error: ${data['status']}');
|
||||
}
|
||||
} else {
|
||||
throw Exception('Erreur HTTP ${response.statusCode}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-6
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.3+1
|
||||
version: 2025.12.1+1
|
||||
|
||||
environment:
|
||||
sdk: ^3.9.2
|
||||
@@ -70,11 +70,7 @@ dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
# The "flutter_lints" package below contains a set of recommended lints to
|
||||
# encourage good coding practices. The lint set provided by the package is
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
|
||||
flutter_lints: ^6.0.0
|
||||
mockito: ^5.4.4
|
||||
build_runner: ^2.4.8
|
||||
|
||||
Reference in New Issue
Block a user