Ejemplo n.º 1
0
        public void TestFixtureSetUp()
        {
            Configuration.ConfigWithEmbeddedXml(null, "application_config", Assembly.GetExecutingAssembly(), "Cooper.Sync.Test.ConfigFiles")
                .RenderProperties()
                .Castle(resolver => Resolve(resolver.Container));

            //初始化同步锁
            DependencyResolver.Resolve<ILockHelper>().Init<Account>();
            DependencyResolver.Resolve<ILockHelper>().Init<GoogleConnection>();

            _logger = DependencyResolver.Resolve<ILoggerFactory>().Create(GetType());
            _sessionManager = DependencyResolver.Resolve<ISessionManager>();

            _accountHelper = DependencyResolver.Resolve<IAccountHelper>();
            _accountService = DependencyResolver.Resolve<IAccountService>();
            _accountConnectionService = DependencyResolver.Resolve<IAccountConnectionService>();
            _taskService = DependencyResolver.Resolve<ITaskService>();
            _externalServiceProvider = DependencyResolver.Resolve<IExternalServiceProvider>();
            _googleTokenService = DependencyResolver.Resolve<IGoogleTokenService>();

            _syncProcessor = DependencyResolver.Resolve<IGoogleSyncProcesser>();

            GoogleSyncSettings.ClientIdentifier = "234919028272-gsmmng06nheoih4ajp60oq8s33at1os0.apps.googleusercontent.com";
            GoogleSyncSettings.ClientSecret = "jXcjxFzCQGferMI37I0GSc05";
        }
Ejemplo n.º 2
0
        public void TestFixtureSetUp()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                    , "application_config"
                    , Assembly.GetExecutingAssembly()
                    , "AliCooper.Model.Test.ConfigFiles")
                    .RenderProperties()
                    .Castle(o => this.Resolve(o.Container));

                //初始化同步锁
                DependencyResolver.Resolve<ILockHelper>().Init<Account>();
                DependencyResolver.Resolve<ILockHelper>().Init<GoogleConnection>();

                DependencyResolver.Resolve<ILockHelper>().Init<ArkConnection>();
            }
            catch (InvalidOperationException e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                    Console.WriteLine(e.Message);
            }

            this._log = DependencyResolver.Resolve<ILoggerFactory>().Create(this.GetType());
            this._sessionManager = DependencyResolver.Resolve<Castle.Facilities.NHibernateIntegration.ISessionManager>();

            this._accountHelper = DependencyResolver.Resolve<IAccountHelper>();
            this._accountService = DependencyResolver.Resolve<IAccountService>();
            this._accountConnectionService = DependencyResolver.Resolve<IAccountConnectionService>();
            this._taskService = DependencyResolver.Resolve<ITaskService>();
        }
Ejemplo n.º 3
0
        public void TestFixtureSetUp()
        {
            Configuration.ConfigWithEmbeddedXml(null, "application_config", Assembly.GetExecutingAssembly(), "Cooper.Sync.Test.ConfigFiles")
            .RenderProperties()
            .Castle(resolver => Resolve(resolver.Container));

            //初始化同步锁
            DependencyResolver.Resolve <ILockHelper>().Init <Account>();
            DependencyResolver.Resolve <ILockHelper>().Init <GoogleConnection>();

            _logger         = DependencyResolver.Resolve <ILoggerFactory>().Create(GetType());
            _sessionManager = DependencyResolver.Resolve <ISessionManager>();

            _accountHelper            = DependencyResolver.Resolve <IAccountHelper>();
            _accountService           = DependencyResolver.Resolve <IAccountService>();
            _accountConnectionService = DependencyResolver.Resolve <IAccountConnectionService>();
            _taskService             = DependencyResolver.Resolve <ITaskService>();
            _externalServiceProvider = DependencyResolver.Resolve <IExternalServiceProvider>();
            _googleTokenService      = DependencyResolver.Resolve <IGoogleTokenService>();

            _syncProcessor = DependencyResolver.Resolve <IGoogleSyncProcesser>();

            GoogleSyncSettings.ClientIdentifier = "234919028272-gsmmng06nheoih4ajp60oq8s33at1os0.apps.googleusercontent.com";
            GoogleSyncSettings.ClientSecret     = "jXcjxFzCQGferMI37I0GSc05";
        }
