using FHT.Core.Agency.Interfaces; using System.Threading.Tasks; using IO.Swagger.Api; namespace FHT.Agency.Web.CommandServices { public sealed class AccountService : IAccountService { private readonly AccountApiApi _accountApi; public AccountService(AccountApiApi accountApi) { _accountApi = accountApi; string token = new AuthorizationService().Login(); _accountApi.Configuration.AddDefaultHeader("Content-Type", "application/json"); _accountApi.Configuration.AddDefaultHeader("Authorization", string.Format("bearer {0}", token)); } public async Task AgentRegisterClientAccountAsync(string mobile, string realName,int gender, string profession, int industryId, int secondLevelId, bool isMobileUser, string ipAddress, string password) { return await _accountApi.AccountApiAgentRegisterClientAccountAsyncAsync(mobile, realName, gender, profession, industryId, secondLevelId, isMobileUser, ipAddress, password); } public async Task CheckIfAccountExistsAsync(string mobile) { IO.Swagger.Model.BoolViewModel res = await _accountApi.AccountApiCheckIfAccountExistsAsync(mobile); return res.Result; } } }