2024-10-19 08:33:19 +08:00
|
|
|
|
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<List<OnlineDto>> ListAll(int pageIndex, int pageSize)
|
|
|
|
|
|
{
|
|
|
|
|
|
int dataTotal = 0;
|
|
|
|
|
|
var result = service.GetAllOnlineUser(pageIndex, pageSize, ref dataTotal);
|
2024-10-29 14:40:07 +08:00
|
|
|
|
if (result == null || result.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return PagedFail(result, "No data found", 404);
|
|
|
|
|
|
}
|
|
|
|
|
|
return Success(result, dataTotal, pageIndex, pageSize);
|
2024-10-19 08:33:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public ApiResult<OnlineDto> OnlineRegistered(OnlineDto onlineInfo)
|
|
|
|
|
|
{
|
2024-10-29 14:40:07 +08:00
|
|
|
|
return Success(service.OnlineRegistered(onlineInfo));
|
2024-10-19 08:33:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|