Ejemplo n.º 4
0
 public AccountHelper(ILoggerFactory factory
     , IAccountService accountService
     , IAccountConnectionService connectionService)
 {
     this._log = factory.Create(typeof(AccountHelper));
     this._accountService = accountService;
     this._connectionService = connectionService;
 }
Ejemplo n.º 5
0
 public AccountHelper(ILoggerFactory factory
     , IAccountService accountService
     , IAccountConnectionService connectionService)
     : base(factory
     , accountService
     , connectionService)
 {
 }
Ejemplo n.º 6
0
        public AccountController(ILoggerFactory factory
                                 , IContextService context
                                 , IAccountHelper accountHelper
                                 , IAccountService accountService
                                 , IAccountConnectionService accountConnectionService

                                 , ITeamService teamService

                                 , string sysConfig_versionFlag

                                 , string googleOAuth2Url
                                 , string googleOAuth2TokenUrl
                                 , string googleOAuth2UserUrl
                                 , string googleScope
                                 , string googleClientId
                                 , string googleClientSecret
                                 , string googleClientId_mobi
                                 , string googleClientSecret_mobi

                                 , string gitOAuthUrl
                                 , string gitOAuthTokenUrl
                                 , string gitOAuthUserUrl
                                 , string gitClientId
                                 , string gitClientSecret
                                 , string gitScope)
        {
            this._log                      = factory.Create(typeof(AccountController));
            this._context                  = context;
            this._accountHelper            = accountHelper;
            this._accountService           = accountService;
            this._accountConnectionService = accountConnectionService;

            this._teamService = teamService;

            this._sysConfig_versionFlag = sysConfig_versionFlag;

            this._googleOAuth2Url         = googleOAuth2Url;
            this._googleOAuth2TokenUrl    = googleOAuth2TokenUrl;
            this._googleOAuth2UserUrl     = googleOAuth2UserUrl;
            this._googleScope             = googleScope;
            this._googleClientId          = googleClientId;
            this._googleClientSecret      = googleClientSecret;
            this._googleClientId_mobi     = googleClientId_mobi;
            this._googleClientSecret_mobi = googleClientSecret_mobi;


            this._gitOAuthUrl      = gitOAuthUrl;
            this._gitOAuthTokenUrl = gitOAuthTokenUrl;
            this._gitOAuthUserUrl  = gitOAuthUserUrl;
            this._gitClientId      = gitClientId;
            this._gitClientSecret  = gitClientSecret;
            this._gitScope         = gitScope;
        }
Ejemplo n.º 7
0
 public FetchTaskHelper(IAccountConnectionService connectionService
     , string git_api_issues
     , UserHelper userHelper
     , string ali_api_user
     , string ali_api_tasks
     , Castle.Facilities.NHibernateIntegration.ISessionManager sessionManager)
     : base(connectionService, git_api_issues)
 {
     this._userHelper = userHelper;
     this._sessionManager = sessionManager;
     this._ali_api_tasks = ali_api_tasks;
 }
 public AssociateMemberAccountService(IAccountService accountService,
     IAccountHelper accountHelper,
     IAccountConnectionService accountConnectionService,
     UserHelper userHelper,
     ITeamService teamService,
     ITeamRepository teamRepository,
     ILoggerFactory factory)
 {
     this._accountService = accountService;
     this._accountHelper = accountHelper;
     this._userHelper = userHelper;
     this._accountConnectionService = accountConnectionService;
     this._teamService = teamService;
     this._teamRepository = teamRepository;
     this._logger = factory.Create(typeof(AssociateMemberAccountService));
 }
Ejemplo n.º 9
0
 public PersonalController(ILoggerFactory factory
                           , ITaskService taskService
                           , IPersonalTaskService personalTaskService
                           , ITaskFolderService taskFolderService
                           , IFetchTaskHelper fetchTaskHelper
                           , IAccountService accountService
                           , IAccountConnectionService accountConnectionService)
     : base(factory
            , accountService
            , taskService
            , taskFolderService
            , fetchTaskHelper)
 {
     this._personalTaskService      = personalTaskService;
     this._accountConnectionService = accountConnectionService;
 }
