예제 #1
0
        public FootPrintService(long fid,
                                IFootPrintServiceFactory footPrintServiceFactory,
                                IFootPrintRepository footPrintRepository,
                                IRepository <Data.FootPrintImg> footPrintImgRepository,
                                IRepository <Data.FootPrintTag> footPrintTagRepository,
                                FCRMAPI.IPushManager eventPushManager,
                                Project.IProjSourceManager projSourceManager,
                                IStaticResourceManager staticResourceManager

                                )
        {
            ExceptionHelper.ThrowIfNotId(fid, nameof(fid));
            _Fid = fid;
            _FootPrintRepository     = footPrintRepository;
            _FootPrintImgRepository  = footPrintImgRepository;
            _FootPrintTagRepository  = footPrintTagRepository;
            _EventPushManager        = eventPushManager;
            _ProjSourceManager       = projSourceManager;
            _StaticResourceManager   = staticResourceManager;
            _FootPrintServiceFactory = footPrintServiceFactory;

            _LazyEntity = new Lazy <Data.FootPrint>(() =>
            {
                var entity = _FootPrintRepository.Entities.FirstOrDefault(p => p.fid == fid);
                if (entity == null)
                {
                    throw new ExceptionWithErrorCode(ErrorCode.没有找到对应条目);
                }
                return(entity);
            });
        }
예제 #2
0
 public FootPrintManager(
     IFootPrintRepository footPrintRepository,
     IRepository <Data.FootPrintImg> footPrintImgRepository,
     IStaticResourceManager staticResourceManager,
     IRepository <Data.FootPrintTag> footPrintTagRepository,
     Project.IProjSourceManager projSourceManager,
     IUserManager userManager,
     IFootPrintServiceFactory footPrintServiceFactory,
     IUserViewProjFootListRecordRepository userViewProjFootListRecordRepository,
     IUserFavoriteRepository userFavoriteRepository,
     FCRMAPI.IPushManager eventPushManager,
     Docked.IDockedManager dockedManager
     )
 {
     _FootPrintRepository     = footPrintRepository;
     _FootPrintImgRepository  = footPrintImgRepository;
     _StaticResourceManager   = staticResourceManager;
     _FootPrintTagRepository  = footPrintTagRepository;
     _ProjSourceManager       = projSourceManager;
     _FootPrintTagRepository  = footPrintTagRepository;
     _ProjSourceManager       = projSourceManager;
     _UserManager             = userManager;
     _FootPrintServiceFactory = footPrintServiceFactory;
     _UserViewProjFootListRecordRepository = userViewProjFootListRecordRepository;
     _UserFavoriteRepository = userFavoriteRepository;
     _EventPushManager       = eventPushManager;
     _DockedManager          = dockedManager;
 }
예제 #3
0
 public ImportFootPrintManager(
     Tgnet.FootChat.Project.IProjectManager projectManager,
     Tgnet.FootChat.User.UserManager userManager,
     IFootPrintRepository footPrintRepository,
     IFootChatUserRepository footChatUserRepository,
     FCRMAPI.IPushManager pushManager,
     IStaticResourceManager staticResourceManager,
     IUserServiceFactory userServiceFactory,
     Tgnet.Data.IRepository <Data.ImportUserRecord> importUserRecordRepository,
     IRepository <Data.ImportFootPrintRecord> importFootPrintRecordRepository,
     ITagSourceRepository tagSourceRepository,
     IRepository <Data.FootPrintTag> footPrintTagRepository,
     Data.IAddressBookMobileRepository addressBookMobileRepository,
     IFootPrintServiceFactory footPrintServiceFactory)
 {
     _ProjectManager                  = projectManager;
     _UserManager                     = userManager;
     _FootPrintRepository             = footPrintRepository;
     _FootChatUserRepository          = footChatUserRepository;
     _PushManager                     = pushManager;
     _StaticResourceManager           = staticResourceManager;
     _UserServiceFactory              = userServiceFactory;
     _ImportUserRecordRepository      = importUserRecordRepository;
     _ImportFootPrintRecordRepository = importFootPrintRecordRepository;
     _TagSourceRepository             = tagSourceRepository;
     _FootPrintTagRepository          = footPrintTagRepository;
     _AddressBookMobileRepository     = addressBookMobileRepository;
     _FootPrintServiceFactory         = footPrintServiceFactory;
 }
