using LFlow.Base.Interfaces;
using LFlow.Base.Utils;
using LFlow.OnlineManegement.Model;
using LFlow.OnlineManegement.Service;
using Microsoft.AspNetCore.Mvc;
namespace LFlow.OnlineManegement.Controller;
///
/// 在线用户管理
///
///
public class OnlineManagementController(IOnlineManagementService service) : BaseController
{
///
/// 查询所有在线用户
///
///
///
///
[HttpGet]
public PagedApiResult> ListAll(int pageIndex, int pageSize)
{
int dataTotal = 0;
var result = service.GetAllOnlineUser(pageIndex, pageSize, ref dataTotal);
if (result == null || result.Count == 0)
{
return PagedFail(result, "No data found", 404);
}
return Success(result, dataTotal, pageIndex, pageSize);
}
///
/// 注册在线用户
///
///
///
[HttpPost]
public ApiResult OnlineRegistered(OnlineDto onlineInfo)
{
return Success(service.OnlineRegistered(onlineInfo));
}
}