Ejemplo n.º 10
0
 public PersonalController(ILoggerFactory factory
     , ITaskService taskService
     , IPersonalTaskService personalTaskService
     , ITaskFolderService taskFolderService
     , IFetchTaskHelper fetchTaskHelper
     , IAccountService accountService
     , IAccountConnectionService accountConnectionService)
     : base(factory
     , accountService
     , taskService
     , taskFolderService
     , fetchTaskHelper)
 {
     this._personalTaskService = personalTaskService;
     this._accountConnectionService = accountConnectionService;
 }
Ejemplo n.º 11
0
 public TeamController(ILoggerFactory factory
                       , IAccountService accountService
                       , IAccountConnectionService accountConnectionService
                       , ITaskService taskService
                       , ITaskFolderService taskFolderService
                       , IFetchTaskHelper fetchTaskHelper
                       , Teams.ITeamService teamService
                       , Teams.ITaskService teamTaskService)
     : base(factory
            , accountService
            , taskService
            , taskFolderService
            , fetchTaskHelper)
 {
     this._accountConnectionService = accountConnectionService;
     this._teamService     = teamService;
     this._teamTaskService = teamTaskService;
 }
Ejemplo n.º 12
0
        public void TestFixtureSetUp()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                                                                   , "application_config"
                                                                   , Assembly.GetExecutingAssembly()
                                                                   , "Cooper.Model.Test.ConfigFiles")
                .RenderProperties()
                .Castle(o => this.Resolve(o.Container));

                //初始化同步锁
                DependencyResolver.Resolve <ILockHelper>().Init <Account>();
                DependencyResolver.Resolve <ILockHelper>().Init <GoogleConnection>();
                DependencyResolver.Resolve <ILockHelper>().Init <GitHubConnection>();
                DependencyResolver.Resolve <ILockHelper>().Init <Member>();
            }
            catch (Exception e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                {
                    Console.WriteLine(e.Message);
                    throw e;
                }
            }

            this._log            = DependencyResolver.Resolve <ILoggerFactory>().Create(this.GetType());
            this._sessionManager = DependencyResolver.Resolve <Castle.Facilities.NHibernateIntegration.ISessionManager>();

            this._accountHelper            = DependencyResolver.Resolve <IAccountHelper>();
            this._accountService           = DependencyResolver.Resolve <IAccountService>();
            this._accountConnectionService = DependencyResolver.Resolve <IAccountConnectionService>();
            this._taskService         = DependencyResolver.Resolve <Cooper.Model.Tasks.ITaskService>();
            this._taskFolderService   = DependencyResolver.Resolve <ITaskFolderService>();
            this._addressBookService  = DependencyResolver.Resolve <IAddressBookService>();
            this._contactGroupService = DependencyResolver.Resolve <IContactGroupService>();
            this._contactService      = DependencyResolver.Resolve <IContactService>();
            this._teamService         = DependencyResolver.Resolve <ITeamService>();
            this._personalTaskService = DependencyResolver.Resolve <Cooper.Model.Tasks.IPersonalTaskService>();
            this._teamTaskService     = DependencyResolver.Resolve <Cooper.Model.Teams.ITaskService>();
        }
Ejemplo n.º 13
0
 public GoogleSyncProcesser(
     ILockHelper lockHelper,
     ILoggerFactory loggerFactory,
     ISessionManager sessionManager,
     IAccountHelper accountHelper,
     IAccountService accountService,
     IAccountConnectionService accountConnectionService,
     ITaskService taskService,
     IExternalServiceProvider externalServiceProvider,
     IGoogleTokenService googleTokenService,
     IGoogleTaskSyncService googleTaskSyncService,
     IGoogleCalendarEventSyncService googleCalendarEventSyncService,
     IGoogleContactSyncService googleContactSyncService)
     : base(lockHelper, loggerFactory, sessionManager, accountHelper, accountService, accountConnectionService, taskService, externalServiceProvider)
 {
     lockHelper.Init<GoogleConnection>();
     _googleTokenService = googleTokenService;
     _googleTaskSyncService = googleTaskSyncService;
     _googleCalendarEventSyncService = googleCalendarEventSyncService;
     _googleContactSyncService = googleContactSyncService;
 }
