なろうブックマーク分析用ツールのPrism+WinUI3サンプル実装
Révision | 91b05482e5b7288185c0f453ccfc74c20099b04b |
---|---|
Taille | 1,698 octets |
l'heure | 2023-09-30 19:37:53 |
Auteur | yoshy |
Message de Log | [MOD] プロジェクト間の依存関係、外部パッケージへの依存関係の修正
|
using CleanAuLait.Domain.Service;
using CleanAuLait.UseCase.Interactor;
using CleanAuLait.UseCase.Response;
using TestNarou3.Domain.Boundary.Service;
using TestNarou3.Domain.Model.Entity;
using TestNarou3.UseCase.Boundary.Interactor;
using TestNarou3.UseCase.Boundary.Presenter;
using TestNarou3.UseCase.Request;
using TestNarou3.UseCase.Response;
namespace TestNarou3.UseCase.Interactor
{
internal class NarouLoginInteractor
: AbstractUseCaseInteractor<NarouLoginRequest, NarouLoginResponse>
, INarouLoginInteractor
{
private readonly INarouService narouService;
private readonly IAppConfigService configService;
private readonly INarouLoginPresenter presenter;
public NarouLoginInteractor(
INarouService narouService,
IAppConfigService configService,
INarouLoginPresenter presenter
)
{
this.narouService = narouService;
this.configService = configService;
this.presenter = presenter;
}
public override NarouLoginResponse Interact(NarouLoginRequest req)
{
try
{
this.narouService.Login(req.NarouID, req.Password);
this.configService.Update(new(req.NarouID, req.Password));
BookmarkCategory category = this.narouService.GetBookmarkCategory();
NarouLoginResponse res = new(category);
return presenter.Present(req, res);
}
catch (ServiceException e)
{
return UseCaseResponse.Abort<NarouLoginResponse>(e.Message);
}
}
}
}