예제 #4
0
 public UserManager(IFootChatUserRepository userRepository,
                    ServiceAgent oAuth2Service,
                    IChannelProviderService <IUserManagerService> userManagerServiceChannelProvider,
                    IChannelProviderService <IUserInfoService> userInfoServiceChannelProvider,
                    IMobileManager mobileManager,
                    IStaticResourceManager staticResourceManager,
                    IUserServiceStateRepository userServiceStateRepository,
                    IRepository <Data.UserViewFootPrintRecord> userViewFootPrintRecordRepository,
                    IRepository <Data.UserBusinessArea> userBusinessAreaRepository,
                    IPushManager pushManager,
                    Tgnet.Data.IRepository <Data.ImportUserRecord> importUserRecordRepository,
                    IRepository <Data.UserProduct> userProductRepository
                    )
 {
     _UserRepository = userRepository;
     _OAuth2Service  = oAuth2Service;
     _MobileManager  = mobileManager;
     _UserInfoServiceChannelProvider    = userInfoServiceChannelProvider;
     _UserManagerServiceChannelProvider = userManagerServiceChannelProvider;
     _StaticResourceManager             = staticResourceManager;
     _UserServiceStateRepository        = userServiceStateRepository;
     _UserViewFootPrintRecordRepository = userViewFootPrintRecordRepository;
     _UserBusinessAreaRepository        = userBusinessAreaRepository;
     _PushManager = pushManager;
     _ImportUserRecordRepository = importUserRecordRepository;
     _UserProductRepository      = userProductRepository;
 }
예제 #5
0
 public ProjFootPrintWithPidStrategy(
     User.IUserService user,
     UpdateFootPrintModel model,
     IFootPrintServiceFactory footPrintServiceFactory,
     IFootPrintRepository footPrintRepository,
     IStaticResourceManager staticResourceManager,
     Project.IProjSourceManager projSourceManager,
     IRepository <Data.FootPrintImg> footPrintImgRepository
     ) : base(user, model, footPrintServiceFactory, footPrintRepository, staticResourceManager, footPrintImgRepository)
 {
     ExceptionHelper.ThrowIfNotId(model.Pid, nameof(model.Pid));
     _Pid = model.Pid.Value;
     _ProjSourceManager = projSourceManager;
 }
예제 #6
0
 public ProjFootPrintWithNameStrategy(
     User.IUserService user,
     UpdateFootPrintModel model,
     IFootPrintServiceFactory footPrintServiceFactory,
     IFootPrintRepository footPrintRepository,
     IStaticResourceManager staticResourceManager,
     Project.IProjSourceManager projSourceManager,
     IRepository <Data.FootPrintImg> footPrintImgRepository
     ) : base(user, model, footPrintServiceFactory, footPrintRepository, staticResourceManager, footPrintImgRepository)
 {
     ExceptionHelper.ThrowIfNullOrWhiteSpace(model.ProjName, nameof(model.ProjName));
     _Name = model.ProjName;
     _ProjSourceManager = projSourceManager;
 }
예제 #7
0
 public FootPrintServiceFactory(
     IFootPrintRepository footPrintRepository,
     IRepository <Data.FootPrintImg> footPrintImgRepository,
     IRepository <Data.FootPrintTag> footPrintTagRepository,
     FCRMAPI.IPushManager eventPushManager,
     Project.IProjSourceManager projSourceManager,
     IStaticResourceManager staticResourceManager
     )
 {
     _FootPrintRepository    = footPrintRepository;
     _FootPrintImgRepository = footPrintImgRepository;
     _FootPrintTagRepository = footPrintTagRepository;
     _EventPushManager       = eventPushManager;
     _ProjSourceManager      = projSourceManager;
     _StaticResourceManager  = staticResourceManager;
 }
예제 #8
0
 public BaseFootPrintStrategy(User.IUserService user,
                              UpdateFootPrintModel model,
                              IFootPrintServiceFactory footPrintServiceFactory,
                              IFootPrintRepository footPrintRepository,
                              IStaticResourceManager staticResourceManager,
                              IRepository <Data.FootPrintImg> footPrintImgRepository
                              )
 {
     ExceptionHelper.ThrowIfNull(user, nameof(user));
     _User    = user;
     _Model   = model;
     _Uid     = user.Uid;
     _Fid     = model.Fid;
     _Address = model.Address;
     _Content = model.Content;
     _Tags    = model.TagId;
     _Image   = model.Images;
     _FootPrintServiceFactory = footPrintServiceFactory;
     _FootPrintRepository     = footPrintRepository;
     _StaticResourceManager   = staticResourceManager;
     _FootPrintImgRepository  = footPrintImgRepository;
 }
예제 #9
0
 private IEnumerable <Tgnet.FootChat.Model.FootImageInfo> ConverImageInfo(Tgnet.FootChat.Model.FootImageInfo[] images, IStaticResourceManager staticResourceManager)
 {
     foreach (var item in images)
     {
         if (item != null && !string.IsNullOrWhiteSpace(item.ImageKey))
         {
             var address = item.Address;
             if (String.IsNullOrWhiteSpace(address) && item.Latitude > 0 && item.Longitude > 0)
             {
                 var info = staticResourceManager.GetAddress(item.Longitude.Value, item.Latitude.Value);
                 if (info != null)
                 {
                     item.Address = info.FormattedAddress;
                 }
             }
         }
         yield return(item);
     }
 }