using BBM.ChatGLM.ChatSession;
using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;

namespace BBM.ChatGLM.Controllers
{
    [Route("ChatSessions")]
    public class ChatSessionsController : ChatGLMController, IChatSessionsAppService
    {
        private readonly IChatSessionsAppService _chatSessionsAppService;
        public ChatSessionsController(IChatSessionsAppService chatSessionsAppService) 
        {
            _chatSessionsAppService = chatSessionsAppService;
        }

        [HttpPost("create")]
        public async Task<ChatSessionDto> CreateAsync([FromBody] ChatSessionCreateInput input)
        {
            return await _chatSessionsAppService.CreateAsync(input);
        }

        [HttpPost("page")]
        public async Task<PagedResultDto<ChatSessionDto>> PageAsync([FromBody] ChatSessionPageInput input)
        {
            return await _chatSessionsAppService.PageAsync(input);
        }

        [HttpPost("update")]
        public async Task<ChatSessionDto> UpdateAsync([FromBody] ChatSessionUpdateInput input)
        {
            return await _chatSessionsAppService.UpdateAsync(input);
        }
    }
}