Ejemplo n.º 14
0
        public TeamController(ILoggerFactory factory
            , IAccountService accountService
            , IAccountConnectionService accountConnectionService
            , ITaskService taskService
            , ITaskFolderService taskFolderService
            , IFetchTaskHelper fetchTaskHelper
            , Teams.ITeamService teamService
            , Teams.ITaskService teamTaskService

            , UserHelper userHelper)
            : base(factory
            , accountService
            , accountConnectionService
            , taskService
            , taskFolderService
            , fetchTaskHelper
            , teamService
            , teamTaskService)
        {
            this._userHelper = userHelper;
        }
Ejemplo n.º 15
0
 public GoogleSyncProcesser(
     ILockHelper lockHelper,
     ILoggerFactory loggerFactory,
     ISessionManager sessionManager,
     IAccountHelper accountHelper,
     IAccountService accountService,
     IAccountConnectionService accountConnectionService,
     ITaskService taskService,
     IExternalServiceProvider externalServiceProvider,
     IGoogleTokenService googleTokenService,
     IGoogleTaskSyncService googleTaskSyncService,
     IGoogleCalendarEventSyncService googleCalendarEventSyncService,
     IGoogleContactSyncService googleContactSyncService)
     : base(lockHelper, loggerFactory, sessionManager, accountHelper, accountService, accountConnectionService, taskService, externalServiceProvider)
 {
     lockHelper.Init <GoogleConnection>();
     _googleTokenService             = googleTokenService;
     _googleTaskSyncService          = googleTaskSyncService;
     _googleCalendarEventSyncService = googleCalendarEventSyncService;
     _googleContactSyncService       = googleContactSyncService;
 }
Ejemplo n.º 16
0
        public void TestFixtureSetUp()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                    , "application_config"
                    , Assembly.GetExecutingAssembly()
                    , "Cooper.Model.Test.ConfigFiles")
                    .RenderProperties()
                    .Castle(o => this.Resolve(o.Container));

                //初始化同步锁
                DependencyResolver.Resolve<ILockHelper>().Init<Account>();
                DependencyResolver.Resolve<ILockHelper>().Init<GoogleConnection>();
                DependencyResolver.Resolve<ILockHelper>().Init<GitHubConnection>();
                DependencyResolver.Resolve<ILockHelper>().Init<Member>();
            }
            catch (Exception e)
            {
                if (!e.Message.Contains("不可重复初始化配置")){
                    Console.WriteLine(e.Message);
                    throw e;
                }
            }

            this._log = DependencyResolver.Resolve<ILoggerFactory>().Create(this.GetType());
            this._sessionManager = DependencyResolver.Resolve<Castle.Facilities.NHibernateIntegration.ISessionManager>();

            this._accountHelper = DependencyResolver.Resolve<IAccountHelper>();
            this._accountService = DependencyResolver.Resolve<IAccountService>();
            this._accountConnectionService = DependencyResolver.Resolve<IAccountConnectionService>();
            this._taskService = DependencyResolver.Resolve<Cooper.Model.Tasks.ITaskService>();
            this._taskFolderService = DependencyResolver.Resolve<ITaskFolderService>();
            this._addressBookService = DependencyResolver.Resolve<IAddressBookService>();
            this._contactGroupService = DependencyResolver.Resolve<IContactGroupService>();
            this._contactService = DependencyResolver.Resolve<IContactService>();
            this._teamService = DependencyResolver.Resolve<ITeamService>();
            this._personalTaskService = DependencyResolver.Resolve<Cooper.Model.Tasks.IPersonalTaskService>();
            this._teamTaskService = DependencyResolver.Resolve<Cooper.Model.Teams.ITaskService>();
        }
Ejemplo n.º 17
0
        public SyncProcesser(
            ILockHelper lockHelper,
            ILoggerFactory loggerFactory,
            ISessionManager sessionManager,
            IAccountHelper accountHelper,
            IAccountService accountService,
            IAccountConnectionService accountConnectionService,
            ITaskService taskService,
            IExternalServiceProvider externalServiceProvider
            )
        {
            //初始化同步锁
            lockHelper.Init <Account>();

            _logger                   = loggerFactory.Create(GetType());
            _sessionManager           = sessionManager;
            _accountHelper            = accountHelper;
            _accountService           = accountService;
            _accountConnectionService = accountConnectionService;
            _taskService              = taskService;
            _externalServiceProvider  = externalServiceProvider;
        }
