using FuelServer.Core.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Fuel.Application.Service { public class UserService : IUserService { private readonly EntityHelper _entityHelper; public UserService(EntityHelper entityHelper) { _entityHelper = entityHelper; } public users ValidateCredentials(string username, string password) { return _entityHelper.GetEntitiesAsync(_ => _.Account == username && _.Password == password).Result.FirstOrDefault(); ; } public async Task> GetUserPermissions(string userId) { // 这里是模拟数据,实际应用中应该从数据库或其他来源获取权限信息 return await Task.FromResult(new List { "Admin:Index:GET", "Admin:Edit:POST" // 更多权限... }); } } }