Little test with AI + Add the equipment (#8)

Tests using local LLM AI to add comments in the C# files
For the flights tunnel, show the total to day/hours
For the jump, add the equipment (now just with the wingsuit)

Reviewed-on: #8
Co-authored-by: sandre <perso@sebastienandre.com>
Co-committed-by: sandre <perso@sebastienandre.com>
This commit was merged in pull request #8.
This commit is contained in:
2026-05-16 09:24:13 +00:00
committed by sandre
parent 0ebdbca549
commit ceed44f997
70 changed files with 12142 additions and 10444 deletions
@@ -24,24 +24,50 @@ namespace skydiveLogs_api.DomainBusiness
#region Public Methods
/// <summary>
/// Checks if a specific cache entry exists for a given type and user ID.
/// </summary>
/// <param name="type">The type of data to check for in the cache.</param>
/// <param name="userId">Optional user ID to distinguish cache entries. Default is 0.</param>
/// <returns>True if the cache entry exists and is valid, otherwise false.</returns>
public bool Contains(CacheType type, int userId = 0)
{
var key = GetKey(userId, type);
return _memoryCache.Contains(key.ToString());
}
/// <summary>
/// Removes a cache entry from the store.
/// </summary>
/// <param name="type">The type of data to remove from the cache.</param>
/// <param name="userId">Optional user ID to identify the cache entry. Default is 0.</param>
public void Delete(CacheType type, int userId = 0)
{
var key = GetKey(userId, type);
_memoryCache.Remove(key.ToString());
}
/// <summary>
/// Retrieves data from the cache for a specified type and user ID.
/// </summary>
/// <typeparam name="T">The expected type of the cached data.</typeparam>
/// <param name="type">The type of data to retrieve from the cache.</param>
/// <param name="userId">Optional user ID to identify the cache entry. Default is 0.</param>
/// <returns>The cached data cast to type T, or default(T) if not found or expired.</returns>
public T Get<T>(CacheType type, int userId = 0)
{
var key = GetKey(userId, type);
return (T)_memoryCache.Get(key.ToString());
}
/// <summary>
/// Stores data in the cache with a specified expiry time.
/// </summary>
/// <param name="type">The unique identifier for the cache key.</param>
/// <param name="value">The object data to be cached.</param>
/// <param name="duration">The duration in milliseconds before the cache entry expires.</param>
/// <param name="userId">Optional user ID to distinguish cache entries. Default is 0.</param>
/// <exception cref="ArgumentException">Thrown when duration is less than or equal to zero.</exception>
public void Put(CacheType type, object value, int duration, int userId = 0)
{
var key = GetKey(userId, type);
@@ -56,6 +82,12 @@ namespace skydiveLogs_api.DomainBusiness
_memoryCache.Set(key.ToString(), value, policy);
}
/// <summary>
/// Generates a cache key by combining the user ID and cache type.
/// </summary>
/// <param name="userId">The user ID to include in the key.</param>
/// <param name="type">The cache type to include in the key.</param>
/// <returns>A concatenated string key combining userId and type.</returns>
private string GetKey(int userId, CacheType type)
{
return $"{userId}-{type}";
@@ -63,4 +95,4 @@ namespace skydiveLogs_api.DomainBusiness
#endregion Public Methods
}
}
}