ningshuxia
2022-12-12 e81ca048ef4e9345e904b74ffffd3e8413d18a7e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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);
 
        }
 
 
 
 
    }
}