using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.Request;
using OpenAuth.App.ServiceApp.AI;
using OpenAuth.Repository.Domain;

namespace OpenAuth.WebApi.Controllers.ServiceControllers;

/// <summary>
/// AI成果控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class AiAchievementController : ControllerBase
{
    private readonly AiAchievementServiceApp _app;

    public AiAchievementController(AiAchievementServiceApp app)
    {
        _app = app;
    }
    
    /// <summary>
    /// AI成果列表 
    /// </summary>
    /// <param name="req"></param>
    /// <returns></returns>
    [HttpGet]
    public async Task<Response<PageInfo<List<LasaAiAchievement>>>> GetAiAchievementList([FromQuery] PageReq req)
    {
        return await _app.GetAiAchievementList(req);
    }
    
    /// <summary>
    /// AI成果详情
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    [HttpGet]
    public async Task<Response<LasaAiAchievement>> GetAiAchievement(string id)
    {
        return await _app.GetAiAchievement(id);
    }
}