using OpenAuth.Domain.Interface;
namespace OpenAuth.Domain.Service
{
///
/// 权限分配工厂,根据是否是开发者账号创建
///
public class AuthoriseFactory
{
public IUnitWork _unitWork { get; set; }
public AuthoriseService Create(string loginuser)
{
if (loginuser == "System")
{
return new SystemAuthService();
}
else
{
return new AuthoriseService()
{
_unitWork = _unitWork,
User = _unitWork.FindSingle(u =>u.Account == loginuser)
};
}
}
}
}