2015-09-22 23:10:00 +08:00
|
|
|
|
using System;
|
2015-09-23 00:10:11 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using OpenAuth.Domain;
|
2015-09-22 23:10:00 +08:00
|
|
|
|
using OpenAuth.Domain.Interface;
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App
|
|
|
|
|
{
|
|
|
|
|
public class LoginApp
|
|
|
|
|
{
|
|
|
|
|
private IUserRepository _repository;
|
|
|
|
|
|
|
|
|
|
public LoginApp(IUserRepository repository)
|
|
|
|
|
{
|
|
|
|
|
_repository = repository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Login(string userName, string password)
|
|
|
|
|
{
|
2015-11-13 21:33:53 +08:00
|
|
|
|
var user = _repository.FindSingle(u =>u.Account ==userName);
|
2015-09-22 23:10:00 +08:00
|
|
|
|
if (user == null)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("<22>û<EFBFBD><C3BB>ʺŲ<CABA><C5B2><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-26 21:58:12 +08:00
|
|
|
|
// user.CheckLogin(password);
|
2015-09-22 23:10:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-04-25 12:31:01 +08:00
|
|
|
|
}
|