diff --git a/FAuth/Controllers/api/UserController.cs b/FAuth/Controllers/api/UserController.cs index 0ee1ffc..43edbea 100644 --- a/FAuth/Controllers/api/UserController.cs +++ b/FAuth/Controllers/api/UserController.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using Falcon.Extend; using FAuth.DataBase.Tables; @@ -107,6 +108,26 @@ namespace FAuth.Controllers.api }; } + /// + /// 获取用户信息列表 + /// + /// 用户信息列表 + [HttpGet] + [ProducesResponseType(typeof(IEnumerable),200)] + public IEnumerable GetUsers() { + var key = "FAuth:Users"; + var obj = this.Cache?.GetObj>(key); + if(obj == null) { + obj = this.Db.Users + .Select(m => new UserInfo { + Id = m.Id, + UserName = m.UserName, + }).ToList(); + this.Cache?.SetCache(key,obj,new TimeSpan(0,5,0)); + } + return obj; + } + /// /// 根据提供的登陆票据修改用户密码 ///