Files
SkydiveLogs/Back/skydiveLogs-api.DomainBusiness/UserImageService.cs
T
sandre ceed44f997 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>
2026-05-16 09:24:13 +00:00

82 lines
2.5 KiB
C#

using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainBusiness.Interfaces;
using skydiveLogs_api.DomainService.Repositories;
using System;
using System.Collections.Generic;
namespace skydiveLogs_api.DomainBusiness
{
public class UserImageService : IUserImageService
{
#region Public Constructors
public UserImageService(IUserImageRepository imageRepository,
IIdentityService identityService)
{
_imageRepository = imageRepository;
_identityService = identityService;
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Adds a new image to the system.
/// </summary>
/// <param name="newImage">The UserImage entity containing the new image data.</param>
public void AddNewImage(UserImage newImage)
{
newImage.User = _identityService.ConnectedUser;
_imageRepository.Add(newImage);
}
/// <summary>
/// Deletes an image by its ID.
/// </summary>
/// <param name="id">The image ID to delete.</param>
public void DeleteImageById(int id)
{
throw new NotImplementedException();
}
/// <summary>
/// Retrieves all images.
/// </summary>
/// <returns>A collection of UserImage entities containing all images.</returns>
public IEnumerable<UserImage> GetAllImages()
{
return _imageRepository.GetAll(_identityService.ConnectedUser);
}
/// <summary>
/// Retrieves an image by its ID.
/// </summary>
/// <param name="id">The image ID to retrieve.</param>
/// <returns>A UserImage entity containing the image details.</returns>
public UserImage GetImageById(int id)
{
return _imageRepository.GetById(id);
}
/// <summary>
/// Updates an existing image.
/// </summary>
/// <param name="id">The image ID to update.</param>
/// <param name="Image">UserImage entity containing the updated image data.</param>
public void UpdateImage(int id, UserImage Image)
{
throw new NotImplementedException();
}
#endregion Public Methods
#region Private Fields
private readonly IIdentityService _identityService;
private readonly IUserImageRepository _imageRepository;
#endregion Private Fields
}
}