using Microsoft.AspNetCore.Mvc;
|
using IStation.Model.Api;
|
using System.Net;
|
using System.Net.Http.Headers;
|
using Microsoft.Extensions.Hosting.Internal;
|
using Microsoft.AspNetCore.Http.Extensions;
|
using IStation.Untity;
|
|
namespace IStation.WebApi.Controllers.V1
|
{
|
/// <summary>
|
/// UserGroup标准Api
|
/// </summary>
|
[ApiController]
|
[Route("v1/Standard/UserLoginLog")]
|
[ApiExplorerSettings(GroupName = "v1")]
|
public class UserLoginLog_StandardController : ControllerBase
|
{
|
private readonly Service.UserLoginLog _service = new Service.UserLoginLog();
|
|
/// <summary>
|
/// 获取用户登录日志
|
/// </summary>
|
[Route("GetUserPageList")]
|
[HttpGet]
|
public Result GetUserPageList(long UserID, DateTime StartTime, DateTime EndTime, int PageIndex, int PageSize)
|
{
|
if (UserID < 1)
|
{
|
return new Result(Code.Error, "UserID 参数错误");
|
}
|
if (StartTime >= EndTime)
|
{
|
return new Result(Code.Error, "StartTime、EndTime 参数错误");
|
}
|
if (PageIndex < 1)
|
{
|
return new Result(Code.Error, "PageIndex 参数错误");
|
}
|
if (PageSize < 1)
|
{
|
return new Result(Code.Error, "PageSize 参数错误");
|
}
|
int total=0;
|
var list = _service.GetUserPageList(UserID, StartTime, EndTime, PageIndex, PageSize, ref total);
|
return new Result_PageList<Model.UserLoginLog>(list, total);
|
|
}
|
|
/// <summary>
|
/// 获取用户登录日志
|
/// </summary>
|
[Route("GetCorpPageList")]
|
[HttpGet]
|
public Result GetCorpPageList(long CorpID, DateTime StartTime, DateTime EndTime, int PageIndex, int PageSize)
|
{
|
if (CorpID < 1)
|
{
|
return new Result(Code.Error, "CorpID 参数错误");
|
}
|
if (StartTime >= EndTime)
|
{
|
return new Result(Code.Error, "StartTime、EndTime 参数错误");
|
}
|
if (PageIndex < 1)
|
{
|
return new Result(Code.Error, "PageIndex 参数错误");
|
}
|
if (PageSize < 1)
|
{
|
return new Result(Code.Error, "PageSize 参数错误");
|
}
|
int total = 0;
|
var list = _service.GetCorpPageList(CorpID, StartTime, EndTime, PageIndex, PageSize, ref total);
|
return new Result_PageList<Model.UserLoginLog>(list, total);
|
|
}
|
|
|
|
|
}
|
}
|