using Backend.ServiceHandler; using Backend.Interface; using Microsoft.AspNetCore.Mvc; namespace Backend.Controllers { [ApiController] [Route("api/user-interest")] public sealed class UserInterestController : ControllerBase { private readonly IUserInterestStore _store; public UserInterestController(IUserInterestStore store) { _store = store; } [HttpGet("fetch")] public async Task> FetchAll( [FromQuery] string user, [FromQuery] string type) { List items = await _store.FetchAllAsync(user, type); return Ok(new UserInterestFetchResponse { Items = items }); } [HttpPost("add")] public async Task> Add( [FromQuery] string user, [FromQuery] string type, [FromQuery] string value) { bool success = await _store.AddAsync(user, type, value); return Ok(new BoolResponse { Success = success }); } [HttpDelete("remove")] public async Task> Remove( [FromQuery] string user, [FromQuery] string type, [FromQuery] string value) { bool success = await _store.RemoveAsync(user, type, value); return Ok(new BoolResponse { Success = success }); } } }