├── .gitignore ├── LICENSE ├── apple-auto-acquisition ├── apple-auto-acquisition-socket │ ├── pom.xml │ └── src │ │ └── main │ │ ├── assembly │ │ ├── assembly.xml │ │ ├── bin │ │ │ ├── dump.sh │ │ │ ├── restart.sh │ │ │ ├── server.sh │ │ │ ├── start.sh │ │ │ └── stop.sh │ │ └── conf │ │ │ ├── log4j.properties │ │ │ └── system.properties │ │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── acquisition │ │ │ └── socket │ │ │ ├── admin │ │ │ └── action │ │ │ │ └── SessionAction.java │ │ │ ├── api │ │ │ └── action │ │ │ │ └── MessageAction.java │ │ │ ├── handler │ │ │ ├── JourneyHandler.java │ │ │ └── LocationHandler.java │ │ │ └── session │ │ │ ├── ClusterSessionManager.java │ │ │ └── HazelcastInstanceFactoryBean.java │ │ ├── resources │ │ ├── config │ │ │ ├── spring-cim.xml │ │ │ └── spring-jms.xml │ │ ├── log4j.properties │ │ ├── struts.xml │ │ └── system.properties │ │ └── webapp │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── console │ │ ├── header.jsp │ │ ├── index.jsp │ │ ├── nav.jsp │ │ └── session │ │ │ └── manage.jsp │ │ ├── index.jsp │ │ └── resource │ │ ├── bootstrap-3.3.6-dist │ │ ├── css │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── css │ │ ├── base-ui.css │ │ ├── dialog.css │ │ ├── login.css │ │ ├── main-layout.css │ │ ├── table.css │ │ └── webbase.css │ │ ├── img │ │ ├── icon.png │ │ ├── icon_loading_small.gif │ │ └── pattern.png │ │ └── js │ │ ├── framework.js │ │ └── jquery-2.2.3.min.js ├── apple-auto-acquisition-vvsmart │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── bin │ │ │ │ ├── dump.sh │ │ │ │ ├── restart.sh │ │ │ │ ├── server.sh │ │ │ │ ├── start.sh │ │ │ │ └── stop.sh │ │ │ └── conf │ │ │ │ ├── log4j.properties │ │ │ │ └── system.properties │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── acquisition │ │ │ │ └── vvsmart │ │ │ │ ├── consumer │ │ │ │ └── LocationMessageConsumer.java │ │ │ │ ├── model │ │ │ │ ├── JsonResult.java │ │ │ │ └── JsonTrack.java │ │ │ │ └── utils │ │ │ │ ├── DateFormatUtil.java │ │ │ │ └── LocationConversion.java │ │ └── resoureces │ │ │ └── config │ │ │ ├── spring-context.xml │ │ │ ├── spring-jms.xml │ │ │ └── spring-websocket.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── acquisition │ │ │ └── vvsmart │ │ │ └── AppTest.java │ │ └── resources │ │ ├── log4j.properties │ │ └── system.properties └── pom.xml ├── apple-auto-bean ├── apple-auto-bean-core │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── appleframework │ │ └── auto │ │ └── bean │ │ └── core │ │ └── Protobufable.java ├── apple-auto-bean-fence │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── appleframework │ │ └── auto │ │ ├── bean │ │ └── fence │ │ │ ├── BaseFence.java │ │ │ ├── CircleFence.java │ │ │ ├── Fence.java │ │ │ ├── FenceResult.java │ │ │ ├── Point.java │ │ │ ├── PolygonFence.java │ │ │ ├── RectangleFence.java │ │ │ └── SyncOperate.java │ │ └── entity │ │ └── fence │ │ ├── FenceEntity.java │ │ └── FenceEntityWithBLOBs.java ├── apple-auto-bean-location │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── appleframework │ │ └── auto │ │ └── bean │ │ └── location │ │ ├── Journey.java │ │ └── Location.java └── pom.xml ├── apple-auto-calculate ├── apple-auto-calculate-fence │ ├── apple-auto-calculate-fence-local │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── assembly │ │ │ │ ├── assembly.xml │ │ │ │ ├── bin │ │ │ │ │ ├── dump.sh │ │ │ │ │ ├── restart.sh │ │ │ │ │ ├── server.sh │ │ │ │ │ ├── start.sh │ │ │ │ │ └── stop.sh │ │ │ │ └── conf │ │ │ │ │ ├── log4j.properties │ │ │ │ │ └── system.properties │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── appleframework │ │ │ │ │ └── auto │ │ │ │ │ └── calculate │ │ │ │ │ └── fence │ │ │ │ │ ├── consumer │ │ │ │ │ ├── FenceConsumer.java │ │ │ │ │ └── LocationConsumer.java │ │ │ │ │ ├── model │ │ │ │ │ ├── FenceEvent.java │ │ │ │ │ └── FenceLocation.java │ │ │ │ │ └── service │ │ │ │ │ ├── FenceInfoService.java │ │ │ │ │ └── impl │ │ │ │ │ ├── FenceCacheService.java │ │ │ │ │ ├── FenceCalculateService.java │ │ │ │ │ ├── FenceInfoServiceImpl.java │ │ │ │ │ ├── FenceInoutService.java │ │ │ │ │ ├── FenceLocationService.java │ │ │ │ │ └── FenceNotifyService.java │ │ │ └── resources │ │ │ │ └── config │ │ │ │ ├── spring-cache.xml │ │ │ │ ├── spring-event.xml │ │ │ │ └── spring-jms.xml │ │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── calculate │ │ │ │ └── fence │ │ │ │ └── AppTest.java │ │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── system.properties │ ├── apple-auto-calculate-fence-storm │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── bin │ │ │ │ ├── dump.sh │ │ │ │ ├── restart.sh │ │ │ │ ├── server.sh │ │ │ │ ├── start.sh │ │ │ │ └── stop.sh │ │ │ └── conf │ │ │ │ ├── log4j.properties │ │ │ │ └── system.properties │ │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── fence │ │ │ │ └── calculate │ │ │ │ ├── BaseFenceCalculateBolt.java │ │ │ │ ├── BaseFenceCalculateRTreeBolt.java │ │ │ │ ├── BaseFenceInoutBolt.java │ │ │ │ ├── BaseFenceNotifyBolt.java │ │ │ │ ├── FenceCalculateBolt.java │ │ │ │ ├── FenceInoutBolt.java │ │ │ │ ├── FenceNotifyBolt.java │ │ │ │ ├── KafkaSpout.java │ │ │ │ ├── KafkaTopology.java │ │ │ │ ├── config │ │ │ │ └── StormConfigurer.java │ │ │ │ ├── factory │ │ │ │ └── RedisFactory.java │ │ │ │ ├── model │ │ │ │ └── FenceLocation.java │ │ │ │ └── utils │ │ │ │ ├── ByteUtils.java │ │ │ │ └── Constants.java │ │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── system.properties │ └── pom.xml ├── apple-auto-calculate-notify │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── bin │ │ │ │ ├── dump.sh │ │ │ │ ├── restart.sh │ │ │ │ ├── server.sh │ │ │ │ ├── start.sh │ │ │ │ └── stop.sh │ │ │ └── conf │ │ │ │ ├── log4j.properties │ │ │ │ └── system.properties │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── calculate │ │ │ │ └── notify │ │ │ │ ├── consumer │ │ │ │ └── FenceResultConsumer.java │ │ │ │ └── service │ │ │ │ └── impl │ │ │ │ ├── FenceCacheService.java │ │ │ │ └── NotifyCimService.java │ │ └── resources │ │ │ └── config │ │ │ ├── spring-cache.xml │ │ │ └── spring-jms.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── calculate │ │ │ └── notify │ │ │ └── AppTest.java │ │ └── resources │ │ ├── log4j.properties │ │ └── system.properties └── pom.xml ├── apple-auto-open-platform ├── pom.xml └── src │ ├── main │ ├── assembly │ │ ├── assembly.xml │ │ ├── bin │ │ │ ├── dump.sh │ │ │ ├── restart.sh │ │ │ ├── server.sh │ │ │ ├── start.sh │ │ │ └── stop.sh │ │ ├── conf │ │ │ ├── log4j.properties │ │ │ └── system.properties │ │ └── lib │ │ │ ├── activation.jar │ │ │ ├── jaxb-api.jar │ │ │ ├── jaxb1-impl.jar │ │ │ └── jsr173_1.0_api.jar │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── open │ │ │ └── platform │ │ │ ├── controller │ │ │ ├── FenceInfoController.java │ │ │ └── LocationController.java │ │ │ ├── manager │ │ │ ├── SampleAppSecretManager.java │ │ │ └── SampleSessionManager.java │ │ │ ├── request │ │ │ ├── CircleFenceCreateRequest.java │ │ │ ├── LocationListRequest.java │ │ │ └── LocationSearchRequest.java │ │ │ └── response │ │ │ ├── AccessTokenResponse.java │ │ │ ├── ErrorCodeResponse.java │ │ │ ├── ErrorResponse.java │ │ │ ├── IsSuccessResponse.java │ │ │ ├── LocationSearchResponse.java │ │ │ ├── ServiceExceptionResponse.java │ │ │ ├── ServiceUnavailableErrorResponse.java │ │ │ └── TokenErrorResponse.java │ ├── resources │ │ ├── config │ │ │ ├── applicationContext-context.xml │ │ │ ├── applicationContext-dubbo.xml │ │ │ └── applicationContext-rop.xml │ │ ├── i18n │ │ │ └── rop │ │ │ │ └── open-platform_zh_CN.properties │ │ ├── log4j.properties │ │ └── system.properties │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── index.jsp │ │ └── location_search.jsp │ └── test │ └── resources │ ├── log4j.properties │ └── system.properties ├── apple-auto-partner-platform ├── pom.xml └── src │ ├── main │ ├── assembly │ │ ├── assembly.xml │ │ ├── bin │ │ │ ├── dump.sh │ │ │ ├── restart.sh │ │ │ ├── server.sh │ │ │ ├── start.sh │ │ │ └── stop.sh │ │ └── conf │ │ │ ├── log4j.properties │ │ │ └── system.properties │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── partner │ │ │ └── platform │ │ │ └── web │ │ │ ├── FenceController.java │ │ │ ├── JouneryController.java │ │ │ └── LocationController.java │ ├── resources │ │ ├── config │ │ │ ├── service │ │ │ │ ├── applicationContext-context.xml │ │ │ │ ├── applicationContext-dubbo.xml │ │ │ │ └── applicationContext-mvc.xml │ │ │ └── web │ │ │ │ ├── resources.xml │ │ │ │ └── spring-servlet.xml │ │ ├── log4j.properties │ │ └── system.properties │ └── webapp │ │ ├── WEB-INF │ │ ├── content │ │ │ ├── commons │ │ │ │ ├── error.ftl │ │ │ │ ├── error_ajax.ftl │ │ │ │ ├── page_bottom.ftl │ │ │ │ ├── page_css.ftl │ │ │ │ ├── page_header.ftl │ │ │ │ ├── page_js.ftl │ │ │ │ ├── page_modal.ftl │ │ │ │ ├── pager.ftl │ │ │ │ ├── success.ftl │ │ │ │ └── success_ajax.ftl │ │ │ ├── fence │ │ │ │ ├── add.ftl │ │ │ │ ├── edit.ftl │ │ │ │ ├── list.ftl │ │ │ │ ├── map.ftl │ │ │ │ └── show.ftl │ │ │ ├── journey │ │ │ │ └── list.ftl │ │ │ └── location │ │ │ │ └── show.ftl │ │ └── web.xml │ │ └── static │ │ ├── error │ │ └── 404.html │ │ ├── flat_ui │ │ ├── css │ │ │ ├── flat-ui.css │ │ │ ├── flat-ui.css.map │ │ │ ├── flat-ui.min.css │ │ │ └── vendor │ │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons │ │ │ │ ├── flat-ui-icons-regular.eot │ │ │ │ ├── flat-ui-icons-regular.svg │ │ │ │ ├── flat-ui-icons-regular.ttf │ │ │ │ ├── flat-ui-icons-regular.woff │ │ │ │ └── selection.json │ │ │ └── lato │ │ │ │ ├── lato-black.eot │ │ │ │ ├── lato-black.svg │ │ │ │ ├── lato-black.ttf │ │ │ │ ├── lato-black.woff │ │ │ │ ├── lato-bold.eot │ │ │ │ ├── lato-bold.svg │ │ │ │ ├── lato-bold.ttf │ │ │ │ ├── lato-bold.woff │ │ │ │ ├── lato-bolditalic.eot │ │ │ │ ├── lato-bolditalic.svg │ │ │ │ ├── lato-bolditalic.ttf │ │ │ │ ├── lato-bolditalic.woff │ │ │ │ ├── lato-italic.eot │ │ │ │ ├── lato-italic.svg │ │ │ │ ├── lato-italic.ttf │ │ │ │ ├── lato-italic.woff │ │ │ │ ├── lato-light.eot │ │ │ │ ├── lato-light.svg │ │ │ │ ├── lato-light.ttf │ │ │ │ ├── lato-light.woff │ │ │ │ ├── lato-regular.eot │ │ │ │ ├── lato-regular.svg │ │ │ │ ├── lato-regular.ttf │ │ │ │ └── lato-regular.woff │ │ ├── img │ │ │ ├── favicon.ico │ │ │ ├── icons │ │ │ │ ├── png │ │ │ │ │ ├── Book.png │ │ │ │ │ ├── Calendar.png │ │ │ │ │ ├── Chat.png │ │ │ │ │ ├── Clipboard.png │ │ │ │ │ ├── Compas.png │ │ │ │ │ ├── Gift-Box.png │ │ │ │ │ ├── Infinity-Loop.png │ │ │ │ │ ├── Mail.png │ │ │ │ │ ├── Map.png │ │ │ │ │ ├── Pensils.png │ │ │ │ │ ├── Pocket.png │ │ │ │ │ ├── Retina-Ready.png │ │ │ │ │ ├── Toilet-Paper.png │ │ │ │ │ └── Watches.png │ │ │ │ └── svg │ │ │ │ │ ├── book.svg │ │ │ │ │ ├── calendar.svg │ │ │ │ │ ├── chat.svg │ │ │ │ │ ├── clipboard.svg │ │ │ │ │ ├── clocks.svg │ │ │ │ │ ├── compas.svg │ │ │ │ │ ├── gift-box.svg │ │ │ │ │ ├── loop.svg │ │ │ │ │ ├── mail.svg │ │ │ │ │ ├── map.svg │ │ │ │ │ ├── paper-bag.svg │ │ │ │ │ ├── pencils.svg │ │ │ │ │ ├── retina.svg │ │ │ │ │ ├── ribbon.svg │ │ │ │ │ └── toilet-paper.svg │ │ │ ├── login │ │ │ │ ├── icon.png │ │ │ │ ├── imac-2x.png │ │ │ │ └── imac.png │ │ │ └── tile │ │ │ │ ├── ribbon-2x.png │ │ │ │ └── ribbon.png │ │ └── js │ │ │ ├── flat-ui.js │ │ │ ├── flat-ui.min.js │ │ │ └── vendor │ │ │ ├── html5shiv.js │ │ │ ├── jquery.min.js │ │ │ ├── jquery.min.map │ │ │ ├── respond.min.js │ │ │ ├── video-js.swf │ │ │ └── video.js │ │ ├── flat_ui_icon.html │ │ ├── images │ │ ├── loading_64.gif │ │ ├── qiuchang8_qrcode.jpg │ │ └── wechat.jpg │ │ └── js │ │ ├── echarts │ │ ├── chart │ │ │ ├── bar.js │ │ │ ├── chord.js │ │ │ ├── eventRiver.js │ │ │ ├── force.js │ │ │ ├── funnel.js │ │ │ ├── gauge.js │ │ │ ├── k.js │ │ │ ├── line.js │ │ │ ├── pie.js │ │ │ ├── radar.js │ │ │ └── scatter.js │ │ ├── echarts.js │ │ └── version │ │ └── heart_beat.js │ └── test │ └── java │ └── com │ └── appleframework │ └── auto │ └── partner │ └── platform │ └── AppTest.java ├── apple-auto-service ├── apple-auto-service-common │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── appleframework │ │ └── auto │ │ ├── model │ │ └── fence │ │ │ └── FenceSo.java │ │ └── service │ │ ├── fence │ │ ├── FenceEntityService.java │ │ └── FenceInfoService.java │ │ ├── journey │ │ └── JourneySearchService.java │ │ └── location │ │ ├── LocationNewestService.java │ │ └── LocationSearchService.java ├── apple-auto-service-provider │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── bin │ │ │ │ ├── dump.sh │ │ │ │ ├── restart.sh │ │ │ │ ├── server.sh │ │ │ │ ├── start.sh │ │ │ │ └── stop.sh │ │ │ └── conf │ │ │ │ ├── log4j.properties │ │ │ │ └── system.properties │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── service │ │ │ │ ├── dao │ │ │ │ └── FenceEntityDao.java │ │ │ │ ├── fence │ │ │ │ ├── FenceCacheService.java │ │ │ │ ├── FenceInfoCacheInitService.java │ │ │ │ └── impl │ │ │ │ │ ├── FenceCacheServiceImpl.java │ │ │ │ │ ├── FenceEntityServiceImpl.java │ │ │ │ │ └── FenceInfoServiceImpl.java │ │ │ │ ├── interceptor │ │ │ │ └── FenceEntityInterceptor.java │ │ │ │ ├── journey │ │ │ │ ├── JourneySearchServiceImpl.java │ │ │ │ └── key │ │ │ │ │ └── JourneyRowkey.java │ │ │ │ ├── location │ │ │ │ ├── LocationNewestServiceImpl.java │ │ │ │ ├── LocationSearchServiceImpl.java │ │ │ │ └── key │ │ │ │ │ └── LocationRowkey.java │ │ │ │ ├── mapper │ │ │ │ ├── FenceEntityMapper.java │ │ │ │ └── FenceExtendMapper.java │ │ │ │ └── utils │ │ │ │ ├── Constants.java │ │ │ │ ├── ListUtil.java │ │ │ │ ├── PoiUtils.java │ │ │ │ └── StringUtils.java │ │ └── resources │ │ │ ├── config │ │ │ ├── spring-cache.xml │ │ │ ├── spring-context.xml │ │ │ ├── spring-datasource.xml │ │ │ ├── spring-dubbo.xml │ │ │ └── spring-hbase.xml │ │ │ ├── hbase │ │ │ ├── hbase-journey.xml │ │ │ └── hbase-location.xml │ │ │ └── mapper │ │ │ ├── FenceEntityMapper.xml │ │ │ └── FenceExtendMapper.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── service │ │ │ ├── AppTest.java │ │ │ ├── fence │ │ │ ├── FenceCalculateServiceTest.java │ │ │ └── FenceEntityServiceTest.java │ │ │ ├── journey │ │ │ └── JourneySearchServiceTest.java │ │ │ └── location │ │ │ ├── LocationNewestServiceTest.java │ │ │ └── LocationSearchServiceTest.java │ │ └── resources │ │ ├── log4j.properties │ │ └── system.properties └── pom.xml ├── apple-auto-storager ├── apple-auto-storager-journey │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── bin │ │ │ │ ├── dump.sh │ │ │ │ ├── restart.sh │ │ │ │ ├── server.sh │ │ │ │ ├── start.sh │ │ │ │ └── stop.sh │ │ │ └── conf │ │ │ │ ├── log4j.properties │ │ │ │ └── system.properties │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── storager │ │ │ │ └── journey │ │ │ │ ├── consumer │ │ │ │ └── JourneyConsumer.java │ │ │ │ ├── key │ │ │ │ └── JourneyRowkey.java │ │ │ │ ├── service │ │ │ │ ├── HbaseJourneyService.java │ │ │ │ └── impl │ │ │ │ │ └── HbaseJourneyServiceImpl.java │ │ │ │ └── utils │ │ │ │ └── StringUtils.java │ │ └── resources │ │ │ ├── config │ │ │ ├── spring-hbase.xml │ │ │ └── spring-jms.xml │ │ │ └── hbase │ │ │ └── hbase-journey.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── storager │ │ │ └── Journey │ │ │ ├── AppTest.java │ │ │ └── HbaseJourneyServiceTest.java │ │ └── resources │ │ ├── config │ │ └── spring-producer.xml │ │ ├── log4j.properties │ │ └── system.properties ├── apple-auto-storager-location │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── bin │ │ │ │ ├── dump.sh │ │ │ │ ├── restart.sh │ │ │ │ ├── server.sh │ │ │ │ ├── start.sh │ │ │ │ └── stop.sh │ │ │ └── conf │ │ │ │ ├── log4j.properties │ │ │ │ └── system.properties │ │ ├── java │ │ │ └── com │ │ │ │ └── appleframework │ │ │ │ └── auto │ │ │ │ └── storager │ │ │ │ └── location │ │ │ │ ├── consumer │ │ │ │ └── LocationConsumer.java │ │ │ │ ├── key │ │ │ │ └── LocationRowkey.java │ │ │ │ ├── service │ │ │ │ ├── HbaseLocationService.java │ │ │ │ ├── NewestLocationService.java │ │ │ │ └── impl │ │ │ │ │ ├── HbaseLocationServiceImpl.java │ │ │ │ │ └── NewestLocationServiceImpl.java │ │ │ │ └── utils │ │ │ │ └── StringUtils.java │ │ └── resources │ │ │ ├── config │ │ │ ├── spring-cache.xml │ │ │ ├── spring-hbase.xml │ │ │ └── spring-jms.xml │ │ │ └── hbase │ │ │ └── hbase-location.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── appleframework │ │ │ └── auto │ │ │ └── storager │ │ │ └── location │ │ │ ├── AppTest.java │ │ │ ├── HbaseLocationServiceTest.java │ │ │ └── PlaybackLocationServiceTest.java │ │ └── resources │ │ ├── config │ │ └── spring-producer.xml │ │ ├── log4j.properties │ │ └── system.properties └── pom.xml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.classpath 3 | *.project 4 | target 5 | /target 6 | /target/ 7 | .settings 8 | /.settings 9 | /.settings/ 10 | */logs/* 11 | *.log 12 | */*/*/logs 13 | */*/*/dependency-reduced-pom.xml -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | 10 | src/main/assembly/bin/ 11 | bin 12 | 0755 13 | 14 | 15 | src/main/assembly/conf/ 16 | conf 17 | 18 | 19 | src/main/webapp 20 | webapp 21 | 0644 22 | 23 | 24 | 25 | 26 | lib 27 | 28 | 29 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-socket] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/acquisition-socket/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-socket] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-acquisition-socket 2 | application.version=2.0.0 3 | 4 | jmx.port=2001 5 | web.port=8001 6 | web.context=/ 7 | 8 | service.port=9001 9 | 10 | #test dev beta realse 11 | deploy.dataId=acquisition-socket 12 | deploy.group=apple-auto 13 | deploy.env=dev 14 | 15 | hazelcast.members=127.0.0.1 16 | 17 | metadata.broker.list=118.178.252.65:9092 18 | producer.topic.location=location_v1 19 | producer.topic.journey=journey_v1 -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/resources/config/spring-jms.xml: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 9 | 10 | 11 | kafka.serializer.DefaultEncoder 12 | ${metadata.broker.list} 13 | async 14 | 1 15 | com.appleframework.jms.kafka.partitions.SimplePartitioner 16 | kafka.serializer.StringEncoder 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-socket] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/acquisition-socket/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-socket] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/resources/struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | /console/session/manage.jsp 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-acquisition-socket 2 | application.version=2.0.0 3 | 4 | jmx.port=2001 5 | web.port=8001 6 | web.context=/ 7 | 8 | service.port=9001 9 | 10 | #test dev beta realse 11 | deploy.dataId=acquisition-socket 12 | deploy.group=apple-auto 13 | deploy.env=dev 14 | 15 | hazelcast.members=127.0.0.1 16 | 17 | metadata.broker.list=118.178.252.65:9092 18 | producer.topic.location=location_v1 19 | producer.topic.journey=journey_v1 -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | cim-server 6 | 7 | 8 | 9 | contextConfigLocation 10 | classpath*:config/spring-*.xml 11 | 12 | 13 | 14 | org.springframework.web.context.ContextLoaderListener 15 | 16 | 17 | 18 | struts2 19 | org.apache.struts2.dispatcher.FilterDispatcher 20 | 21 | 22 | struts2 23 | *.action 24 | 25 | 26 | struts2 27 | *.do 28 | 29 | 30 | struts2 31 | *.api 32 | 33 | 34 | -1 35 | 36 | 37 | 38 | 39 | /console/index.jsp 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/console/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="utf-8"%> 2 | <% 3 | response.sendRedirect("/admin/session_list.action"); 4 | %> 5 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/console/nav.jsp: -------------------------------------------------------------------------------- 1 | 2 | <% 3 | String navBasePath = request.getScheme() + "://" 4 | + request.getServerName() + ":" + request.getServerPort() 5 | + request.getContextPath(); 6 | %> 7 | <%@ page language="java" pageEncoding="UTF-8"%> 8 |
9 | 18 |
-------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="utf-8"%> 2 | Hellow CIM! -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/bootstrap-3.3.6-dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/css/table.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | /*---------------------------------toppage------------------------------*/ 3 | 4 | 5 | /*---------------------------------table------------------------------*/ 6 | .utable { 7 | border-collapse: collapse; 8 | border-spacing: 0; 9 | text-align: center; 10 | font-size: 12px; 11 | background: #ffffff; 12 | word-break:break-all; 13 | margin-right: 10px; 14 | } 15 | .utable tr th { 16 | background-color: #F3F3F3; 17 | border-right: solid 1px #D4D4D4; 18 | border-left: solid 1px #D4D4D4; 19 | border-bottom: solid 1px #D4D4D4; 20 | color: #463E5E; 21 | line-height: 40px; 22 | font-size: 14px; 23 | text-align: center; 24 | } 25 | 26 | 27 | 28 | .utable tr:hover { 29 | background-color: #f5f6f9; 30 | } 31 | 32 | 33 | .utable tr td { 34 | border-right: solid 1px #D4D4D4; 35 | border-bottom: solid 1px #D4D4D4; 36 | color: #666; 37 | max-height: 80px; 38 | line-height: 35px; 39 | height:35px; 40 | padding-left: 5px; 41 | padding-right: 5px; 42 | overflow: hidden; 43 | } 44 | 45 | 46 | .datarecord { 47 | text-align:center; 48 | line-height: 30px; 49 | background-color: #14A7D5; 50 | margin-right:10px; 51 | } 52 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/img/icon.png -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/img/icon_loading_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/img/icon_loading_small.gif -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/img/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-acquisition/apple-auto-acquisition-socket/src/main/webapp/resource/img/pattern.png -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | 10 | src/main/assembly/bin/ 11 | bin 12 | 0755 13 | 14 | 15 | src/main/assembly/conf/ 16 | conf 17 | 18 | 19 | src/main/webapp 20 | webapp 21 | 0644 22 | 23 | 24 | 25 | 26 | lib 27 | 28 | 29 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-vvsmart] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/acquisition-vvsmart/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-vvsmart] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-acquisition-vvsmart 2 | application.version=2.0.0 3 | 4 | jmx.port=2001 5 | 6 | #test dev beta realse 7 | deploy.dataId=acquisition-vvsmart 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | metadata.broker.list=118.178.252.65:9092 12 | producer.topic.location=location_v1 13 | producer.topic.journey=journey_v1 14 | 15 | #websocket 16 | webstocket.url=ws://#### -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/java/com/appleframework/auto/acquisition/vvsmart/model/JsonResult.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.acquisition.vvsmart.model; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | public class JsonResult implements Serializable { 7 | 8 | private static final long serialVersionUID = 1411801420539585196L; 9 | 10 | private Integer Result; 11 | private String Time; 12 | 13 | private List List; 14 | 15 | public Integer getResult() { 16 | return Result; 17 | } 18 | 19 | public void setResult(Integer result) { 20 | Result = result; 21 | } 22 | 23 | public String getTime() { 24 | return Time; 25 | } 26 | 27 | public void setTime(String time) { 28 | Time = time; 29 | } 30 | 31 | public List getList() { 32 | return List; 33 | } 34 | 35 | public void setList(List list) { 36 | List = list; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/java/com/appleframework/auto/acquisition/vvsmart/utils/LocationConversion.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.acquisition.vvsmart.utils; 2 | 3 | import com.appleframework.auto.acquisition.vvsmart.model.JsonTrack; 4 | import com.appleframework.auto.bean.location.Location; 5 | 6 | public class LocationConversion { 7 | 8 | public static Location conversion(JsonTrack jtrack) { 9 | if (null == jtrack.getLat() || null == jtrack.getLng()) { 10 | return null; 11 | } 12 | Location location = new Location(); 13 | location.setAccount(jtrack.getDeviceId().toString()); 14 | location.setDirection((double) jtrack.getDirection()); 15 | location.setLatitude(jtrack.getLat()); 16 | location.setLongitude(jtrack.getLng()); 17 | location.setAltitude(0d); 18 | if(null == jtrack.getSpeed()) { 19 | location.setSpeed(0D); 20 | } 21 | else { 22 | location.setSpeed((double) jtrack.getSpeed()); 23 | } 24 | String time = jtrack.getTime().substring(6, 19); 25 | location.setTime(Long.parseLong(time)); 26 | return location; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/main/resoureces/config/spring-websocket.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/test/java/com/appleframework/auto/acquisition/vvsmart/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.acquisition.vvsmart; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 10 | public class AppTest { 11 | 12 | @Test 13 | public void testAddOpinion1() { 14 | try { 15 | System.in.read(); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-vvsmart] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/acquisition-vvsmart/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][acquisition-vvsmart] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-acquisition/apple-auto-acquisition-vvsmart/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-acquisition-vvsmart 2 | application.version=2.0.0 3 | 4 | jmx.port=2001 5 | web.port=8001 6 | web.context=/ 7 | 8 | service.port=9001 9 | 10 | #test dev beta realse 11 | deploy.dataId=acquisition-vvsmart 12 | deploy.group=apple-auto 13 | deploy.env=dev 14 | 15 | metadata.broker.list=118.178.252.65:9092 16 | producer.topic.location=location_v1 17 | producer.topic.journey=journey_v1 18 | 19 | #websocket 20 | webstocket.url=ws://###:2012 -------------------------------------------------------------------------------- /apple-auto-acquisition/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.appleframework.auto 6 | apple-auto 7 | 0.0.2.RELEASE 8 | 9 | apple-auto-acquisition 10 | apple-auto-acquisition 11 | http://maven.apache.org 12 | pom 13 | 14 | apple-auto-acquisition-socket 15 | apple-auto-acquisition-vvsmart 16 | 17 | -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto-bean 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-bean-core 12 | apple-auto-bean-core 13 | http://maven.apache.org 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-core/src/main/java/com/appleframework/auto/bean/core/Protobufable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *************************************************************************************** 17 | * * 18 | * Website : http://www.appleframework.com * 19 | * * 20 | *************************************************************************************** 21 | */ 22 | package com.appleframework.auto.bean.core; 23 | 24 | /** 25 | * 需要向另一端发送的结构体 26 | */ 27 | public interface Protobufable { 28 | 29 | byte[] getByteArray(); 30 | } -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-fence/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto-bean 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-bean-fence 12 | apple-auto-bean-fence 13 | http://maven.apache.org 14 | 15 | 16 | ${project.groupId} 17 | apple-auto-bean-core 18 | ${project.version} 19 | 20 | 21 | ${project.groupId} 22 | apple-auto-bean-location 23 | ${project.version} 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-fence/src/main/java/com/appleframework/auto/bean/fence/Fence.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | *************************************************************************************** 17 | * * 18 | * Website : http://www.appleframework.com * 19 | * * 20 | *************************************************************************************** 21 | */ 22 | package com.appleframework.auto.bean.fence; 23 | 24 | /** 25 | * 围栏接口 26 | */ 27 | public interface Fence { 28 | 29 | public String getId(); 30 | 31 | public String getName(); 32 | 33 | public Integer getType(); 34 | } -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-fence/src/main/java/com/appleframework/auto/bean/fence/PolygonFence.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.bean.fence; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | public class PolygonFence extends BaseFence implements Fence, Serializable { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | private List polygonXA; 11 | private List polygonYA; 12 | 13 | @Override 14 | public Integer getType() { 15 | return 3; 16 | } 17 | 18 | public List getPolygonXA() { 19 | return polygonXA; 20 | } 21 | 22 | public void setPolygonXA(List polygonXA) { 23 | this.polygonXA = polygonXA; 24 | } 25 | 26 | public List getPolygonYA() { 27 | return polygonYA; 28 | } 29 | 30 | public void setPolygonYA(List polygonYA) { 31 | this.polygonYA = polygonYA; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-fence/src/main/java/com/appleframework/auto/bean/fence/SyncOperate.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.bean.fence; 2 | 3 | import java.io.Serializable; 4 | 5 | public class SyncOperate implements Serializable { 6 | 7 | private static final long serialVersionUID = -331105663663246055L; 8 | 9 | public static int CREATE = 1; 10 | public static int UPDATE = 2; 11 | public static int DELETE = 3; 12 | 13 | private Integer operateType; 14 | private Integer fenceType; 15 | private Fence oldFence; 16 | private Fence newFence; 17 | 18 | public Fence getOldFence() { 19 | return oldFence; 20 | } 21 | 22 | public void setOldFence(Fence oldFence) { 23 | this.oldFence = oldFence; 24 | } 25 | 26 | public Fence getNewFence() { 27 | return newFence; 28 | } 29 | 30 | public void setNewFence(Fence newFence) { 31 | this.newFence = newFence; 32 | } 33 | 34 | public Integer getOperateType() { 35 | return operateType; 36 | } 37 | 38 | public void setOperateType(Integer operateType) { 39 | this.operateType = operateType; 40 | } 41 | 42 | public Integer getFenceType() { 43 | return fenceType; 44 | } 45 | 46 | public void setFenceType(Integer fenceType) { 47 | this.fenceType = fenceType; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "SyncOperate [operateType=" + operateType + ", fenceType=" + fenceType + ", oldFence=" + oldFence 53 | + ", newFence=" + newFence + "]"; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-fence/src/main/java/com/appleframework/auto/entity/fence/FenceEntityWithBLOBs.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.entity.fence; 2 | 3 | import java.io.Serializable; 4 | 5 | public class FenceEntityWithBLOBs extends FenceEntity implements Serializable { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | private String parameter; 10 | 11 | private String latitudes; 12 | 13 | private String longitudes; 14 | 15 | public String getParameter() { 16 | return parameter; 17 | } 18 | 19 | public void setParameter(String parameter) { 20 | this.parameter = parameter == null ? null : parameter.trim(); 21 | } 22 | 23 | public String getLatitudes() { 24 | return latitudes; 25 | } 26 | 27 | public void setLatitudes(String latitudes) { 28 | this.latitudes = latitudes == null ? null : latitudes.trim(); 29 | } 30 | 31 | public String getLongitudes() { 32 | return longitudes; 33 | } 34 | 35 | public void setLongitudes(String longitudes) { 36 | this.longitudes = longitudes == null ? null : longitudes.trim(); 37 | } 38 | } -------------------------------------------------------------------------------- /apple-auto-bean/apple-auto-bean-location/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto-bean 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-bean-location 12 | apple-auto-bean-location 13 | http://maven.apache.org 14 | 15 | 16 | 17 | ${project.groupId} 18 | apple-auto-bean-core 19 | ${project.version} 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /apple-auto-bean/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-bean 12 | apple-auto-bean 13 | http://maven.apache.org 14 | pom 15 | 16 | apple-auto-bean-location 17 | apple-auto-bean-fence 18 | apple-auto-bean-core 19 | 20 | 21 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | src/main/assembly/bin 10 | bin 11 | 0755 12 | 13 | 14 | src/main/assembly/conf 15 | conf 16 | 0644 17 | 18 | 19 | 20 | 21 | lib 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-fence] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/calculate-fence/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-fence] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-calculate-fence 2 | application.version=2.0.0 3 | 4 | jmx.port=2002 5 | 6 | #test dev beta realse 7 | deploy.dataId=calculate-fence 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | zookeeper.connect=118.178.252.65:2182 12 | group.id=fence_calculate_67 13 | consumer.topic=location_v1 14 | consumer.partitionsNum=16 15 | 16 | metadata.broker.list=118.178.252.65:9092 17 | producer.topic=notify_v1 18 | 19 | #cache 20 | redis.masterAddressUri=192.168.1.177:6379 21 | redis.slaveAddressUris=192.168.1.177:6379 22 | redis.database=12 23 | redis.fence.topic=KEY_FENCE_TOPIC 24 | redis.fence.map=KEY_FENCE_MAP 25 | 26 | #map 27 | fence.location.map.path=/work/data/fence/location/map.db -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/java/com/appleframework/auto/calculate/fence/consumer/FenceConsumer.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.fence.consumer; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import com.appleframework.auto.bean.fence.SyncOperate; 6 | import com.appleframework.auto.calculate.fence.service.FenceInfoService; 7 | import com.appleframework.jms.jedis.consumer.TopicObjectMessageConsumer; 8 | 9 | public class FenceConsumer extends TopicObjectMessageConsumer { 10 | 11 | @Resource 12 | private FenceInfoService fenceInfoService; 13 | 14 | @Override 15 | public void processMessage(Object message) { 16 | if (message instanceof SyncOperate) { 17 | SyncOperate operate = (SyncOperate) message; 18 | if (operate.getOperateType() == SyncOperate.CREATE) { 19 | fenceInfoService.create(operate.getNewFence()); 20 | } else if (operate.getOperateType() == SyncOperate.UPDATE) { 21 | fenceInfoService.update(operate.getOldFence(), operate.getNewFence()); 22 | } else { 23 | fenceInfoService.delete(operate.getOldFence()); 24 | } 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/java/com/appleframework/auto/calculate/fence/consumer/LocationConsumer.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.fence.consumer; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import com.appleframework.auto.bean.location.Location; 6 | import com.appleframework.auto.calculate.fence.service.impl.FenceCalculateService; 7 | import com.appleframework.jms.kafka.consumer.ObjectMessageConsumer; 8 | 9 | public class LocationConsumer extends ObjectMessageConsumer { 10 | 11 | @Resource 12 | private FenceCalculateService fenceCalculateService; 13 | 14 | @Override 15 | public void processMessage(Object message) { 16 | try { 17 | if (message instanceof Location) { 18 | Location location = (Location) message; 19 | //long t = System.currentTimeMillis(); 20 | fenceCalculateService.calculate(location); 21 | //System.out.println(System.currentTimeMillis() - t); 22 | } 23 | } catch (Exception e) { 24 | e.printStackTrace(); 25 | } 26 | return; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/java/com/appleframework/auto/calculate/fence/model/FenceEvent.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.fence.model; 2 | 3 | import java.util.Set; 4 | 5 | import com.appleframework.auto.bean.location.Location; 6 | 7 | public class FenceEvent { 8 | 9 | private Location location; 10 | private Set fenceIdSet; 11 | 12 | public Location getLocation() { 13 | return location; 14 | } 15 | 16 | public void setLocation(Location location) { 17 | this.location = location; 18 | } 19 | 20 | public Set getFenceIdSet() { 21 | return fenceIdSet; 22 | } 23 | 24 | public void setFenceIdSet(Set fenceIdSet) { 25 | this.fenceIdSet = fenceIdSet; 26 | } 27 | 28 | public FenceEvent setFenceEvent(Location location, Set fenceIdSet) { 29 | this.location = location; 30 | this.fenceIdSet = fenceIdSet; 31 | return this; 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/java/com/appleframework/auto/calculate/fence/service/FenceInfoService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.fence.service; 2 | 3 | import com.appleframework.auto.bean.fence.Fence; 4 | 5 | public interface FenceInfoService { 6 | 7 | public void create(Fence newFence); 8 | 9 | public void update(Fence oldFence, Fence newFence); 10 | 11 | public void delete(Fence oldFence); 12 | 13 | public Fence get(String fenceId); 14 | } 15 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/java/com/appleframework/auto/calculate/fence/service/impl/FenceLocationService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.fence.service.impl; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.appleframework.auto.calculate.fence.model.FenceLocation; 11 | 12 | @Service("fenceLocationService") 13 | public class FenceLocationService { 14 | 15 | protected final Logger logger = LoggerFactory.getLogger(getClass()); 16 | 17 | private Map> fenceLocationMap = new HashMap<>(); 18 | 19 | public Map get(String key) { 20 | Map> fenceLocationMap = getfenceLocationMap(); 21 | return fenceLocationMap.get(key); 22 | } 23 | 24 | public void put(String key, Map map) { 25 | Map> fenceLocationMap = getfenceLocationMap(); 26 | fenceLocationMap.put(key, map); 27 | } 28 | 29 | public void delete(String key) { 30 | fenceLocationMap.remove(key); 31 | } 32 | 33 | private Map> getfenceLocationMap() { 34 | //Map> fenceLocationMap = hazelcastInstance.getMap("FENCE_LOCATION"); 35 | return fenceLocationMap; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/main/resources/config/spring-event.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/test/java/com/appleframework/auto/calculate/fence/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.fence; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 10 | public class AppTest { 11 | 12 | @Test 13 | public void testAddOpinion1() { 14 | try { 15 | System.in.read(); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-fence] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/calculate-fence/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-fence] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-local/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-calculate-fence 2 | application.version=2.0.0 3 | 4 | jmx.port=2002 5 | 6 | #test dev beta realse 7 | deploy.dataId=calculate-fence 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | zookeeper.connect=118.178.252.65:2182 12 | group.id=fence_calculate_66 13 | consumer.topic=location_v1 14 | consumer.partitionsNum=16 15 | 16 | metadata.broker.list=118.178.252.65:9092 17 | producer.topic=notify_v1 18 | 19 | #cache 20 | redis.masterAddressUri=192.168.1.177:6379 21 | redis.slaveAddressUris=192.168.1.177:6379 22 | redis.database=12 23 | redis.fence.topic=KEY_FENCE_TOPIC 24 | redis.fence.map=KEY_FENCE_MAP 25 | 26 | #map 27 | fence.location.map.path=/work/data/fence/location/map.db -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | src/main/assembly/bin/ 10 | bin 11 | 0755 12 | 13 | 14 | src/main/assembly/conf/ 15 | conf 16 | 0644 17 | 18 | 19 | ${project.build.directory} 20 | lib 21 | 22 | **/*-executable.jar 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-fence] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/calculate-fence/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-fence] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-calculate-fence-storm 2 | application.version=2.0.0 3 | 4 | #test dev beta realse 5 | deploy.dataId=calculate-fence 6 | deploy.group=apple-auto 7 | deploy.env=dev -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/java/com/appleframework/auto/fence/calculate/factory/RedisFactory.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.fence.calculate.factory; 2 | 3 | import java.util.Properties; 4 | 5 | import com.appleframework.cache.jedis.config.MasterSlaveServersConfig; 6 | import com.appleframework.cache.jedis.factory.MasterSlavePoolFactory; 7 | import com.appleframework.cache.jedis.factory.PoolFactory; 8 | 9 | import redis.clients.jedis.JedisPoolConfig; 10 | 11 | public class RedisFactory { 12 | 13 | private static MasterSlavePoolFactory poolFactory; 14 | 15 | private static void init(Properties props) { 16 | 17 | MasterSlaveServersConfig serverConfig = new MasterSlaveServersConfig(); 18 | serverConfig.setMasterAddressUri(props.getProperty("redis.masterAddressUri")); 19 | serverConfig.setSlaveAddressUris(props.getProperty("redis.slaveAddressUris")); 20 | serverConfig.setDatabase(Integer.parseInt(props.getProperty("redis.database"))); 21 | 22 | JedisPoolConfig poolConfig = new JedisPoolConfig(); 23 | poolConfig.setMaxTotal(24); 24 | poolConfig.setMaxIdle(24); 25 | poolConfig.setMinIdle(0); 26 | 27 | poolFactory = new MasterSlavePoolFactory(); 28 | poolFactory.setMasterPoolConfig(poolConfig); 29 | poolFactory.setSlavePoolConfig(poolConfig); 30 | poolFactory.setServerConfig(serverConfig); 31 | 32 | poolFactory.init(); 33 | } 34 | 35 | public static PoolFactory getInstance(Properties props) { 36 | if(null == poolFactory) 37 | init(props); 38 | return poolFactory; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/java/com/appleframework/auto/fence/calculate/utils/ByteUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.fence.calculate.utils; 2 | 3 | import java.io.ByteArrayInputStream; 4 | import java.io.ByteArrayOutputStream; 5 | import java.io.IOException; 6 | import java.io.ObjectInputStream; 7 | import java.io.ObjectOutputStream; 8 | 9 | public class ByteUtils { 10 | 11 | public static Object fromByte(byte[] obj) { 12 | Object object = null; 13 | ByteArrayInputStream bis = new ByteArrayInputStream(obj); 14 | try { 15 | ObjectInputStream ois = new ObjectInputStream(bis); 16 | object = ois.readObject(); 17 | } catch (Exception e) { 18 | e.printStackTrace(); 19 | } 20 | return object; 21 | } 22 | 23 | public static byte[] toBytes(Object object) { 24 | try { 25 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 26 | ObjectOutputStream oos; 27 | oos = new ObjectOutputStream(bos); 28 | oos.writeObject(object); 29 | byte[] objMessage = bos.toByteArray(); 30 | return objMessage; 31 | } catch (IOException e) { 32 | e.printStackTrace(); 33 | return null; 34 | } 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/java/com/appleframework/auto/fence/calculate/utils/Constants.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.fence.calculate.utils; 2 | 3 | public interface Constants { 4 | 5 | public static int MAP_BAIDU = 1; 6 | public static int MAP_GOOGLE = 2; 7 | 8 | public static String KEY_LATITUDE = "latitude"; 9 | public static String KEY_LONGITUDE = "longitude"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | #appender 3 | log4j.appender.out=org.apache.log4j.ConsoleAppender 4 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][fence-calculate] [%C->%M(%L)] %m%n 6 | 7 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 8 | log4j.appender.logToFile.File=/work/logs/apple-auto/fence-calculate/localhost.log 9 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 10 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][fence-calculate] [%C->%M(%L)] %m%n 12 | 13 | 14 | log4j.logger.com.mchange.v2.resourcepool=warn,out,logToFile 15 | log4j.logger.org.apache.zookeeper.ClientCnxn=warn,out,logToFile -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/apple-auto-calculate-fence-storm/src/main/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-calculate-fence-storm 2 | application.version=2.0.0 3 | 4 | #test dev beta realse 5 | deploy.dataId=calculate-fence 6 | deploy.group=apple-auto 7 | deploy.env=dev -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-fence/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto-calculate 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-calculate-fence 12 | apple-auto-calculate-fence 13 | http://maven.apache.org 14 | pom 15 | 16 | 0.0.1-SNAPSHOT 17 | 18 | 19 | apple-auto-calculate-fence-local 20 | apple-auto-calculate-fence-storm 21 | 22 | 23 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | src/main/assembly/bin 10 | bin 11 | 0755 12 | 13 | 14 | src/main/assembly/conf 15 | conf 16 | 0644 17 | 18 | 19 | 20 | 21 | lib 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-notify] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/calculate-notify/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-notify] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-calculate-notify 2 | application.version=2.0.0 3 | 4 | jmx.port=2002 5 | 6 | #test dev beta realse 7 | deploy.dataId=calculate-notify 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | zookeeper.connect=118.178.252.65:2182 12 | group.id=fence_notify_6 13 | consumer.topic=notify_v1 14 | consumer.partitionsNum=16 15 | 16 | #cache 17 | redis.masterAddressUri=192.168.1.177:6379 18 | redis.slaveAddressUris=192.168.1.177:6379 19 | redis.database=12 20 | redis.fence.map=KEY_FENCE_MAP 21 | 22 | #notify url 23 | notify.url=http://118.178.252.65:8001/cgi/message_send.action -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/main/java/com/appleframework/auto/calculate/notify/consumer/FenceResultConsumer.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.notify.consumer; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import com.appleframework.auto.bean.fence.FenceResult; 6 | import com.appleframework.auto.calculate.notify.service.impl.NotifyCimService; 7 | import com.appleframework.jms.kafka.consumer.ObjectMessageConsumer; 8 | 9 | public class FenceResultConsumer extends ObjectMessageConsumer { 10 | 11 | @Resource 12 | private NotifyCimService notifyCimService; 13 | 14 | @Override 15 | public void processMessage(Object message) { 16 | try { 17 | if (message instanceof FenceResult) { 18 | FenceResult result = (FenceResult) message; 19 | notifyCimService.notify(result); 20 | } 21 | } catch (Exception e) { 22 | e.printStackTrace(); 23 | } 24 | return; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/test/java/com/appleframework/auto/calculate/notify/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.calculate.notify; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 10 | public class AppTest { 11 | 12 | @Test 13 | public void testAddOpinion1() { 14 | try { 15 | System.in.read(); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-notify] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/calculate-notify/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][calculate-notify] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-calculate/apple-auto-calculate-notify/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-calculate-notify 2 | application.version=2.0.0 3 | 4 | jmx.port=2002 5 | 6 | #test dev beta realse 7 | deploy.dataId=calculate-notify 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | zookeeper.connect=118.178.252.65:2182 12 | group.id=fence_notify_6 13 | consumer.topic=notify_v1 14 | consumer.partitionsNum=16 15 | 16 | #cache 17 | redis.masterAddressUri=192.168.1.177:6379 18 | redis.slaveAddressUris=192.168.1.177:6379 19 | redis.database=12 20 | redis.fence.map=KEY_FENCE_MAP 21 | 22 | #notify url 23 | notify.url=http://118.178.252.65:8001/cgi/message_send.action -------------------------------------------------------------------------------- /apple-auto-calculate/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.appleframework.auto 6 | apple-auto 7 | 0.0.2.RELEASE 8 | 9 | apple-auto-calculate 10 | apple-auto-calculate 11 | http://maven.apache.org 12 | pom 13 | 14 | apple-auto-calculate-fence 15 | apple-auto-calculate-notify 16 | 17 | -------------------------------------------------------------------------------- /apple-auto-open-platform/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-open-platform 12 | apple-auto-open-platform 13 | jar 14 | http://maven.apache.org 15 | 16 | 17 | ${project.groupId} 18 | apple-auto-service-common 19 | ${project.version} 20 | 21 | 22 | com.appleframework 23 | apple-distributed 24 | 25 | 26 | com.appleframework.rop 27 | apple-rop 28 | 29 | 30 | com.appleframework.config 31 | apple-config-diamond 32 | 33 | 34 | org.springframework 35 | spring-web 36 | 37 | 38 | org.springframework 39 | spring-webmvc 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | 10 | src/main/assembly/bin/ 11 | bin 12 | 0755 13 | 14 | 15 | src/main/assembly/conf/ 16 | conf 17 | 18 | 19 | src/main/assembly/lib/ 20 | lib 21 | 22 | 23 | src/main/webapp 24 | webapp 25 | 0644 26 | 27 | 28 | 29 | 30 | lib 31 | 32 | 33 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=warn,out,logToFile 2 | 3 | log4j.logger.org.eclipse.jetty.server=info,out,logToFile 4 | #appender 5 | log4j.appender.out=org.apache.log4j.ConsoleAppender 6 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 7 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][rop-mobile-common] [%C->%M(%L)] %m%n 8 | 9 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 10 | log4j.appender.logToFile.File=/work/logs/rop/rop-mobile-common/localhost.log 11 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 12 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][rop-mobile-common] [%C->%M(%L)] %m%n 14 | 15 | log4j.logger.org.springframework.context.support.ResourceBundleMessageSource=ERROR -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=rop-mobile-common 2 | application.version=3.5.0 3 | 4 | jmx.port=2001 5 | web.port=8001 6 | web.context=/ 7 | 8 | #test dev beta realse 9 | deploy.dataId=rop-mobile-common 10 | deploy.group=rop 11 | deploy.env=dev -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/lib/activation.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-open-platform/src/main/assembly/lib/activation.jar -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/lib/jaxb-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-open-platform/src/main/assembly/lib/jaxb-api.jar -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/lib/jaxb1-impl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-open-platform/src/main/assembly/lib/jaxb1-impl.jar -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/assembly/lib/jsr173_1.0_api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-open-platform/src/main/assembly/lib/jsr173_1.0_api.jar -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/manager/SampleAppSecretManager.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.manager; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | import com.appleframework.rop.security.AppSecretManager; 10 | 11 | public class SampleAppSecretManager implements AppSecretManager { 12 | 13 | protected final Logger logger = LoggerFactory.getLogger(getClass()); 14 | 15 | private static Map appKeySecretMap = new HashMap(); 16 | 17 | static { 18 | appKeySecretMap.put("apple-auto", "open-platform"); 19 | } 20 | 21 | @Override 22 | public String getSecret(String appKey) { 23 | return appKeySecretMap.get(appKey); 24 | } 25 | 26 | @Override 27 | public boolean isValidAppKey(String appKey) { 28 | return getSecret(appKey) != null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/manager/SampleSessionManager.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.manager; 2 | 3 | import java.util.Map; 4 | import java.util.concurrent.ConcurrentHashMap; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | import com.appleframework.rop.session.Session; 10 | import com.appleframework.rop.session.SessionManager; 11 | 12 | public class SampleSessionManager implements SessionManager{ 13 | 14 | protected final Logger logger = LoggerFactory.getLogger(getClass()); 15 | 16 | private final static Map sessionCache = new ConcurrentHashMap(128, 0.75f, 32); 17 | 18 | 19 | @Override 20 | public void addSession(String sessionId, Session session) { 21 | sessionCache.put(sessionId, session); 22 | } 23 | 24 | @Override 25 | public Session getSession(String sessionId) { 26 | return sessionCache.get(sessionId); 27 | } 28 | 29 | @Override 30 | public void removeSession(String sessionId) { 31 | sessionCache.remove(sessionId); 32 | } 33 | 34 | @Override 35 | public Session createSession(Map arg0) { 36 | return null; 37 | } 38 | } -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/request/CircleFenceCreateRequest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.request; 2 | 3 | import javax.validation.constraints.NotNull; 4 | 5 | import com.appleframework.rop.AbstractRopRequest; 6 | 7 | public class CircleFenceCreateRequest extends AbstractRopRequest { 8 | 9 | @NotNull 10 | private Double latitude; 11 | 12 | @NotNull 13 | private Double longitude; 14 | 15 | @NotNull 16 | private Double radius; 17 | 18 | public Double getLatitude() { 19 | return latitude; 20 | } 21 | 22 | public void setLatitude(Double latitude) { 23 | this.latitude = latitude; 24 | } 25 | 26 | public Double getLongitude() { 27 | return longitude; 28 | } 29 | 30 | public void setLongitude(Double longitude) { 31 | this.longitude = longitude; 32 | } 33 | 34 | public Double getRadius() { 35 | return radius; 36 | } 37 | 38 | public void setRadius(Double radius) { 39 | this.radius = radius; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/request/LocationListRequest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.request; 2 | 3 | import javax.validation.constraints.NotNull; 4 | 5 | import com.appleframework.rop.AbstractRopRequest; 6 | 7 | public class LocationListRequest extends AbstractRopRequest { 8 | 9 | @NotNull 10 | private String account; 11 | 12 | @NotNull 13 | private String startTime; 14 | 15 | @NotNull 16 | private String endTime; 17 | 18 | @NotNull 19 | private Integer mapType; 20 | 21 | public String getAccount() { 22 | return account; 23 | } 24 | 25 | public void setAccount(String account) { 26 | this.account = account; 27 | } 28 | 29 | public String getStartTime() { 30 | return startTime; 31 | } 32 | 33 | public void setStartTime(String startTime) { 34 | this.startTime = startTime; 35 | } 36 | 37 | public String getEndTime() { 38 | return endTime; 39 | } 40 | 41 | public void setEndTime(String endTime) { 42 | this.endTime = endTime; 43 | } 44 | 45 | public Integer getMapType() { 46 | return mapType; 47 | } 48 | 49 | public void setMapType(Integer mapType) { 50 | this.mapType = mapType; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/request/LocationSearchRequest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.request; 2 | 3 | import javax.validation.constraints.NotNull; 4 | 5 | import com.appleframework.rop.AbstractRopRequest; 6 | 7 | public class LocationSearchRequest extends AbstractRopRequest { 8 | 9 | @NotNull 10 | private String account; 11 | 12 | @NotNull 13 | private Long startTime; 14 | 15 | @NotNull 16 | private Long endTime; 17 | 18 | @NotNull 19 | private Integer mapType; 20 | 21 | public String getAccount() { 22 | return account; 23 | } 24 | 25 | public void setAccount(String account) { 26 | this.account = account; 27 | } 28 | 29 | public Long getStartTime() { 30 | return startTime; 31 | } 32 | 33 | public void setStartTime(Long startTime) { 34 | this.startTime = startTime; 35 | } 36 | 37 | public Long getEndTime() { 38 | return endTime; 39 | } 40 | 41 | public void setEndTime(Long endTime) { 42 | this.endTime = endTime; 43 | } 44 | 45 | public Integer getMapType() { 46 | return mapType; 47 | } 48 | 49 | public void setMapType(Integer mapType) { 50 | this.mapType = mapType; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/response/AccessTokenResponse.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.response; 2 | 3 | import javax.xml.bind.annotation.XmlAccessType; 4 | import javax.xml.bind.annotation.XmlAccessorType; 5 | import javax.xml.bind.annotation.XmlRootElement; 6 | 7 | /** 8 | *
 9 |  * 功能说明:
10 |  * 
11 | * 12 | * @author cruise.xu 13 | * @version 1.0 14 | */ 15 | @XmlAccessorType(XmlAccessType.FIELD) 16 | @XmlRootElement(name = "accessTokenResponse") 17 | public class AccessTokenResponse { 18 | 19 | private String accessToken; 20 | private String refreshToken; 21 | private long expiresIn; 22 | 23 | public String getAccessToken() { 24 | return accessToken; 25 | } 26 | 27 | public void setAccessToken(String accessToken) { 28 | this.accessToken = accessToken; 29 | } 30 | 31 | public String getRefreshToken() { 32 | return refreshToken; 33 | } 34 | 35 | public void setRefreshToken(String refreshToken) { 36 | this.refreshToken = refreshToken; 37 | } 38 | 39 | public long getExpiresIn() { 40 | return expiresIn; 41 | } 42 | 43 | public void setExpiresIn(long expiresIn) { 44 | this.expiresIn = expiresIn; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/response/IsSuccessResponse.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.response; 2 | 3 | import javax.xml.bind.annotation.XmlAccessType; 4 | import javax.xml.bind.annotation.XmlAccessorType; 5 | import javax.xml.bind.annotation.XmlRootElement; 6 | 7 | @XmlAccessorType(XmlAccessType.FIELD) 8 | @XmlRootElement(name = "isSuccessResponse") 9 | public class IsSuccessResponse { 10 | 11 | private boolean isSuccess = true; 12 | private String prompt; 13 | 14 | public boolean isSuccess() { 15 | return isSuccess; 16 | } 17 | 18 | public void setSuccess(boolean isSuccess) { 19 | this.isSuccess = isSuccess; 20 | } 21 | 22 | public String getPrompt() { 23 | return prompt; 24 | } 25 | 26 | public void setPrompt(String prompt) { 27 | this.prompt = prompt; 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/response/LocationSearchResponse.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.response; 2 | 3 | import java.util.List; 4 | 5 | import javax.xml.bind.annotation.XmlAccessType; 6 | import javax.xml.bind.annotation.XmlAccessorType; 7 | import javax.xml.bind.annotation.XmlRootElement; 8 | 9 | import com.appleframework.auto.bean.location.Location; 10 | 11 | /** 12 | *
13 |  * 功能说明:
14 |  * 
15 | * 16 | * @version 1.0 17 | */ 18 | @XmlAccessorType(XmlAccessType.FIELD) 19 | @XmlRootElement(name = "locationSearchResponse") 20 | public class LocationSearchResponse { 21 | 22 | private List list; 23 | 24 | public List getList() { 25 | return list; 26 | } 27 | 28 | public void setList(List list) { 29 | this.list = list; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/java/com/appleframework/auto/open/platform/response/TokenErrorResponse.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.open.platform.response; 2 | 3 | import javax.xml.bind.annotation.XmlAccessType; 4 | import javax.xml.bind.annotation.XmlAccessorType; 5 | import javax.xml.bind.annotation.XmlRootElement; 6 | 7 | import com.appleframework.rop.response.ErrorResponse; 8 | 9 | /** 10 | * @author cruise.xu 11 | * @version 1.0 12 | */ 13 | @XmlAccessorType(XmlAccessType.FIELD) 14 | @XmlRootElement(name = "tokenErrorResponse") 15 | public class TokenErrorResponse extends ErrorResponse { 16 | 17 | private String code; 18 | private String message; 19 | 20 | public String getCode() { 21 | return code; 22 | } 23 | 24 | public void setCode(String code) { 25 | this.code = code; 26 | } 27 | 28 | public String getMessage() { 29 | return message; 30 | } 31 | 32 | public void setMessage(String message) { 33 | this.message = message; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/resources/config/applicationContext-dubbo.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 13 | 14 | 18 | 19 | 21 | 22 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/resources/i18n/rop/open-platform_zh_CN.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-open-platform/src/main/resources/i18n/rop/open-platform_zh_CN.properties -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][open-platform] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/open-platform/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][open-platform] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-open-platform 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | service.port=9003 6 | 7 | #test dev beta realse 8 | deploy.dataId=open-platform 9 | deploy.group=apple-auto 10 | deploy.env=dev 11 | 12 | 13 | application.owner=xusm 14 | registry.address=zookeeper://localhost:2181 -------------------------------------------------------------------------------- /apple-auto-open-platform/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /apple-auto-open-platform/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][open-platform] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/open-platform/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][open-platform] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-open-platform/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-open-platform 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | service.port=9003 6 | 7 | #test dev beta realse 8 | deploy.dataId=open-platform 9 | deploy.group=apple-auto 10 | deploy.env=dev 11 | 12 | 13 | application.owner=xusm 14 | registry.address=zookeeper://localhost:2181 -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | 10 | src/main/assembly/bin/ 11 | bin 12 | 0755 13 | 14 | 15 | src/main/assembly/conf 16 | conf 17 | 0644 18 | 19 | 20 | src/main/webapp 21 | webapp 22 | 0644 23 | 24 | 25 | 26 | 27 | lib 28 | 29 | 30 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][partner-platform] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/partner-platform/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][partner-platform] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-partner-platform 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | service.port=9003 6 | 7 | #test dev beta realse 8 | deploy.dataId=partner-platform 9 | deploy.group=apple-auto 10 | deploy.env=dev 11 | 12 | 13 | application.owner=xusm 14 | registry.address=zookeeper://localhost:2181 -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/java/com/appleframework/auto/partner/platform/web/JouneryController.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.partner.platform.web; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import com.appleframework.auto.service.journey.JourneySearchService; 10 | import com.appleframework.model.page.Pagination; 11 | import com.appleframework.web.springmvc.controller.BaseController; 12 | 13 | /** 14 | * 围栏 15 | */ 16 | @Controller 17 | @RequestMapping("/journey") 18 | public class JouneryController extends BaseController { 19 | 20 | @Resource 21 | private JourneySearchService journeySearchService; 22 | 23 | private String viewModel = "journey/"; 24 | 25 | @RequestMapping(value = "/list") 26 | public String list(Model model, Pagination page, String account, Long time) { 27 | page.setPageSize(10); 28 | if(null == time) 29 | time = System.currentTimeMillis(); 30 | page = journeySearchService.search(page, account, time); 31 | model.addAttribute("page", page); 32 | model.addAttribute("account", account); 33 | model.addAttribute("time", time); 34 | return viewModel + "list"; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/java/com/appleframework/auto/partner/platform/web/LocationController.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.partner.platform.web; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import com.appleframework.auto.bean.location.Location; 12 | import com.appleframework.auto.service.location.LocationSearchService; 13 | import com.appleframework.web.springmvc.controller.BaseController; 14 | 15 | /** 16 | * 围栏 17 | */ 18 | @Controller 19 | @RequestMapping("/location") 20 | public class LocationController extends BaseController { 21 | 22 | @Resource 23 | private LocationSearchService locationSearchService; 24 | 25 | private String viewModel = "location/"; 26 | 27 | @RequestMapping(value = "/show") 28 | public String show(Model model, String account, Long startTime, Long endTime, Integer mapType) { 29 | List list = null; 30 | if(null == mapType) 31 | mapType = 5; 32 | try { 33 | list = locationSearchService.search(account, startTime, endTime, mapType); 34 | model.addAttribute("list", list); 35 | } catch (Exception e) { 36 | e.printStackTrace(); 37 | } 38 | 39 | model.addAttribute("account", account); 40 | model.addAttribute("startTime", startTime); 41 | model.addAttribute("endTime", endTime); 42 | model.addAttribute("mapType", mapType); 43 | return viewModel + "show"; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/resources/config/service/applicationContext-dubbo.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 13 | 14 | 18 | 19 | 21 | 22 | 24 | 25 | 27 | 28 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][partner-platform] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/partner-platform/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][partner-platform] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-partner-platform 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | service.port=9003 6 | 7 | #test dev beta realse 8 | deploy.dataId=partner-platform 9 | deploy.group=apple-auto 10 | deploy.env=dev 11 | 12 | 13 | application.owner=xusm 14 | registry.address=zookeeper://localhost:2181 -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/error.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 操作提示 7 | <#include "../commons/page_css.ftl" /> 8 | <#include "../commons/page_js.ftl" /> 9 | 10 | 11 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/error_ajax.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 操作提示 7 | <#include "../commons/page_css.ftl" /> 8 | <#include "../commons/page_js.ftl" /> 9 | 10 | 11 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/page_bottom.ftl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/page_css.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/page_js.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/page_modal.ftl: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/pager.ftl: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/success.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 操作提示 7 | <#include "../commons/page_css.ftl" /> 8 | <#include "../commons/page_js.ftl" /> 9 | 10 | 11 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/WEB-INF/content/commons/success_ajax.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 操作提示 7 | <#include "../commons/page_css.ftl" /> 8 | <#include "../commons/page_js.ftl" /> 9 | 10 | 11 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/glyphicons/flat-ui-icons-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/glyphicons/flat-ui-icons-regular.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/glyphicons/flat-ui-icons-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/glyphicons/flat-ui-icons-regular.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/glyphicons/flat-ui-icons-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/glyphicons/flat-ui-icons-regular.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-black.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-black.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-black.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-black.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bold.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bold.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bold.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-italic.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-italic.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-italic.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-light.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-light.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-light.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-regular.eot -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-regular.ttf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/fonts/lato/lato-regular.woff -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/favicon.ico -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Book.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Calendar.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Chat.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Clipboard.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Compas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Compas.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Gift-Box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Gift-Box.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Infinity-Loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Infinity-Loop.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Mail.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Map.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Pensils.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Pensils.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Pocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Pocket.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Retina-Ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Retina-Ready.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Toilet-Paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Toilet-Paper.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Watches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/png/Watches.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/book.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/chat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/clocks.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/loop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/mail.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/map.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/paper-bag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/icons/svg/toilet-paper.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/login/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/login/icon.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/login/imac-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/login/imac-2x.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/login/imac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/login/imac.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/tile/ribbon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/tile/ribbon-2x.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/tile/ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/img/tile/ribbon.png -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/flat_ui/js/vendor/video-js.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/flat_ui/js/vendor/video-js.swf -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/images/loading_64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/images/loading_64.gif -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/images/qiuchang8_qrcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/images/qiuchang8_qrcode.jpg -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/images/wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xushaomin/apple-auto/8e875d5f13943d994e11e0160960033d1e335b5f/apple-auto-partner-platform/src/main/webapp/static/images/wechat.jpg -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/main/webapp/static/js/echarts/version: -------------------------------------------------------------------------------- 1 | 2.2.0 -------------------------------------------------------------------------------- /apple-auto-partner-platform/src/test/java/com/appleframework/auto/partner/platform/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.partner.platform; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.appleframework.auto 8 | apple-auto-service 9 | 0.0.2.RELEASE 10 | 11 | apple-auto-service-common 12 | apple-auto-service-common 13 | http://maven.apache.org 14 | 15 | 16 | ${project.groupId} 17 | apple-auto-bean-location 18 | ${project.version} 19 | 20 | 21 | ${project.groupId} 22 | apple-auto-bean-fence 23 | ${project.version} 24 | 25 | 26 | com.appleframework 27 | apple-exception 28 | 29 | 30 | com.appleframework 31 | apple-model 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/src/main/java/com/appleframework/auto/model/fence/FenceSo.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.model.fence; 2 | 3 | import java.io.Serializable; 4 | 5 | public class FenceSo implements Serializable { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | private String name; 10 | 11 | private Integer fenceType; 12 | 13 | private Boolean isEnable; 14 | 15 | private Integer dealType; 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getFenceType() { 26 | return fenceType; 27 | } 28 | 29 | public void setFenceType(Integer fenceType) { 30 | this.fenceType = fenceType; 31 | } 32 | 33 | public Boolean getIsEnable() { 34 | return isEnable; 35 | } 36 | 37 | public void setIsEnable(Boolean isEnable) { 38 | this.isEnable = isEnable; 39 | } 40 | 41 | public Integer getDealType() { 42 | return dealType; 43 | } 44 | 45 | public void setDealType(Integer dealType) { 46 | this.dealType = dealType; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/src/main/java/com/appleframework/auto/service/fence/FenceEntityService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.fence; 2 | 3 | 4 | import java.util.List; 5 | 6 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 7 | import com.appleframework.auto.model.fence.FenceSo; 8 | import com.appleframework.exception.AppleException; 9 | import com.appleframework.model.Search; 10 | import com.appleframework.model.page.Pagination; 11 | 12 | /** 13 | * 围栏管理接口 14 | * 15 | */ 16 | public interface FenceEntityService { 17 | 18 | public List findAll(); 19 | 20 | public Pagination findPage(Pagination page, FenceSo so, Search se); 21 | 22 | public FenceEntityWithBLOBs get(Integer id); 23 | 24 | public Integer save(FenceEntityWithBLOBs entity) throws AppleException; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/src/main/java/com/appleframework/auto/service/fence/FenceInfoService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.fence; 2 | 3 | 4 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 5 | 6 | /** 7 | * 围栏管理接口 8 | * 9 | */ 10 | public interface FenceInfoService { 11 | 12 | public void create(FenceEntityWithBLOBs entity); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/src/main/java/com/appleframework/auto/service/journey/JourneySearchService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.journey; 2 | 3 | import com.appleframework.model.page.Pagination; 4 | 5 | public interface JourneySearchService { 6 | 7 | public Pagination search(Pagination page, String account, long startTime); 8 | } 9 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/src/main/java/com/appleframework/auto/service/location/LocationNewestService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location; 2 | 3 | import com.appleframework.auto.bean.location.Location; 4 | import com.appleframework.exception.ServiceException; 5 | 6 | /** 7 | * 轨迹搜索 8 | * 9 | */ 10 | public interface LocationNewestService { 11 | 12 | public Location newest(String account, int mapType) throws ServiceException; 13 | 14 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-common/src/main/java/com/appleframework/auto/service/location/LocationSearchService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location; 2 | 3 | import java.util.List; 4 | 5 | import com.appleframework.auto.bean.location.Location; 6 | import com.appleframework.exception.ServiceException; 7 | 8 | /** 9 | * 轨迹搜索 10 | * 11 | */ 12 | public interface LocationSearchService { 13 | 14 | public List search(String account, long startTime, long endTime, int mapType) throws ServiceException; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | src/main/assembly/bin 10 | bin 11 | 0755 12 | 13 | 14 | src/main/assembly/conf 15 | conf 16 | 0644 17 | 18 | 19 | 20 | 21 | lib 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][service-provider] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/service-provider/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][service-provider] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-service-provider 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | service.port=9003 6 | 7 | #test dev beta realse 8 | deploy.dataId=service-provider 9 | deploy.group=apple-auto 10 | deploy.env=dev 11 | 12 | #dubbo 13 | application.owner=xusm 14 | registry.address=zookeeper://192.168.1.169:2181 15 | 16 | #cache 17 | hazelcast.members=192.168.1.250,192.168.1.247,192.168.1.218 18 | 19 | #hbase 20 | fs.default.name=hdfs://cluster1 21 | hbase.rootdir=hdfs://cluster1/hbase 22 | hbase.zookeeper.quorum=hdpc1-dn001:2181,hdpc1-dn002:2181,hdpc1-dn003:2181 23 | hbase.zookeeper.property.dataDir=/data/zookeeper/data 24 | hbase.table.auto.flush=true 25 | hbase.table.name.comment=location -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/dao/FenceEntityDao.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Repository; 8 | 9 | import com.appleframework.auto.entity.fence.FenceEntity; 10 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 11 | import com.appleframework.auto.model.fence.FenceSo; 12 | import com.appleframework.auto.service.mapper.FenceEntityMapper; 13 | import com.appleframework.auto.service.mapper.FenceExtendMapper; 14 | import com.appleframework.model.Search; 15 | import com.appleframework.model.page.Pagination; 16 | 17 | @Repository("fenceEntityDao") 18 | public class FenceEntityDao { 19 | 20 | @Resource 21 | private FenceEntityMapper fenceEntityMapper; 22 | 23 | @Resource 24 | private FenceExtendMapper fenceExtendMapper; 25 | 26 | public List findAll() { 27 | return fenceExtendMapper.selectAll(); 28 | } 29 | 30 | public List findPage(Pagination page, FenceSo so, Search se) { 31 | return fenceExtendMapper.selectPage(page, so, se); 32 | } 33 | 34 | public FenceEntityWithBLOBs get(Integer id) { 35 | return fenceEntityMapper.selectByPrimaryKey(id); 36 | } 37 | 38 | public Integer save(FenceEntityWithBLOBs entity) { 39 | return fenceEntityMapper.insert(entity); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/fence/FenceCacheService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.fence; 2 | 3 | import java.util.List; 4 | 5 | import com.appleframework.auto.bean.fence.Fence; 6 | import com.appleframework.exception.ServiceException; 7 | 8 | public interface FenceCacheService { 9 | 10 | public void create(Fence fence) throws ServiceException; 11 | 12 | public void update(Fence fence) throws ServiceException; 13 | 14 | public void delete(String id) throws ServiceException; 15 | 16 | public List get() throws ServiceException; 17 | 18 | public void clear() throws ServiceException; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/fence/FenceInfoCacheInitService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.fence; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.PostConstruct; 6 | import javax.annotation.Resource; 7 | 8 | import org.apache.log4j.Logger; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 12 | 13 | @Service("fenceInfoCacheInitService") 14 | public class FenceInfoCacheInitService { 15 | 16 | protected final static Logger logger = Logger.getLogger(FenceInfoCacheInitService.class); 17 | 18 | @Resource 19 | private FenceCacheService fenceCacheService; 20 | 21 | @Resource 22 | private FenceInfoService fenceInfoService; 23 | 24 | @Resource 25 | private FenceEntityService fenceEntityService; 26 | 27 | @PostConstruct 28 | public void init() { 29 | try { 30 | fenceCacheService.clear(); 31 | List list = fenceEntityService.findAll(); 32 | for (FenceEntityWithBLOBs fenceEntityWithBLOBs : list) { 33 | fenceInfoService.create(fenceEntityWithBLOBs); 34 | } 35 | } catch (Exception e) { 36 | logger.error(e); 37 | } 38 | 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/interceptor/FenceEntityInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.interceptor; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.apache.log4j.Logger; 6 | import org.aspectj.lang.JoinPoint; 7 | import org.aspectj.lang.annotation.Aspect; 8 | import org.springframework.stereotype.Component; 9 | 10 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 11 | import com.appleframework.auto.service.fence.FenceEntityService; 12 | import com.appleframework.auto.service.fence.FenceInfoService; 13 | 14 | @Component 15 | @Aspect 16 | public class FenceEntityInterceptor { 17 | 18 | private static Logger logger = Logger.getLogger(FenceEntityInterceptor.class.getName()); 19 | 20 | @Resource 21 | private FenceInfoService fenceInfoService; 22 | 23 | @Resource 24 | private FenceEntityService fenceEntityService; 25 | 26 | //@AfterReturning(value = "execution(* com.appleframework.auto.service.fence.impl.FenceEntityServiceImpl.save(..))", argNames = "rtv", returning = "rtv") 27 | public void save(JoinPoint jp, final Object rtv) { 28 | logger.error("fence insert success..."); 29 | Integer id = (Integer) rtv; 30 | FenceEntityWithBLOBs entity = fenceEntityService.get(id); 31 | fenceInfoService.create(entity); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/journey/JourneySearchServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.journey; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.apache.log4j.Logger; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.appleframework.auto.bean.location.Journey; 9 | import com.appleframework.auto.service.journey.key.JourneyRowkey; 10 | import com.appleframework.data.hbase.client.SimpleHbaseClient; 11 | import com.appleframework.model.page.Pagination; 12 | 13 | @Service("journeySearchService") 14 | public class JourneySearchServiceImpl implements JourneySearchService { 15 | 16 | protected final static Logger logger = Logger.getLogger(JourneySearchServiceImpl.class); 17 | 18 | @Resource 19 | private SimpleHbaseClient journeyHbaseDao; 20 | 21 | @Override 22 | public Pagination search(Pagination page, String account, long startTime) { 23 | JourneyRowkey startRowKey = JourneyRowkey.create(account, startTime); 24 | JourneyRowkey endRowKey = JourneyRowkey.create(account, startTime - 315532800000L); 25 | com.appleframework.data.core.page.Pagination pagin = journeyHbaseDao.findPageList(startRowKey, 26 | endRowKey, Journey.class, page.getPageNo(), page.getPageSize()); 27 | page.setList(pagin.getList()); 28 | page.setTotalCount(pagin.getTotalCount()); 29 | page.adjustPageNo(); 30 | return page; 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/location/LocationNewestServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.apache.log4j.Logger; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.appleframework.auto.bean.location.Location; 9 | import com.appleframework.auto.service.utils.PoiUtils; 10 | import com.appleframework.cache.core.CacheManager; 11 | import com.appleframework.exception.ServiceException; 12 | 13 | @Service("locationNewestService") 14 | public class LocationNewestServiceImpl implements LocationNewestService { 15 | 16 | protected final static Logger logger = Logger.getLogger(LocationNewestServiceImpl.class); 17 | 18 | @Resource 19 | private CacheManager cacheManager; 20 | 21 | @Override 22 | public Location newest(String account, int mapType) throws ServiceException { 23 | Location location = cacheManager.get(account, Location.class); 24 | if(null != location) { 25 | PoiUtils.fixPoi(location, mapType); 26 | } 27 | return location; 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/location/LocationSearchServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.apache.log4j.Logger; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.appleframework.auto.bean.location.Location; 11 | import com.appleframework.auto.service.location.key.LocationRowkey; 12 | import com.appleframework.auto.service.utils.PoiUtils; 13 | import com.appleframework.data.hbase.client.SimpleHbaseClient; 14 | import com.appleframework.exception.ServiceException; 15 | 16 | @Service("locationSearchService") 17 | public class LocationSearchServiceImpl implements LocationSearchService { 18 | 19 | protected final static Logger logger = Logger.getLogger(LocationSearchServiceImpl.class); 20 | 21 | @Resource 22 | private SimpleHbaseClient locationHbaseDao; 23 | 24 | @Override 25 | public List search(String account, long startTime, long endTime, int mapType) throws ServiceException { 26 | LocationRowkey startRowKey = LocationRowkey.create(account, startTime); 27 | LocationRowkey endRowKey = LocationRowkey.create(account, endTime); 28 | List list = locationHbaseDao.findObjectList(startRowKey, endRowKey, Location.class); 29 | for (Location location : list) { 30 | PoiUtils.fixPoi(location, mapType); 31 | } 32 | return list; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/location/key/LocationRowkey.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location.key; 2 | 3 | import org.apache.hadoop.hbase.util.Bytes; 4 | 5 | import com.appleframework.auto.bean.location.Location; 6 | import com.appleframework.auto.service.utils.StringUtils; 7 | import com.appleframework.data.hbase.client.RowKey; 8 | 9 | public class LocationRowkey implements RowKey { 10 | 11 | private String row; 12 | 13 | public LocationRowkey(Location bo) { 14 | String account = bo.getAccount(); 15 | String accountS = StringUtils.zeroBeforeFill(account, 16); 16 | this.row = accountS + bo.getTime(); 17 | } 18 | 19 | public LocationRowkey(String row) { 20 | this.row = row; 21 | } 22 | 23 | public LocationRowkey(String account, long time) { 24 | String accountS = StringUtils.zeroBeforeFill(account, 16); 25 | this.row = accountS + time; 26 | } 27 | 28 | 29 | public static LocationRowkey create(Location bo) { 30 | return new LocationRowkey(bo); 31 | } 32 | 33 | public static LocationRowkey create(String row) { 34 | return new LocationRowkey(row); 35 | } 36 | 37 | public static LocationRowkey create(String account, long time) { 38 | return new LocationRowkey(account, time); 39 | } 40 | 41 | @Override 42 | public byte[] toBytes() { 43 | return Bytes.toBytes(row); 44 | } 45 | 46 | public String getRow() { 47 | return row; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return row; 53 | } 54 | 55 | 56 | 57 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/mapper/FenceEntityMapper.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.mapper; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import com.appleframework.auto.entity.fence.FenceEntity; 6 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 7 | 8 | @Repository 9 | public interface FenceEntityMapper { 10 | 11 | int deleteByPrimaryKey(Integer id); 12 | 13 | int insert(FenceEntityWithBLOBs record); 14 | 15 | int insertSelective(FenceEntityWithBLOBs record); 16 | 17 | FenceEntityWithBLOBs selectByPrimaryKey(Integer id); 18 | 19 | int updateByPrimaryKeySelective(FenceEntityWithBLOBs record); 20 | 21 | int updateByPrimaryKeyWithBLOBs(FenceEntityWithBLOBs record); 22 | 23 | int updateByPrimaryKey(FenceEntity record); 24 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/mapper/FenceExtendMapper.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.mapper; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.appleframework.auto.entity.fence.FenceEntity; 9 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 10 | import com.appleframework.auto.model.fence.FenceSo; 11 | import com.appleframework.model.Search; 12 | import com.appleframework.model.page.Pagination; 13 | 14 | @Repository 15 | public interface FenceExtendMapper { 16 | 17 | List selectAll(); 18 | 19 | List selectPage(@Param("page") Pagination page, @Param("so") FenceSo so, @Param("se") Search se); 20 | 21 | } -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/utils/Constants.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.utils; 2 | 3 | public interface Constants { 4 | 5 | /* 6 | * type 7 | * 0:google转百度, 8 | * 1:google转gps, 9 | * 2:百度转google, 10 | * 3:百度转gps, 11 | * 4:gps转google, 12 | * 5:gps转百度 13 | */ 14 | public static int MAP_CONVERT_GOOGLE_TO_BAIDU = 0; 15 | public static int MAP_CONVERT_GOOGLE_TO_GPS = 1; 16 | public static int MAP_CONVERT_BAIDU_TO_GOOGLE = 2; 17 | public static int MAP_CONVERT_BAIDU_TO_GPS = 3; 18 | public static int MAP_CONVERT_GPS_TO_GOOGLE = 4; 19 | public static int MAP_CONVERT_GPS_TO_BAIDU = 5; 20 | 21 | public static String KEY_LATITUDE = "latitude"; 22 | public static String KEY_LONGITUDE = "longitude"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/utils/ListUtil.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class ListUtil { 7 | 8 | public static List string2DoubleList(String args) { 9 | String[] arrays = args.split(","); 10 | List list = new ArrayList<>(arrays.length); 11 | for (int i = 0; i < arrays.length; i++) { 12 | String string = arrays[i]; 13 | list.add(Double.parseDouble(string)); 14 | } 15 | return list; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/utils/PoiUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.utils; 2 | 3 | 4 | import com.appleframework.auto.bean.fence.Point; 5 | import com.appleframework.auto.bean.location.Location; 6 | import com.appleframework.util.map.utility.GpsUtility; 7 | 8 | public class PoiUtils { 9 | 10 | public static void fixPoi(Location location, int mapType) { 11 | Double latitude = location.getLatitude(); 12 | Double longitude = location.getLongitude(); 13 | String[] ps = GpsUtility.convert2(latitude, longitude, mapType); 14 | location.setLatitude(Double.parseDouble(ps[0])); 15 | location.setLongitude(Double.parseDouble(ps[1])); 16 | } 17 | 18 | public static void fixPoi(Point point, int mapType) { 19 | Double latitude = point.getLatitude(); 20 | Double longitude = point.getLongitude(); 21 | String[] ps = GpsUtility.convert2(latitude, longitude, mapType); 22 | point.setLatitude(Double.parseDouble(ps[0])); 23 | point.setLongitude(Double.parseDouble(ps[1])); 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/java/com/appleframework/auto/service/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.utils; 2 | 3 | public class StringUtils { 4 | 5 | public static String zeroAfterFill(String message, int size) { 6 | int length = message.length(); 7 | if (length >= size) { 8 | return message; 9 | } else { 10 | String zeroStr = ""; 11 | int differLength = size - length; 12 | for (int i = 1; i <= differLength; i++) { 13 | zeroStr += "0"; 14 | } 15 | return message + zeroStr; 16 | } 17 | } 18 | 19 | public static String zeroBeforeFill(String message, int size) { 20 | int length = message.length(); 21 | if (length >= size) { 22 | return message; 23 | } else { 24 | String zeroStr = ""; 25 | int differLength = size - length; 26 | for (int i = 1; i <= differLength; i++) { 27 | zeroStr += "0"; 28 | } 29 | return zeroStr + message; 30 | } 31 | } 32 | 33 | public static void main(String[] args) { 34 | System.out.println(StringUtils.zeroBeforeFill("234", 10)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/resources/hbase/hbase-journey.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/main/resources/hbase/hbase-location.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/java/com/appleframework/auto/service/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 10 | public class AppTest { 11 | 12 | @Test 13 | public void testAddOpinion1() { 14 | try { 15 | System.in.read(); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/java/com/appleframework/auto/service/fence/FenceEntityServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.fence; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.appleframework.auto.entity.fence.FenceEntityWithBLOBs; 13 | import com.appleframework.exception.ServiceException; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 17 | public class FenceEntityServiceTest { 18 | 19 | @Resource 20 | private FenceCacheService fenceCacheService; 21 | 22 | @Resource 23 | private FenceInfoService fenceInfoService; 24 | 25 | @Resource 26 | private FenceEntityService fenceEntityService; 27 | 28 | @Test 29 | public void get() { 30 | try { 31 | fenceCacheService.clear(); 32 | List list = fenceEntityService.findAll(); 33 | for (FenceEntityWithBLOBs entity : list) { 34 | System.out.println(entity.toString()); 35 | fenceInfoService.create(entity); 36 | } 37 | System.out.println("------------------------------------"); 38 | } catch (ServiceException e) { 39 | e.printStackTrace(); 40 | } 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/java/com/appleframework/auto/service/journey/JourneySearchServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.journey; 2 | 3 | import java.util.Date; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.appleframework.auto.bean.location.Journey; 13 | import com.appleframework.model.page.Pagination; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 17 | public class JourneySearchServiceTest { 18 | 19 | @Resource 20 | private JourneySearchService journeySearchService; 21 | 22 | @SuppressWarnings("deprecation") 23 | @Test 24 | public void get() { 25 | try { 26 | Date date = new Date(); 27 | date.setDate(date.getDate() - 1); 28 | Pagination page = new Pagination(1, 5); 29 | String account = "xusm"; 30 | 31 | page = journeySearchService.search(page, account, date.getTime()); 32 | for (Object entity : page.getList()) { 33 | Journey journey = (Journey) entity; 34 | System.out.println(journey.toString()); 35 | } 36 | System.out.println("------------------------------------"); 37 | } catch (Exception e) { 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/java/com/appleframework/auto/service/location/LocationNewestServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.test.context.ContextConfiguration; 8 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 9 | 10 | import com.appleframework.auto.bean.location.Location; 11 | 12 | @RunWith(SpringJUnit4ClassRunner.class) 13 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 14 | public class LocationNewestServiceTest { 15 | 16 | @Resource 17 | private LocationNewestService locationNewestService; 18 | 19 | @Test 20 | public void testAddOpinion1() { 21 | try { 22 | String account = "2017061401"; 23 | for (int i = 0; i < 120000; i++) { 24 | Location location = locationNewestService.newest(account, 1); 25 | System.out.println(location); 26 | Thread.sleep(1000); 27 | } 28 | System.in.read(); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/java/com/appleframework/auto/service/location/LocationSearchServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.service.location; 2 | 3 | import java.text.DateFormat; 4 | import java.text.SimpleDateFormat; 5 | import java.util.List; 6 | 7 | import javax.annotation.Resource; 8 | 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.springframework.test.context.ContextConfiguration; 12 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 13 | 14 | import com.appleframework.auto.bean.location.Location; 15 | 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 18 | public class LocationSearchServiceTest { 19 | 20 | @Resource 21 | private LocationSearchService locationSearchService; 22 | 23 | private DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); 24 | 25 | @Test 26 | public void testAddOpinion1() { 27 | try { 28 | String date = "2017-06-13"; 29 | String account = "2017061301"; 30 | long startTime = format.parse(date).getTime(); 31 | long endTime = startTime + 86400000L; 32 | List list = locationSearchService.search(account, startTime, endTime, 1); 33 | for (Location location : list) { 34 | System.out.println(location); 35 | } 36 | System.in.read(); 37 | } catch (Exception e) { 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][service-provider] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/service-provider/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][service-provider] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-service/apple-auto-service-provider/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-service-provider 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | service.port=9003 6 | 7 | #test dev beta realse 8 | deploy.dataId=service-provider 9 | deploy.group=apple-auto 10 | deploy.env=dev 11 | 12 | #dubbo 13 | application.owner=xusm 14 | registry.address=zookeeper://localhost:2181 15 | 16 | #cache 17 | redis.masterAddressUri=192.168.1.177:6379 18 | redis.slaveAddressUris=192.168.1.177:6379 19 | redis.database=12 20 | redis.fence.topic=KEY_FENCE_TOPIC 21 | redis.fence.map=KEY_FENCE_MAP 22 | 23 | 24 | #hbase 25 | fs.default.name=hdfs://cluster1 26 | hbase.rootdir=hdfs://cluster1/hbase 27 | hbase.zookeeper.quorum=hdpc1-dn001:2181,hdpc1-dn002:2181,hdpc1-dn003:2181 28 | hbase.zookeeper.property.dataDir=/data/zookeeper/data 29 | hbase.table.auto.flush=true 30 | hbase.table.name.comment=location 31 | hbase.table.name.journey=journey_test 32 | 33 | #jdbc 34 | jdbc.driver=com.mysql.jdbc.Driver 35 | jdbc.url=jdbc:mysql://192.168.1.189:3366/crawler-demo?useUnicode=true&characterEncoding=UTF-8 36 | jdbc.username=dba 37 | jdbc.password=mysql 38 | 39 | pool.initialSize=20 40 | pool.minPoolSize=20 41 | pool.maxActive=40 42 | pool.maxIdle=20 43 | pool.minIdle=5 44 | pool.maxWait=60000 45 | pool.timeBetweenEvictionRunsMillis=60000 46 | pool.minEvictableIdleTimeMillis=25200000 47 | pool.removeAbandonedTimeout=1800 -------------------------------------------------------------------------------- /apple-auto-service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.appleframework.auto 7 | apple-auto 8 | 0.0.2.RELEASE 9 | 10 | apple-auto-service 11 | apple-auto-service 12 | http://maven.apache.org 13 | pom 14 | 15 | apple-auto-service-common 16 | apple-auto-service-provider 17 | 18 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | src/main/assembly/bin 10 | bin 11 | 0755 12 | 13 | 14 | src/main/assembly/conf 15 | conf 16 | 0644 17 | 18 | 19 | 20 | 21 | lib 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-location] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/storager-journey/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-journey] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-storager-journey 2 | application.version=2.0.0 3 | 4 | jmx.port=2008 5 | 6 | #test dev beta realse 7 | deploy.dataId=storager-journey 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | #kafka 12 | zookeeper.connect=118.178.252.65:2182 13 | group.id=storager_journey_12 14 | consumer.topic=journey_v1 15 | consumer.partitionsNum=16 16 | 17 | metadata.broker.list=118.178.252.65:9092 18 | producer.topic=journey 19 | 20 | #cache 21 | hazelcast.members=192.168.1.250,192.168.1.247 22 | 23 | #hbase 24 | fs.default.name=hdfs://cluster1 25 | hbase.rootdir=hdfs://cluster1/hbase 26 | hbase.zookeeper.quorum=hdpc1-dn001:2181,hdpc1-dn002:2181,hdpc1-dn003:2181 27 | hbase.zookeeper.property.dataDir=/data/zookeeper/data 28 | hbase.table.auto.flush=true 29 | hbase.table.name.journey=journey_test 30 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/java/com/appleframework/auto/storager/journey/consumer/JourneyConsumer.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.journey.consumer; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import com.appleframework.auto.bean.location.Journey; 6 | import com.appleframework.auto.storager.journey.service.HbaseJourneyService; 7 | import com.appleframework.jms.kafka.consumer.ObjectMessageConsumer; 8 | 9 | public class JourneyConsumer extends ObjectMessageConsumer { 10 | 11 | @Resource 12 | private HbaseJourneyService hbaseJourneyService; 13 | 14 | @Override 15 | public void processMessage(Object message) { 16 | try { 17 | if (message instanceof Journey) { 18 | Journey journey = (Journey) message; 19 | hbaseJourneyService.save(journey); 20 | } 21 | } catch (Exception e) { 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/java/com/appleframework/auto/storager/journey/service/HbaseJourneyService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.journey.service; 2 | 3 | import com.appleframework.auto.bean.location.Journey; 4 | 5 | public interface HbaseJourneyService { 6 | 7 | public void save(Journey journey); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/java/com/appleframework/auto/storager/journey/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.journey.utils; 2 | 3 | public class StringUtils { 4 | 5 | public static String zeroAfterFill(String message, int size) { 6 | int length = message.length(); 7 | if (length >= size) { 8 | return message; 9 | } else { 10 | String zeroStr = ""; 11 | int differLength = size - length; 12 | for (int i = 1; i <= differLength; i++) { 13 | zeroStr += "0"; 14 | } 15 | return message + zeroStr; 16 | } 17 | } 18 | 19 | public static String zeroBeforeFill(String message, int size) { 20 | int length = message.length(); 21 | if (length >= size) { 22 | return message; 23 | } else { 24 | String zeroStr = ""; 25 | int differLength = size - length; 26 | for (int i = 1; i <= differLength; i++) { 27 | zeroStr += "0"; 28 | } 29 | return zeroStr + message; 30 | } 31 | } 32 | 33 | public static void main(String[] args) { 34 | System.out.println(StringUtils.zeroBeforeFill("234", 10)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/main/resources/hbase/hbase-journey.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/test/java/com/appleframework/auto/storager/Journey/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.Journey; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 10 | public class AppTest { 11 | 12 | @Test 13 | public void testAddOpinion1() { 14 | try { 15 | System.in.read(); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/test/java/com/appleframework/auto/storager/Journey/HbaseJourneyServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.Journey; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.appleframework.auto.bean.location.Journey; 13 | import com.appleframework.auto.storager.journey.key.JourneyRowkey; 14 | import com.appleframework.data.hbase.client.SimpleHbaseClient; 15 | 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 18 | public class HbaseJourneyServiceTest { 19 | 20 | @Resource 21 | private SimpleHbaseClient locationHbaseDao; 22 | 23 | @Test 24 | public void testAddOpinion1() { 25 | try { 26 | String account = "xusm"; 27 | Long startTime = System.currentTimeMillis(); 28 | JourneyRowkey startRowKey = JourneyRowkey.create(account, startTime); 29 | List list = locationHbaseDao.findObjectList(startRowKey, 10000, Journey.class); 30 | for (Journey journey : list) { 31 | System.out.println(journey); 32 | } 33 | System.in.read(); 34 | } catch (Exception e) { 35 | e.printStackTrace(); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-location] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/storager-journey/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-journey] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-journey/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-storager-journey 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | 6 | #test dev beta realse 7 | deploy.dataId=storager-journey 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | #kafka 12 | zookeeper.connect=118.178.252.65:2182 13 | group.id=storager_journey_12 14 | consumer.topic=journey_v1 15 | consumer.partitionsNum=16 16 | 17 | metadata.broker.list=118.178.252.65:9092 18 | producer.topic=journey 19 | 20 | #cache 21 | hazelcast.members=192.168.1.250,192.168.1.247 22 | 23 | #hbase 24 | fs.default.name=hdfs://cluster1 25 | hbase.rootdir=hdfs://cluster1/hbase 26 | hbase.zookeeper.quorum=hdpc1-dn001:2181,hdpc1-dn002:2181,hdpc1-dn003:2181 27 | hbase.zookeeper.property.dataDir=/data/zookeeper/data 28 | hbase.table.auto.flush=true 29 | hbase.table.name.journey=journey_test 30 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | assembly 3 | 4 | tar.gz 5 | 6 | true 7 | 8 | 9 | src/main/assembly/bin 10 | bin 11 | 0755 12 | 13 | 14 | src/main/assembly/conf 15 | conf 16 | 0644 17 | 18 | 19 | 20 | 21 | lib 22 | 23 | 24 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/assembly/bin/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ENV=$1 3 | if [ -z "$ENV" ]; then 4 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 5 | echo "app exit" 6 | exit 1 7 | fi 8 | cd `dirname $0` 9 | ./stop.sh 10 | ./start.sh $ENV $2 -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/assembly/bin/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | if [ "$1" = "start" ]; then 4 | ENV=$2 5 | if [ -z "$ENV" ]; then 6 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 7 | echo "app exit" 8 | exit 1 9 | fi 10 | ./start.sh $ENV 11 | else 12 | if [ "$1" = "stop" ]; then 13 | ./stop.sh 14 | else 15 | if [ "$1" = "debug" ]; then 16 | ENV=$2 17 | if [ -z "$ENV" ]; then 18 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 19 | echo "app exit" 20 | exit 1 21 | fi 22 | ./start.sh $ENV debug 23 | else 24 | if [ "$1" = "restart" ]; then 25 | ENV=$2 26 | if [ -z "$ENV" ]; then 27 | echo "ERROR:PLEASE SPEC ENV ARGS,SUCH AS dev,test,beta,release.. " 28 | echo "app exit" 29 | exit 1 30 | fi 31 | ./restart.sh $ENV 32 | else 33 | if [ "$1" = "dump" ]; then 34 | ./dump.sh 35 | else 36 | echo "ERROR: Please input argument: start or stop or debug or restart or dump" 37 | exit 1 38 | fi 39 | fi 40 | fi 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/assembly/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | BIN_DIR=`pwd` 4 | cd .. 5 | DEPLOY_DIR=`pwd` 6 | CONF_DIR=$DEPLOY_DIR/conf 7 | 8 | SERVER_NAME=`sed '/application.name/!d;s/.*=//' conf/system.properties | tr -d '\r'` 9 | 10 | if [ -z "$SERVER_NAME" ]; then 11 | SERVER_NAME=`hostname` 12 | fi 13 | 14 | PIDS=`ps -ef | grep java | grep "$CONF_DIR" |awk '{print $2}'` 15 | if [ -z "$PIDS" ]; then 16 | echo "ERROR: The $SERVER_NAME does not started!" 17 | exit 1 18 | fi 19 | 20 | if [ "$1" != "skip" ]; then 21 | $BIN_DIR/dump.sh 22 | fi 23 | 24 | echo -e "Stopping the $SERVER_NAME ...\c" 25 | for PID in $PIDS ; do 26 | kill $PID > /dev/null 2>&1 27 | done 28 | 29 | COUNT=0 30 | while [ $COUNT -lt 1 ]; do 31 | echo -e ".\c" 32 | sleep 1 33 | COUNT=1 34 | for PID in $PIDS ; do 35 | PID_EXIST=`ps -f -p $PID | grep java` 36 | if [ -n "$PID_EXIST" ]; then 37 | COUNT=0 38 | break 39 | fi 40 | done 41 | done 42 | 43 | echo "OK!" 44 | echo "PID: $PIDS" 45 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/assembly/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=debug,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-location] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/storager-location/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-location] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/assembly/conf/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-storager-location 2 | application.version=2.0.0 3 | 4 | jmx.port=2009 5 | 6 | #test dev beta realse 7 | deploy.dataId=storager-location 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | #kafka 12 | zookeeper.connect=118.178.252.65:2182 13 | group.id=storager_location_99 14 | consumer.topic=location_v1 15 | consumer.partitionsNum=16 16 | 17 | metadata.broker.list=118.178.252.65:9092 18 | producer.topic=location 19 | 20 | #cache 21 | hazelcast.members=192.168.1.250,192.168.1.247 22 | 23 | #hbase 24 | fs.default.name=hdfs://cluster1 25 | hbase.rootdir=hdfs://cluster1/hbase 26 | hbase.zookeeper.quorum=hdpc1-dn001:2181,hdpc1-dn002:2181,hdpc1-dn003:2181 27 | hbase.zookeeper.property.dataDir=/data/zookeeper/data 28 | hbase.table.auto.flush=true 29 | hbase.table.name.comment=location 30 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/consumer/LocationConsumer.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.consumer; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import com.appleframework.auto.bean.location.Location; 6 | import com.appleframework.auto.storager.location.service.HbaseLocationService; 7 | import com.appleframework.auto.storager.location.service.NewestLocationService; 8 | import com.appleframework.jms.kafka.consumer.ObjectMessageConsumer; 9 | 10 | public class LocationConsumer extends ObjectMessageConsumer { 11 | 12 | @Resource 13 | private HbaseLocationService hbaseLocationService; 14 | 15 | @Resource 16 | private NewestLocationService newestLocationService; 17 | 18 | @Override 19 | public void processMessage(Object message) { 20 | try { 21 | if (message instanceof Location) { 22 | Location location = (Location) message; 23 | hbaseLocationService.save(location); 24 | newestLocationService.save(location); 25 | } 26 | } catch (Exception e) { 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/key/LocationRowkey.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.key; 2 | 3 | import org.apache.hadoop.hbase.util.Bytes; 4 | 5 | import com.appleframework.auto.bean.location.Location; 6 | import com.appleframework.auto.storager.location.utils.StringUtils; 7 | import com.appleframework.data.hbase.client.RowKey; 8 | 9 | public class LocationRowkey implements RowKey { 10 | 11 | private String row; 12 | 13 | public LocationRowkey(Location bo) { 14 | String account = bo.getAccount(); 15 | String accountS = StringUtils.zeroBeforeFill(account, 16); 16 | this.row = accountS + bo.getTime(); 17 | } 18 | 19 | public LocationRowkey(String row) { 20 | this.row = row; 21 | } 22 | 23 | 24 | public static LocationRowkey create(Location bo) { 25 | return new LocationRowkey(bo); 26 | } 27 | 28 | public static LocationRowkey create(String row) { 29 | return new LocationRowkey(row); 30 | } 31 | 32 | @Override 33 | public byte[] toBytes() { 34 | return Bytes.toBytes(row); 35 | } 36 | 37 | public String getRow() { 38 | return row; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return row; 44 | } 45 | 46 | 47 | 48 | } -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/service/HbaseLocationService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.service; 2 | 3 | import com.appleframework.auto.bean.location.Location; 4 | 5 | public interface HbaseLocationService { 6 | 7 | public void save(Location location); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/service/NewestLocationService.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.service; 2 | 3 | import com.appleframework.auto.bean.location.Location; 4 | 5 | public interface NewestLocationService { 6 | 7 | public void save(Location location); 8 | 9 | } -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/service/impl/HbaseLocationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.apache.log4j.Logger; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.appleframework.auto.bean.location.Location; 9 | import com.appleframework.auto.storager.location.key.LocationRowkey; 10 | import com.appleframework.auto.storager.location.service.HbaseLocationService; 11 | import com.appleframework.data.hbase.client.RowKey; 12 | import com.appleframework.data.hbase.client.SimpleHbaseClient; 13 | 14 | @Service("hbaseLocationService") 15 | public class HbaseLocationServiceImpl implements HbaseLocationService { 16 | 17 | protected final static Logger logger = Logger.getLogger(HbaseLocationServiceImpl.class); 18 | 19 | @Resource 20 | private SimpleHbaseClient locationHbaseDao; 21 | 22 | @Override 23 | public void save(Location location) { 24 | RowKey rowKey = LocationRowkey.create(location); 25 | if(logger.isDebugEnabled()) { 26 | logger.debug(rowKey); 27 | } 28 | locationHbaseDao.putObject(rowKey, location); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/service/impl/NewestLocationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.service.impl; 2 | 3 | import java.util.Map; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.apache.log4j.Logger; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.appleframework.auto.bean.location.Location; 11 | import com.appleframework.auto.storager.location.service.NewestLocationService; 12 | import com.hazelcast.core.HazelcastInstance; 13 | 14 | @Service("newestLocationService") 15 | public class NewestLocationServiceImpl implements NewestLocationService { 16 | 17 | protected final static Logger logger = Logger.getLogger(HbaseLocationServiceImpl.class); 18 | 19 | @Resource 20 | private HazelcastInstance hazelcastInstance; 21 | 22 | @Override 23 | public void save(Location location) { 24 | Map newestLocationMap = hazelcastInstance.getMap("NEWEST_LOCATION"); 25 | String account = location.getAccount(); 26 | if(logger.isDebugEnabled()) { 27 | logger.debug(account); 28 | } 29 | newestLocationMap.put(location.getAccount(), location); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/java/com/appleframework/auto/storager/location/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location.utils; 2 | 3 | public class StringUtils { 4 | 5 | public static String zeroAfterFill(String message, int size) { 6 | int length = message.length(); 7 | if (length >= size) { 8 | return message; 9 | } else { 10 | String zeroStr = ""; 11 | int differLength = size - length; 12 | for (int i = 1; i <= differLength; i++) { 13 | zeroStr += "0"; 14 | } 15 | return message + zeroStr; 16 | } 17 | } 18 | 19 | public static String zeroBeforeFill(String message, int size) { 20 | int length = message.length(); 21 | if (length >= size) { 22 | return message; 23 | } else { 24 | String zeroStr = ""; 25 | int differLength = size - length; 26 | for (int i = 1; i <= differLength; i++) { 27 | zeroStr += "0"; 28 | } 29 | return zeroStr + message; 30 | } 31 | } 32 | 33 | public static void main(String[] args) { 34 | System.out.println(StringUtils.zeroBeforeFill("234", 10)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/resources/config/spring-cache.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/resources/config/spring-hbase.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | classpath:/hbase/hbase-location.xml 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/main/resources/hbase/hbase-location.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/test/java/com/appleframework/auto/storager/location/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 10 | public class AppTest { 11 | 12 | @Test 13 | public void testAddOpinion1() { 14 | try { 15 | System.in.read(); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/test/java/com/appleframework/auto/storager/location/HbaseLocationServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.appleframework.auto.bean.location.Location; 13 | import com.appleframework.auto.storager.location.key.LocationRowkey; 14 | import com.appleframework.data.hbase.client.SimpleHbaseClient; 15 | 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 18 | public class HbaseLocationServiceTest { 19 | 20 | @Resource 21 | private SimpleHbaseClient locationHbaseDao; 22 | 23 | @Test 24 | public void testAddOpinion1() { 25 | try { 26 | LocationRowkey startRowKey = LocationRowkey.create("00000020170613011497318232000"); 27 | List list = locationHbaseDao.findObjectList(startRowKey, 10000, Location.class); 28 | for (Location location : list) { 29 | System.out.println(location); 30 | } 31 | System.in.read(); 32 | } catch (Exception e) { 33 | e.printStackTrace(); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/test/java/com/appleframework/auto/storager/location/PlaybackLocationServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.appleframework.auto.storager.location; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.appleframework.auto.bean.location.Location; 13 | import com.appleframework.auto.storager.location.key.LocationRowkey; 14 | import com.appleframework.data.hbase.client.SimpleHbaseClient; 15 | import com.appleframework.jms.core.producer.MessageProducer; 16 | 17 | @RunWith(SpringJUnit4ClassRunner.class) 18 | @ContextConfiguration(locations = { "classpath*:config/spring-*.xml" }) 19 | public class PlaybackLocationServiceTest { 20 | 21 | @Resource 22 | private SimpleHbaseClient locationHbaseDao; 23 | 24 | @Resource 25 | private MessageProducer messageProducer; 26 | 27 | @Test 28 | public void testAddOpinion1() { 29 | try { 30 | LocationRowkey startRowKey = LocationRowkey.create("00000020170614010000000000000"); 31 | List list = locationHbaseDao.findObjectList(startRowKey, 100000, Location.class); 32 | for (Location location : list) { 33 | messageProducer.sendObject(location); 34 | } 35 | System.in.read(); 36 | } catch (Exception e) { 37 | e.printStackTrace(); 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=debug,out,logToFile 2 | 3 | #appender 4 | log4j.appender.out=org.apache.log4j.ConsoleAppender 5 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.out.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-location] [%C->%M(%L)] %m%n 7 | 8 | log4j.appender.logToFile=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.logToFile.File=/work/logs/apple-auto/storager-location/localhost.log 10 | log4j.appender.logToFile.DatePattern='.'yyyy-MM-dd 11 | log4j.appender.logToFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.logToFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}][storager-location] [%C->%M(%L)] %m%n -------------------------------------------------------------------------------- /apple-auto-storager/apple-auto-storager-location/src/test/resources/system.properties: -------------------------------------------------------------------------------- 1 | application.name=apple-auto-storager-location 2 | application.version=2.0.0 3 | 4 | jmx.port=2003 5 | 6 | #test dev beta realse 7 | deploy.dataId=storager-location 8 | deploy.group=apple-auto 9 | deploy.env=dev 10 | 11 | #kafka 12 | zookeeper.connect=118.178.252.65:2182 13 | group.id=storager_location_99 14 | consumer.topic=location_v1 15 | consumer.partitionsNum=16 16 | 17 | metadata.broker.list=118.178.252.65:9092 18 | producer.topic=location 19 | 20 | #cache 21 | hazelcast.members=192.168.1.250,192.168.1.247 22 | 23 | #hbase 24 | fs.default.name=hdfs://cluster1 25 | hbase.rootdir=hdfs://cluster1/hbase 26 | hbase.zookeeper.quorum=hdpc1-dn001:2181,hdpc1-dn002:2181,hdpc1-dn003:2181 27 | hbase.zookeeper.property.dataDir=/data/zookeeper/data 28 | hbase.table.auto.flush=true 29 | hbase.table.name.comment=location 30 | -------------------------------------------------------------------------------- /apple-auto-storager/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.appleframework.auto 6 | apple-auto 7 | 0.0.2.RELEASE 8 | 9 | apple-auto-storager 10 | apple-auto-storager 11 | http://maven.apache.org 12 | pom 13 | 14 | apple-auto-storager-location 15 | apple-auto-storager-journey 16 | 17 | --------------------------------------------------------------------------------