Initial commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace PowderCoating.Application.Interfaces;
|
||||
|
||||
public interface IProfilePhotoService
|
||||
{
|
||||
/// <summary>
|
||||
/// Saves a profile photo for a user
|
||||
/// Stores in [ContentRoot]/media/{companyId}/profile-photos/{userId}.{ext}
|
||||
/// </summary>
|
||||
/// <param name="file">The photo file to upload</param>
|
||||
/// <param name="userId">The user's ID</param>
|
||||
/// <param name="companyId">The company's ID</param>
|
||||
/// <returns>Tuple with success status, relative file path, and error message if any</returns>
|
||||
Task<(bool Success, string FilePath, string ErrorMessage)> SaveProfilePhotoAsync(
|
||||
IFormFile file,
|
||||
string userId,
|
||||
int companyId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a user's profile photo
|
||||
/// </summary>
|
||||
/// <param name="filePath">Relative path to the photo file</param>
|
||||
/// <returns>Tuple with success status and error message if any</returns>
|
||||
Task<(bool Success, string ErrorMessage)> DeleteProfilePhotoAsync(string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a profile photo
|
||||
/// </summary>
|
||||
/// <param name="filePath">Relative path to the photo</param>
|
||||
/// <returns>Tuple with success status, file bytes, content type, and error message</returns>
|
||||
Task<(bool Success, byte[] FileContent, string ContentType, string ErrorMessage)> GetProfilePhotoAsync(string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a profile photo exists
|
||||
/// </summary>
|
||||
/// <param name="filePath">Relative path to the photo</param>
|
||||
/// <returns>True if exists, false otherwise</returns>
|
||||
Task<bool> ProfilePhotoExistsAsync(string filePath);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user