Ejemplo n.º 18
0
        public void TestFixtureSetUp()
        {
            Configuration.ConfigWithEmbeddedXml(null, "application_config", Assembly.GetExecutingAssembly(), "AliCooper.Sync.Test.ConfigFiles")
                .RenderProperties()
                .Castle(resolver => Resolve(resolver.Container));

            //初始化同步锁
            DependencyResolver.Resolve<ILockHelper>().Init<Account>();
            DependencyResolver.Resolve<ILockHelper>().Init<ArkConnection>();
            DependencyResolver.Resolve<ILockHelper>().Init<AliyunMailConnection>();

            _logger = DependencyResolver.Resolve<ILoggerFactory>().Create(GetType());
            _sessionManager = DependencyResolver.Resolve<ISessionManager>();

            _accountHelper = DependencyResolver.Resolve<IAccountHelper>();
            _accountService = DependencyResolver.Resolve<IAccountService>();
            _accountConnectionService = DependencyResolver.Resolve<IAccountConnectionService>();
            _taskService = DependencyResolver.Resolve<ITaskService>();
            _microsoftExchangeServiceProvider = DependencyResolver.Resolve<IMicrosoftExchangeServiceProvider>();
            _aliyunDao = DependencyResolver.Resolve<IAliyunDao>();

            _syncProcessor = new SyncProcesser(_exchangeServer, _aliyunDao);
        }
Ejemplo n.º 19
0
 public FetchTaskHelper(IAccountConnectionService connectionService, string git_api_issues)
 {
     this._connectionService = connectionService;
     this._git_api_issues    = git_api_issues;
 }
Ejemplo n.º 20
0
 public FetchTaskHelper(IAccountConnectionService connectionService, string git_api_issues)
 {
     this._connectionService = connectionService;
     this._git_api_issues = git_api_issues;
 }
Ejemplo n.º 21
0
        public AccountController(ILoggerFactory factory
            , IContextService context
            , IAccountHelper accountHelper
            , IAccountService accountService
            , IAccountConnectionService accountConnectionService

            , ITeamService teamService

            , string sysConfig_versionFlag

            , string googleOAuth2Url
            , string googleOAuth2TokenUrl
            , string googleOAuth2UserUrl
            , string googleScope
            , string googleClientId
            , string googleClientSecret
            , string googleClientId_mobi
            , string googleClientSecret_mobi

            , string gitOAuthUrl
            , string gitOAuthTokenUrl
            , string gitOAuthUserUrl
            , string gitClientId
            , string gitClientSecret
            , string gitScope

            , string arkOAuth2Url
            , string arkOAuth2UserUrl
            , string arkOAuth2Enable

            , UserHelper userHelper)
            : base(factory
            , context
            , accountHelper
            , accountService
            , accountConnectionService

            , teamService

            , sysConfig_versionFlag

            , googleOAuth2Url
            , googleOAuth2TokenUrl
            , googleOAuth2UserUrl
            , googleScope
            , googleClientId
            , googleClientSecret
            , googleClientId_mobi
            , googleClientSecret_mobi

            , gitOAuthUrl
            , gitOAuthTokenUrl
            , gitOAuthUserUrl
            , gitClientId
            , gitClientSecret
            , gitScope)
        {
            this._arkOAuth2Url = arkOAuth2Url;
            this._arkOAuth2UserUrl = arkOAuth2UserUrl;
            this._arkOAuth2Enable = Convert.ToBoolean(arkOAuth2Enable);

            this._userHelper = userHelper;
        }
Ejemplo n.º 22
0
 public PersonalController(ILoggerFactory factory
     , ITaskService taskService
     , ITasklistService tasklistService
     , IAccountService accountService
     , IAccountConnectionService accountConnectionService
     , IFetchTasklistHelper fetchTasklistHelper)
     : base(factory)
 {
     this._log = factory.Create(typeof(PersonalController));
     this._taskService = taskService;
     this._tasklistService = tasklistService;
     this._accountService = accountService;
     this._accountConnectionService = accountConnectionService;
     this._fetchTasklistHelper = fetchTasklistHelper;
 }