From 3b55d06b89bf64873e685c3d78fce5affbba3d17 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Tue, 16 Apr 2019 11:20:38 +0900 Subject: Add warehouse server source code. [Patch Set 2] Add ReadMe.md Change-Id: I6ade52d2490f5ca4ba107c1a27ed6d5b39048725 Signed-off-by: zheng_wenlong --- .gitreview | 6 + LICENSE | 204 ++ Readme/ReadMe.md | 650 +++++ Readme/img/create_war1.PNG | Bin 0 -> 162798 bytes Readme/img/create_war2.PNG | Bin 0 -> 63188 bytes Readme/img/maven_import.PNG | Bin 0 -> 107404 bytes Readme/img/maven_import1.PNG | Bin 0 -> 59194 bytes Readme/img/maven_import2.PNG | Bin 0 -> 92326 bytes Readme/img/maven_model_start.PNG | Bin 0 -> 126382 bytes Readme/img/maven_update.PNG | Bin 0 -> 161963 bytes Readme/img/new_maven_model.PNG | Bin 0 -> 52691 bytes Readme/img/new_maven_model2.PNG | Bin 0 -> 90364 bytes Readme/img/new_maven_model3.PNG | Bin 0 -> 50649 bytes Readme/img/new_maven_project.PNG | Bin 0 -> 51571 bytes Readme/img/new_maven_project2.PNG | Bin 0 -> 55929 bytes Readme/img/new_maven_project_start.PNG | Bin 0 -> 101583 bytes appmarket-core/pom.xml | 38 + .../src/main/java/app/market/core/app/AppCore.java | 92 + .../java/app/market/core/app/impl/AppCoreImpl.java | 119 + .../app/market/core/authority/AuthorityCore.java | 32 + .../core/authority/impl/AuthorityCoreImpl.java | 54 + .../app/market/core/resource/DictionaryCore.java | 36 + .../app/market/core/resource/ResourceCore.java | 26 + .../core/resource/impl/DictionaryCoreImpl.java | 69 + .../core/resource/impl/ResourceCoreImpl.java | 40 + .../main/java/app/market/core/user/UserCore.java | 106 + .../app/market/core/user/impl/UserCoreImpl.java | 148 ++ appmarket-model/pom.xml | 37 + .../src/main/java/app/market/model/TokenModel.java | 48 + .../src/main/java/app/market/model/app/App.java | 247 ++ .../main/java/app/market/model/app/AppExample.java | 1049 ++++++++ .../main/java/app/market/model/app/AppVersion.java | 119 + .../app/market/model/app/AppVersionExample.java | 903 +++++++ .../main/java/app/market/model/app/FileInfo.java | 101 + .../java/app/market/model/authority/Authority.java | 48 + .../market/model/authority/AuthorityExample.java | 425 ++++ .../authority/AuthorityResourceLinkExample.java | 355 +++ .../model/authority/AuthorityResourceLinkKey.java | 38 + .../app/market/model/errors/ResponseErrors.java | 68 + .../java/app/market/model/resource/Dictionary.java | 58 + .../market/model/resource/DictionaryExample.java | 485 ++++ .../java/app/market/model/resource/Resource.java | 76 + .../app/market/model/resource/ResourceExample.java | 502 ++++ .../src/main/java/app/market/model/user/User.java | 130 + .../model/user/UserAuthorityLinkExample.java | 362 +++ .../market/model/user/UserAuthorityLinkKey.java | 45 + .../java/app/market/model/user/UserExample.java | 698 +++++ appmarket-persistence/pom.xml | 55 + .../interceptor/PaginationInterceptor.java | 74 + .../market/persistence/mapper/app/AppMapper.java | 61 + .../persistence/mapper/app/AppVersionMapper.java | 51 + .../mapper/authority/AuthorityMapper.java | 49 + .../authority/AuthorityResourceLinkMapper.java | 43 + .../mapper/resource/DictionaryMapper.java | 51 + .../mapper/resource/ResourceMapper.java | 49 + .../mapper/user/UserAuthorityLinkMapper.java | 43 + .../market/persistence/mapper/user/UserMapper.java | 70 + .../app/market/persistence/xml/app/AppMapper.xml | 368 +++ .../persistence/xml/app/AppVersionMapper.xml | 298 +++ .../persistence/xml/authority/AuthorityMapper.xml | 194 ++ .../xml/authority/AuthorityResourceLinkMapper.xml | 146 ++ .../persistence/xml/resource/DictionaryMapper.xml | 202 ++ .../persistence/xml/resource/ResourceMapper.xml | 220 ++ .../xml/user/UserAuthorityLinkMapper.xml | 146 ++ .../app/market/persistence/xml/user/UserMapper.xml | 308 +++ .../test/java/app/market/persisitence/AppTest.java | 53 + appmarket-utils/pom.xml | 47 + .../src/main/java/app/market/utils/Md5Util.java | 39 + .../main/java/app/market/utils/RuntimeUtil.java | 66 + .../main/java/app/market/utils/SpringWebUtil.java | 80 + .../src/main/java/app/market/utils/Utils.java | 136 + .../java/app/market/utils/constants/Constants.java | 158 ++ .../utils/constants/ProjectUserRoleEnum.java | 71 + .../app/market/utils/datatable/DataTableMap.java | 99 + .../app/market/utils/datetime/DateTimeUtils.java | 78 + .../app/market/utils/exception/ExceptionEnum.java | 32 + .../app/market/utils/json/JsonMapperUtils.java | 228 ++ .../java/app/market/utils/json/JsonMessage.java | 49 + .../java/app/market/utils/json/JsonResult.java | 60 + .../app/market/utils/property/KeysConstants.java | 110 + .../app/market/utils/property/MessageUtil.java | 55 + .../java/app/market/utils/property/Option.java | 78 + .../market/utils/property/PropertyContants.java | 22 + .../app/market/utils/property/PropertyUtil.java | 127 + .../app/market/utils/rest/RestTemplateUtil.java | 209 ++ .../java/app/market/utils/token/DeleteModel.java | 52 + .../java/app/market/utils/token/TokenModel.java | 100 + .../java/app/market/utils/webservice/ApiParam.java | 196 ++ .../app/market/utils/webservice/ErrorCode.java | 50 + .../app/market/utils/webservice/ErrorCodeEnum.java | 41 + .../app/market/utils/webservice/WebServiceURI.java | 77 + .../src/main/resources/message.ja.JP.properties | 98 + .../src/main/resources/message.ja.en.properties | 98 + .../src/test/java/app/market/utils/AppTest.java | 53 + database/appmarket.sql | 248 ++ database/appmarket_update_2.0-3.0.sql | 4 + pom.xml | 141 ++ warehouse/pom.xml | 107 + warehouse/release note.txt | 18 + warehouse/src/main/java/app/market/LogUtil.java | 25 + .../src/main/java/app/market/PropertyTool.java | 55 + .../src/main/java/app/market/WebServiceClient.java | 81 + .../src/main/java/app/market/filter/Filter.java | 37 + .../main/java/app/market/filter/Log4jlistener.java | 53 + .../market/web/controller/BreadcrumbMapping.java | 104 + .../market/web/controller/ControllerMapping.java | 45 + .../app/market/web/controller/PageMapping.java | 188 ++ .../web/controller/SpringBaseController.java | 101 + .../web/controller/account/AccountController.java | 336 +++ .../market/web/controller/app/AppController.java | 636 +++++ .../web/controller/login/LoginController.java | 158 ++ .../market/web/controller/main/MainController.java | 96 + .../web/controllerDev/appDev/AppControllerDev.java | 367 +++ .../web/controllerDev/login/package-info.java | 20 + .../controllerDev/mainDev/MainControllerDev.java | 86 + .../java/app/market/web/form/PaginationForm.java | 84 + .../main/java/app/market/web/form/TokenForm.java | 45 + .../app/market/web/form/account/AccountForm.java | 139 + .../main/java/app/market/web/form/app/AppForm.java | 255 ++ .../market/web/form/breadcrumb/BreadcrumbFrom.java | 36 + .../web/form/breadcrumb/BreadcrumbSubFrom.java | 52 + .../java/app/market/web/form/login/LoginForm.java | 99 + .../app/market/web/form/login/SessionForm.java | 79 + .../java/app/market/web/form/user/UserForm.java | 79 + .../app/market/web/services/SpringBaseService.java | 248 ++ .../web/services/account/AccountService.java | 76 + .../services/account/impl/AccountServiceImpl.java | 220 ++ .../app/market/web/services/app/AppService.java | 124 + .../web/services/app/impl/AppServiceImpl.java | 511 ++++ .../market/web/services/login/LoginService.java | 25 + .../web/services/login/impl/LoginServiceImpl.java | 81 + .../app/market/web/services/main/MainService.java | 27 + .../web/services/main/impl/MainServiceImpl.java | 71 + .../app/market/web/services/user/UserService.java | 35 + .../web/services/user/impl/UserServiceImpl.java | 141 ++ warehouse/src/main/resources/config/log4j.xml | 77 + .../main/resources/config/properties.properties | 7 + .../main/resources/config/spring-application.xml | 18 + .../src/main/resources/config/spring-servlet.xml | 59 + .../main/webapp/WEB-INF/pages/account/detail.jsp | 80 + .../src/main/webapp/WEB-INF/pages/account/list.jsp | 225 ++ .../main/webapp/WEB-INF/pages/account/modify.jsp | 178 ++ .../main/webapp/WEB-INF/pages/app/checkAppInfo.jsp | 115 + .../main/webapp/WEB-INF/pages/app/createApp.jsp | 112 + .../src/main/webapp/WEB-INF/pages/app/list.jsp | 393 +++ .../src/main/webapp/WEB-INF/pages/app/modify.jsp | 85 + .../main/webapp/WEB-INF/pages/app/saveAppInfo.jsp | 348 +++ .../src/main/webapp/WEB-INF/pages/app/type.jsp | 288 +++ .../main/webapp/WEB-INF/pages/appDev/detailDev.jsp | 87 + .../main/webapp/WEB-INF/pages/appDev/listDev.jsp | 85 + .../webapp/WEB-INF/pages/appDev/localListDev.jsp | 175 ++ .../main/webapp/WEB-INF/pages/appDev/searchDev.jsp | 155 ++ .../src/main/webapp/WEB-INF/pages/deleteDialog.jsp | 19 + warehouse/src/main/webapp/WEB-INF/pages/index.jsp | 145 ++ warehouse/src/main/webapp/WEB-INF/pages/main.jsp | 226 ++ .../src/main/webapp/WEB-INF/pages/mainDev.jsp | 261 ++ .../main/webapp/WEB-INF/pages/navigationDialog.jsp | 22 + .../src/main/webapp/WEB-INF/pages/other/404.jsp | 73 + .../src/main/webapp/WEB-INF/pages/other/500.jsp | 73 + warehouse/src/main/webapp/WEB-INF/pages/skip.jsp | 31 + warehouse/src/main/webapp/WEB-INF/web.xml | 89 + .../bootstrap-datetimepicker.min.css | Bin 0 -> 22598 bytes warehouse/src/main/webapp/css/bootstrap.min.css | 7 + .../src/main/webapp/css/bootstrap.min.css.map | 1 + .../dataTables-1.10.16/dataTables.bootstrap4.css | 206 ++ warehouse/src/main/webapp/css/font-awesome.min.css | 5 + warehouse/src/main/webapp/css/style.css | 728 ++++++ warehouse/src/main/webapp/fonts/FontAwesome.otf | Bin 0 -> 134808 bytes .../src/main/webapp/fonts/fontawesome-webfont.eot | Bin 0 -> 165742 bytes .../src/main/webapp/fonts/fontawesome-webfont.svg | 2671 ++++++++++++++++++++ .../src/main/webapp/fonts/fontawesome-webfont.ttf | Bin 0 -> 165548 bytes .../src/main/webapp/fonts/fontawesome-webfont.woff | Bin 0 -> 98024 bytes .../main/webapp/fonts/fontawesome-webfont.woff2 | Bin 0 -> 77160 bytes .../image/AGL_HMI_Blue_Background_Car-01.png | Bin 0 -> 785945 bytes warehouse/src/main/webapp/image/addPic.png | Bin 0 -> 531 bytes warehouse/src/main/webapp/image/appthum.jpg | Bin 0 -> 102492 bytes warehouse/src/main/webapp/image/defaultAppIcon.png | Bin 0 -> 115215 bytes .../src/main/webapp/image/insertAppCreate.PNG | Bin 0 -> 2736 bytes .../src/main/webapp/image/insertAppDetails.PNG | Bin 0 -> 2721 bytes .../src/main/webapp/image/insertAppSubmit.PNG | Bin 0 -> 2675 bytes warehouse/src/main/webapp/image/logo.png | Bin 0 -> 16381 bytes warehouse/src/main/webapp/image/transp_bg.png | Bin 0 -> 3738 bytes warehouse/src/main/webapp/image/user.png | Bin 0 -> 6758 bytes warehouse/src/main/webapp/js/AFB-websock.js | 199 ++ warehouse/src/main/webapp/js/AglSocket.js | 80 + .../main/webapp/js/angular-1.5.8/angular.min.js | 318 +++ .../js/bootstrap-4.0.0-beta/bootstrap.min.js | 7 + .../js/bootstrap-4.0.0-beta/popper/popper.min.js | 5 + .../bootstrap-datetimepicker.ja.js | 16 + .../bootstrap-datetimepicker.min.js | 1 + warehouse/src/main/webapp/js/common.js | 234 ++ warehouse/src/main/webapp/js/constant.js | 16 + .../dataTables.bootstrap4.min.js | 8 + .../dataTables-1.10.16/i18n/datatables-ja-JP.json | 23 + .../js/dataTables-1.10.16/jquery.dataTables.min.js | 164 ++ warehouse/src/main/webapp/js/deviceList.js | 199 ++ warehouse/src/main/webapp/js/download.js | 123 + warehouse/src/main/webapp/js/jquery.cookie.js | 117 + .../jquery/easing/jquery.easing.compatibility.js | 59 + .../webapp/js/jquery/easing/jquery.easing.min.js | 1 + .../src/main/webapp/js/jquery/form/jquery.form.js | 1277 ++++++++++ .../src/main/webapp/js/jquery/jqLoading.min.js | 1 + warehouse/src/main/webapp/js/jquery/jquery.min.js | 4 + warehouse/src/main/webapp/js/main.js | 74 + webservice/pom.xml | 113 + webservice/release note.txt | 19 + webservice/src/main/java/app/market/LogUtil.java | 25 + .../src/main/java/app/market/PropertyUtil.java | 82 + .../main/java/app/market/WebServiceConstants.java | 33 + .../src/main/java/app/market/common/comm.java | 51 + .../app/market/token/dao/RedisGeneratorDao.java | 48 + .../AuthenticationTokenInterceptor.java | 65 + .../market/token/service/RedisTokenManager.java | 268 ++ .../main/java/app/market/webservice/Filter.java | 40 + .../java/app/market/webservice/InitServer.java | 52 + .../java/app/market/webservice/Log4jlistener.java | 53 + .../app/market/webservice/WebServiceClient.java | 24 + .../webservice/WebserviceRestBaseController.java | 35 + .../market/webservice/app/AppRestController.java | 485 ++++ .../authority/AuthorityRestController.java | 66 + .../webservice/dataManager/AppFileController.java | 255 ++ .../market/webservice/dataManager/FileUtil.java | 248 ++ .../market/webservice/dataManager/XmlFactory.java | 43 + .../resource/DictionaryRestController.java | 124 + .../resource/ResourceRestController.java | 71 + .../webservice/token/TokenRestController.java | 37 + .../market/webservice/user/UserRestController.java | 482 ++++ .../src/main/resources/fileManager.properties | 6 + webservice/src/main/resources/log4j.xml | 77 + webservice/src/main/resources/mybatis-config.xml | 38 + .../src/main/resources/properties.properties | 7 + webservice/src/main/resources/redis-config.xml | 50 + webservice/src/main/resources/redis.properties | 13 + webservice/src/main/resources/servlet-context.xml | 56 + webservice/src/main/resources/spring-mybatis.xml | 68 + .../app/market/webservice/user/AppRestTest.java | 175 ++ .../app/market/webservice/user/UploadTest.java | 77 + .../app/market/webservice/user/UserRestTest.java | 75 + webservice/src/main/webapp/WEB-INF/web.xml | 94 + 239 files changed, 31162 insertions(+) create mode 100644 .gitreview create mode 100644 LICENSE create mode 100644 Readme/ReadMe.md create mode 100644 Readme/img/create_war1.PNG create mode 100644 Readme/img/create_war2.PNG create mode 100644 Readme/img/maven_import.PNG create mode 100644 Readme/img/maven_import1.PNG create mode 100644 Readme/img/maven_import2.PNG create mode 100644 Readme/img/maven_model_start.PNG create mode 100644 Readme/img/maven_update.PNG create mode 100644 Readme/img/new_maven_model.PNG create mode 100644 Readme/img/new_maven_model2.PNG create mode 100644 Readme/img/new_maven_model3.PNG create mode 100644 Readme/img/new_maven_project.PNG create mode 100644 Readme/img/new_maven_project2.PNG create mode 100644 Readme/img/new_maven_project_start.PNG create mode 100644 appmarket-core/pom.xml create mode 100644 appmarket-core/src/main/java/app/market/core/app/AppCore.java create mode 100644 appmarket-core/src/main/java/app/market/core/app/impl/AppCoreImpl.java create mode 100644 appmarket-core/src/main/java/app/market/core/authority/AuthorityCore.java create mode 100644 appmarket-core/src/main/java/app/market/core/authority/impl/AuthorityCoreImpl.java create mode 100644 appmarket-core/src/main/java/app/market/core/resource/DictionaryCore.java create mode 100644 appmarket-core/src/main/java/app/market/core/resource/ResourceCore.java create mode 100644 appmarket-core/src/main/java/app/market/core/resource/impl/DictionaryCoreImpl.java create mode 100644 appmarket-core/src/main/java/app/market/core/resource/impl/ResourceCoreImpl.java create mode 100644 appmarket-core/src/main/java/app/market/core/user/UserCore.java create mode 100644 appmarket-core/src/main/java/app/market/core/user/impl/UserCoreImpl.java create mode 100644 appmarket-model/pom.xml create mode 100644 appmarket-model/src/main/java/app/market/model/TokenModel.java create mode 100644 appmarket-model/src/main/java/app/market/model/app/App.java create mode 100644 appmarket-model/src/main/java/app/market/model/app/AppExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/app/AppVersion.java create mode 100644 appmarket-model/src/main/java/app/market/model/app/AppVersionExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/app/FileInfo.java create mode 100644 appmarket-model/src/main/java/app/market/model/authority/Authority.java create mode 100644 appmarket-model/src/main/java/app/market/model/authority/AuthorityExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/authority/AuthorityResourceLinkExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/authority/AuthorityResourceLinkKey.java create mode 100644 appmarket-model/src/main/java/app/market/model/errors/ResponseErrors.java create mode 100644 appmarket-model/src/main/java/app/market/model/resource/Dictionary.java create mode 100644 appmarket-model/src/main/java/app/market/model/resource/DictionaryExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/resource/Resource.java create mode 100644 appmarket-model/src/main/java/app/market/model/resource/ResourceExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/user/User.java create mode 100644 appmarket-model/src/main/java/app/market/model/user/UserAuthorityLinkExample.java create mode 100644 appmarket-model/src/main/java/app/market/model/user/UserAuthorityLinkKey.java create mode 100644 appmarket-model/src/main/java/app/market/model/user/UserExample.java create mode 100644 appmarket-persistence/pom.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/interceptor/PaginationInterceptor.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppVersionMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityResourceLinkMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/DictionaryMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/ResourceMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserAuthorityLinkMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppVersionMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityResourceLinkMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/resource/DictionaryMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/resource/ResourceMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserAuthorityLinkMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserMapper.xml create mode 100644 appmarket-persistence/src/test/java/app/market/persisitence/AppTest.java create mode 100644 appmarket-utils/pom.xml create mode 100644 appmarket-utils/src/main/java/app/market/utils/Md5Util.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/RuntimeUtil.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/SpringWebUtil.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/Utils.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/constants/Constants.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/constants/ProjectUserRoleEnum.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/datatable/DataTableMap.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/datetime/DateTimeUtils.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/exception/ExceptionEnum.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/json/JsonMapperUtils.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/json/JsonMessage.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/json/JsonResult.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/KeysConstants.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/MessageUtil.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/Option.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/PropertyContants.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/PropertyUtil.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/rest/RestTemplateUtil.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/token/DeleteModel.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/token/TokenModel.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/webservice/ApiParam.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/webservice/ErrorCode.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/webservice/ErrorCodeEnum.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/webservice/WebServiceURI.java create mode 100644 appmarket-utils/src/main/resources/message.ja.JP.properties create mode 100644 appmarket-utils/src/main/resources/message.ja.en.properties create mode 100644 appmarket-utils/src/test/java/app/market/utils/AppTest.java create mode 100644 database/appmarket.sql create mode 100644 database/appmarket_update_2.0-3.0.sql create mode 100644 pom.xml create mode 100644 warehouse/pom.xml create mode 100644 warehouse/release note.txt create mode 100644 warehouse/src/main/java/app/market/LogUtil.java create mode 100644 warehouse/src/main/java/app/market/PropertyTool.java create mode 100644 warehouse/src/main/java/app/market/WebServiceClient.java create mode 100644 warehouse/src/main/java/app/market/filter/Filter.java create mode 100644 warehouse/src/main/java/app/market/filter/Log4jlistener.java create mode 100644 warehouse/src/main/java/app/market/web/controller/BreadcrumbMapping.java create mode 100644 warehouse/src/main/java/app/market/web/controller/ControllerMapping.java create mode 100644 warehouse/src/main/java/app/market/web/controller/PageMapping.java create mode 100644 warehouse/src/main/java/app/market/web/controller/SpringBaseController.java create mode 100644 warehouse/src/main/java/app/market/web/controller/account/AccountController.java create mode 100644 warehouse/src/main/java/app/market/web/controller/app/AppController.java create mode 100644 warehouse/src/main/java/app/market/web/controller/login/LoginController.java create mode 100644 warehouse/src/main/java/app/market/web/controller/main/MainController.java create mode 100644 warehouse/src/main/java/app/market/web/controllerDev/appDev/AppControllerDev.java create mode 100644 warehouse/src/main/java/app/market/web/controllerDev/login/package-info.java create mode 100644 warehouse/src/main/java/app/market/web/controllerDev/mainDev/MainControllerDev.java create mode 100644 warehouse/src/main/java/app/market/web/form/PaginationForm.java create mode 100644 warehouse/src/main/java/app/market/web/form/TokenForm.java create mode 100644 warehouse/src/main/java/app/market/web/form/account/AccountForm.java create mode 100644 warehouse/src/main/java/app/market/web/form/app/AppForm.java create mode 100644 warehouse/src/main/java/app/market/web/form/breadcrumb/BreadcrumbFrom.java create mode 100644 warehouse/src/main/java/app/market/web/form/breadcrumb/BreadcrumbSubFrom.java create mode 100644 warehouse/src/main/java/app/market/web/form/login/LoginForm.java create mode 100644 warehouse/src/main/java/app/market/web/form/login/SessionForm.java create mode 100644 warehouse/src/main/java/app/market/web/form/user/UserForm.java create mode 100644 warehouse/src/main/java/app/market/web/services/SpringBaseService.java create mode 100644 warehouse/src/main/java/app/market/web/services/account/AccountService.java create mode 100644 warehouse/src/main/java/app/market/web/services/account/impl/AccountServiceImpl.java create mode 100644 warehouse/src/main/java/app/market/web/services/app/AppService.java create mode 100644 warehouse/src/main/java/app/market/web/services/app/impl/AppServiceImpl.java create mode 100644 warehouse/src/main/java/app/market/web/services/login/LoginService.java create mode 100644 warehouse/src/main/java/app/market/web/services/login/impl/LoginServiceImpl.java create mode 100644 warehouse/src/main/java/app/market/web/services/main/MainService.java create mode 100644 warehouse/src/main/java/app/market/web/services/main/impl/MainServiceImpl.java create mode 100644 warehouse/src/main/java/app/market/web/services/user/UserService.java create mode 100644 warehouse/src/main/java/app/market/web/services/user/impl/UserServiceImpl.java create mode 100644 warehouse/src/main/resources/config/log4j.xml create mode 100644 warehouse/src/main/resources/config/properties.properties create mode 100644 warehouse/src/main/resources/config/spring-application.xml create mode 100644 warehouse/src/main/resources/config/spring-servlet.xml create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/account/detail.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/account/list.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/account/modify.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/app/checkAppInfo.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/app/createApp.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/app/list.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/app/modify.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/app/saveAppInfo.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/app/type.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/appDev/detailDev.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/appDev/listDev.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/appDev/localListDev.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/appDev/searchDev.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/deleteDialog.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/index.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/main.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/mainDev.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/navigationDialog.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/other/404.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/other/500.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/pages/skip.jsp create mode 100644 warehouse/src/main/webapp/WEB-INF/web.xml create mode 100644 warehouse/src/main/webapp/css/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css create mode 100644 warehouse/src/main/webapp/css/bootstrap.min.css create mode 100644 warehouse/src/main/webapp/css/bootstrap.min.css.map create mode 100644 warehouse/src/main/webapp/css/dataTables-1.10.16/dataTables.bootstrap4.css create mode 100644 warehouse/src/main/webapp/css/font-awesome.min.css create mode 100644 warehouse/src/main/webapp/css/style.css create mode 100644 warehouse/src/main/webapp/fonts/FontAwesome.otf create mode 100644 warehouse/src/main/webapp/fonts/fontawesome-webfont.eot create mode 100644 warehouse/src/main/webapp/fonts/fontawesome-webfont.svg create mode 100644 warehouse/src/main/webapp/fonts/fontawesome-webfont.ttf create mode 100644 warehouse/src/main/webapp/fonts/fontawesome-webfont.woff create mode 100644 warehouse/src/main/webapp/fonts/fontawesome-webfont.woff2 create mode 100644 warehouse/src/main/webapp/image/AGL_HMI_Blue_Background_Car-01.png create mode 100644 warehouse/src/main/webapp/image/addPic.png create mode 100644 warehouse/src/main/webapp/image/appthum.jpg create mode 100644 warehouse/src/main/webapp/image/defaultAppIcon.png create mode 100644 warehouse/src/main/webapp/image/insertAppCreate.PNG create mode 100644 warehouse/src/main/webapp/image/insertAppDetails.PNG create mode 100644 warehouse/src/main/webapp/image/insertAppSubmit.PNG create mode 100644 warehouse/src/main/webapp/image/logo.png create mode 100644 warehouse/src/main/webapp/image/transp_bg.png create mode 100644 warehouse/src/main/webapp/image/user.png create mode 100644 warehouse/src/main/webapp/js/AFB-websock.js create mode 100644 warehouse/src/main/webapp/js/AglSocket.js create mode 100644 warehouse/src/main/webapp/js/angular-1.5.8/angular.min.js create mode 100644 warehouse/src/main/webapp/js/bootstrap-4.0.0-beta/bootstrap.min.js create mode 100644 warehouse/src/main/webapp/js/bootstrap-4.0.0-beta/popper/popper.min.js create mode 100644 warehouse/src/main/webapp/js/bootstrap-datetimepicker/bootstrap-datetimepicker.ja.js create mode 100644 warehouse/src/main/webapp/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js create mode 100644 warehouse/src/main/webapp/js/common.js create mode 100644 warehouse/src/main/webapp/js/constant.js create mode 100644 warehouse/src/main/webapp/js/dataTables-1.10.16/dataTables.bootstrap4.min.js create mode 100644 warehouse/src/main/webapp/js/dataTables-1.10.16/i18n/datatables-ja-JP.json create mode 100644 warehouse/src/main/webapp/js/dataTables-1.10.16/jquery.dataTables.min.js create mode 100644 warehouse/src/main/webapp/js/deviceList.js create mode 100644 warehouse/src/main/webapp/js/download.js create mode 100644 warehouse/src/main/webapp/js/jquery.cookie.js create mode 100644 warehouse/src/main/webapp/js/jquery/easing/jquery.easing.compatibility.js create mode 100644 warehouse/src/main/webapp/js/jquery/easing/jquery.easing.min.js create mode 100644 warehouse/src/main/webapp/js/jquery/form/jquery.form.js create mode 100644 warehouse/src/main/webapp/js/jquery/jqLoading.min.js create mode 100644 warehouse/src/main/webapp/js/jquery/jquery.min.js create mode 100644 warehouse/src/main/webapp/js/main.js create mode 100644 webservice/pom.xml create mode 100644 webservice/release note.txt create mode 100644 webservice/src/main/java/app/market/LogUtil.java create mode 100644 webservice/src/main/java/app/market/PropertyUtil.java create mode 100644 webservice/src/main/java/app/market/WebServiceConstants.java create mode 100644 webservice/src/main/java/app/market/common/comm.java create mode 100644 webservice/src/main/java/app/market/token/dao/RedisGeneratorDao.java create mode 100644 webservice/src/main/java/app/market/token/interceptor/AuthenticationTokenInterceptor.java create mode 100644 webservice/src/main/java/app/market/token/service/RedisTokenManager.java create mode 100644 webservice/src/main/java/app/market/webservice/Filter.java create mode 100644 webservice/src/main/java/app/market/webservice/InitServer.java create mode 100644 webservice/src/main/java/app/market/webservice/Log4jlistener.java create mode 100644 webservice/src/main/java/app/market/webservice/WebServiceClient.java create mode 100644 webservice/src/main/java/app/market/webservice/WebserviceRestBaseController.java create mode 100644 webservice/src/main/java/app/market/webservice/app/AppRestController.java create mode 100644 webservice/src/main/java/app/market/webservice/authority/AuthorityRestController.java create mode 100644 webservice/src/main/java/app/market/webservice/dataManager/AppFileController.java create mode 100644 webservice/src/main/java/app/market/webservice/dataManager/FileUtil.java create mode 100644 webservice/src/main/java/app/market/webservice/dataManager/XmlFactory.java create mode 100644 webservice/src/main/java/app/market/webservice/resource/DictionaryRestController.java create mode 100644 webservice/src/main/java/app/market/webservice/resource/ResourceRestController.java create mode 100644 webservice/src/main/java/app/market/webservice/token/TokenRestController.java create mode 100644 webservice/src/main/java/app/market/webservice/user/UserRestController.java create mode 100644 webservice/src/main/resources/fileManager.properties create mode 100644 webservice/src/main/resources/log4j.xml create mode 100644 webservice/src/main/resources/mybatis-config.xml create mode 100644 webservice/src/main/resources/properties.properties create mode 100644 webservice/src/main/resources/redis-config.xml create mode 100644 webservice/src/main/resources/redis.properties create mode 100644 webservice/src/main/resources/servlet-context.xml create mode 100644 webservice/src/main/resources/spring-mybatis.xml create mode 100644 webservice/src/main/test/app/market/webservice/user/AppRestTest.java create mode 100644 webservice/src/main/test/app/market/webservice/user/UploadTest.java create mode 100644 webservice/src/main/test/app/market/webservice/user/UserRestTest.java create mode 100644 webservice/src/main/webapp/WEB-INF/web.xml diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..01dfdad --- /dev/null +++ b/.gitreview @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.automotivelinux.org +port=29418 +project=src/demo3-warehouse-server +defaultbranch=master + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b3201ab --- /dev/null +++ b/LICENSE @@ -0,0 +1,204 @@ + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don`t include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/Readme/ReadMe.md b/Readme/ReadMe.md new file mode 100644 index 0000000..77834fc --- /dev/null +++ b/Readme/ReadMe.md @@ -0,0 +1,650 @@ + + + + +# PART 1. agl-app-warehouse Environmental Construction Manual + +[TOC] + +## 1. Basic Environment + +### 1.1 Hardware + +* cpu ---------------- 3.30GHz or more +* Memory---------- 4Gbytes or more +* HDD--------------- 100Mbytes or more + +### 1.2 Software + +* Centos7.2 +* JDK 1.8 +* apache-tomcat-8 +* Redis +* MySQL 5.7.22 + +*The IP address used in this environment construction is "192.168.200.107"[^1]. + +[^1]: The IP address in this manual is replaced by "$IP", so please rewrite it to the IP address which used in the actual environment construction. + + + +## 2. JDK + +### 2.1 Installation + +```shell +# yum install java-1.8.0-openjdk +``` + +### 2.2 Configuration + +#### 2.2.1 Environmental Variables Configuration + +```shell +# echo "export JAVA_HOME=$(readlink -e $(which java)|sed 's:/bin/java::')" > /etc/profile.d/java.sh +``` + +```shell +# echo "PATH=\$PATH:\$JAVA_HOME/bin" >> /etc/profile.d/java.sh +``` + +```shell +# source /etc/profile.d/java.sh +``` + +### 2.3 Confirmation + +```shell +# java -version + OpenJDK version "1.8.0_171" + OpenJDK Runtime Environment (build 1.8.0_171-b10) + OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) +``` + + + +## 3. Tomcat + +### 3.1 Installation + +#### 3.1.1 New User + +```shell +# useradd -s /sbin/nologin tomcat +``` + +#### 3.1.2 Download + +```shell +# mkdir -p /usr/local/src/tomcat +``` + +```shell +# cd /usr/local/src/tomcat/ +``` + +```shell +# wget http://ftp.riken.jp/net/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar.gz +``` + +#### 3.1.3 "tar.gz" Deployment + +```shell +# tar zxvf apache-tomcat-8.5.31.tar.gz +``` + +```shell +# mv apache-tomcat-8.5.31 /opt/ +``` + +```shell +# chown -R tomcat. /opt/apache-tomcat-8.5.31 +``` + +```shell +# ln -s /opt/apache-tomcat-8.5.31 /opt/tomcat +``` + +### 3.2 Configuration + +#### 3.2.1 Environmental Variables Configuration + +```shell +# echo 'export CATALINA_HOME=/opt/tomcat' > /etc/profile.d/tomcat.sh +``` + +```shell +# source /etc/profile.d/tomcat.sh +``` + +#### 3.2.2 Tomcat User Configuration + +```shell +# vi /opt/tomcat/conf/tomcat-users.xml +``` + +Add the following contents in "tomcat-users.xml": + +```xml + + + +``` + +```shell +# vi /opt/tomcat/webapps/manager/META-INF/context.xml +``` + +Remove "< value >... < / value > " + +#### 3.2.3 Service Definition File + +Create "/etc/systemd/system/tomcat.service" and store it as follows: + +Modify the permission of the created definition file to 755. + +```shell +# vi /etc/systemd/system/tomcat.service +``` + +```shell +# chmod 755 /etc/systemd/system/tomcat.service +``` + +File contents : + +``` +[Unit] +Description=Apache Tomcat 8 +After=syslog.target network.target + +[Service] +User=tomcat +Group=tomcat +Type=oneshot +PIDFile=/opt/tomcat/tomcat.pid +RemainAfterExit=yes + +ExecStart=/opt/tomcat/bin/startup.sh +ExecStop=/opt/tomcat/bin/shutdown.sh +ExecReStart=/opt/tomcat/bin/shutdown.sh;/opt/tomcat/bin/startup.sh + +[Install] +WantedBy=multi-user.target +``` + +#### 3.2.4 Auto Start + +Auto start when the server starts. + +```shell +# systemctl enable tomcat +``` + +#### 3.2.5 Set of Firewalld + +Create '/etc/firewalld/services/tomcat.xml ' and write it as follows: + +```shell +# vi /etc/firewalld/services/tomcat.xml +``` + +```shell +# firewall-cmd --add-service=tomcat --permanent +``` + +```shell +# firewall-cmd reload +``` + +File contents: + +```xml + + +  Apache Tomcat 8 +  Apache Tomcat 8 + + +``` + +### 3.3 Launch + +```shell +# systemctl start tomcat +``` + +### 3.4 Confirmation + +Access to 'http://$IP:8080/' + + + +## 4. Redis + +### 4.1 Installation + +```shell +# yum -y install epel-release +``` + +```shell +# yum install -y redis +``` + +### 4.2 Configuration + +#### 4.2.1 "redis.conf" File Modification + +```shell +# vi /etc/redis.conf +``` + +Before: + +``` +bind 127.0.0.1 +#requirepass foobared +``` + +After: + +``` +#bind 127.0.0.1 +requirepass appmarket +``` + +#### 4.2.2 Auto Start + +Auto start when the server starts. + +```shell +# systemctl enable redis.service +``` + +#### 4.2.3 Set of Firewalld + +```shell +# firewall-cmd --add-port=6379/tcp --permanent +``` + +```shell +# firewall-cmd reload +``` + +### 4.3 Launch + +```shell +# systemctl start redis.service +``` + +### 4.4 Confirmation + +```shell +# redis-cli -a appmarket + redis 127.0.0.1:6379> ping + PONG +``` + + + +## 5. MySql + +### 5.1 Installation + +#### 5.1.1 Preparation + +```shell +# yum remove mariadb-libs.x86_64 +``` + +```shell +# rm -rf /var/lib/mysql +``` + +#### 5.1.2 Installation + +```shell +# yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm +``` + +```shell +# yum -y install mysql-community-server +``` + +#### 5.1.3 Correct Installation Confirmation + +```shell +# mysqld --version + mysqld Ver 5.7.22 for Linux on x86_64 (MySQL Community Server (GPL)) +``` + +### 5.2 Configuration + +#### 5.2.1 MySQL User Configuration + +##### 5.2.1.1 User Configuration + +Get the password generated from the record file and use it when executing the "mysql_secure_installation "command. + +```shell +# systemctl start mysqld +# cat /var/log/mysqld.log | grep root + xxxx[Note] A temporary password is generated for root@localhost: uhsd!Aid;3Zt +``` + +mysql_secure_installation Command is being executed: + +``` +NOTE:+E23:K42 RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL +SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! +In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank,so you should just press enter here. +Enter current password for root (enter for none):uhsd!Aid;3Zt +OK, successfully used password, moving on… +Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. +Set root password? [Y/n] y +New password: 123456 +Re-enter new password: 123456 +Password updated successfully! +Reloading privilege tables.. +… Success! +By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. +Remove anonymous users? [Y/n] y +… Success! +Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. +Disallow root login remotely? [Y/n] n +… Success! +By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. +Remove test database and access to it? [Y/n] n +- Dropping test database… +… Success! +- Removing privileges on test database… +… Success! +Reloading the privilege tables will ensure that all changes made so far will take effect immediately. +Reload privilege tables now? [Y/n] y +… Success! +Cleaning up… +All done! If you've completed all of the above steps, your MySQL installation should now be secure. +Thanks for using MySQL! +[root@server1 ~]# +``` + +##### 5.2.1.2 Add User Permissions + +```shell +# mysql -u root -p + Enter password:123456 +``` + +```shell +mysql> grant all privileges on *.* to root@'%'identified by '123456'; +``` + +#### 5.2.2 Modification of "/etc/my.cnf " + +```shell +# vi /etc/my.cnf +``` + +Add the following contents in my "my.cnf file": + +``` +[mysqld] +character_set_server = utf8 +``` + +#### 5.2.3 Auto Start + +```shell +# systemctl enable mysqld.service +``` + +#### 5.2.4 Set of Firewalld + +```shell +# firewall-cmd --permanent --zone=public --add-port=3306/tcp +``` + +```shell +# firewall-cmd --permanent --zone=public --add-port=3306/udp +``` + +```shell +# firewall-cmd --reload +``` + +### 5.3 Launch + +```shell +# systemctl start mysqld.service +``` + +### 5.4 Confirmation + +```shell +# mysql -u root -p +Enter password:123456 +``` + +```shell +mysql> use mysql; +Database changed +``` + +``` +mysql> select host,user from user; ++--------------+------+ +| host         | user | ++--------------+------+ +| localhost    | root | +| 192.168.1.1 | root | +| %            | root | ++--------------+------+ +``` + + + +## 6. AglAppWarehouse + +Copy the war-file("warehouse.war" and "webservice.war" ) into the "/opt/tomcat/webapps" directory. + +### 6.1 Server Construction + +#### 6.1.1 Server Configuration + +##### 6.1.1.1 Redis Information Settings + +```shell +# vi /opt/tomcat/webapps/webservice/WEB-INF/classes/redis.properties +``` + +Modify the file "redis.properties" as follows : + +``` +redis.host=192.168.200.107 +redis.port=6379 +redis.password=appmarket +``` + +##### 6.1.1.2 App File Saving Path Settings + +```shell +# mkdir -p -m 777 /data/appmarket/log/web +``` + +```shell +# mkdir -p -m 777 /data/appmarket/log/webservice +``` + +```shell +# vi /opt/tomcat/webapps/webservice/WEB-INF/classes/fileManager.properties +``` + +Modify the file "fileManager.properties" as follows : + +``` +upload_path=/data/appmarket/filesystem/ +upload_path_checked=/data/appmarket/filesystem/ +``` + +##### 6.1.1.3 Mybatis Info Settings + +```shell +# vi /opt/tomcat/webapps/webservice/WEB-INF/classes/spring-mybatis.xml +``` + +Modify the file "spring-mybatis.xml" as follows : + +```xml + +``` + +#### 6.1.2 Database Configuration + +```shell +# mysql -u root -p +Enter password:123456 +``` + +```shell +mysql> source /data/ftp/pub/db_data/appmarket.sql; +``` + +### 6.2 Launch + +```shell +# systemctl start tomcat +``` + +### 6.3 Set of Port + +```shell +# firewall-cmd --add-masquerade +``` + +```shell +# firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080 --permanent +``` + +### 6.4 Confirmation + +Access to "http://$IP:8080/warehouse/" + + + +# PART 2. Code Compilation Manual + +## 1. Base Environment + +* eclipse :Neon.2 Release (4.6.2) +* apache-tomcat-8.0 +* JDK 1.8 + +## 2. New Project + +### 2.1 Create a Root Maven Project + +![project_start](img/new_maven_project_start.PNG) + +![maven_project](img/new_maven_project.PNG) + +![maven_project2](img/new_maven_project2.PNG) + +### 2.2 Create Maven Modules + +There are six maven modules. + +1. appmarket-core +2. appmarket-model +3. appmarket-persistence +4. appmarket-utils +5. warehouse +6. webservice + +![maven_model_start](img/maven_model_start.PNG) + +Input the module name by maven modules. +![avatar](img/new_maven_model.PNG) + +Selecting an archetype by maven modules( 1,2,3,4 choose ① , 5,6 choose ②) + +![avatar](img/new_maven_model2.PNG) + +![avatar](img/new_maven_model3.PNG) + +### 2.3 Replace Files + +Replace the workspace project files of eclipse with the files in the source code. + + + +## 3. Code Compilation + +### 3.1 Import Maven Projects + +![maven_import](img/maven_import.PNG) + +![maven_import1](img/maven_import1.PNG) + +![maven_import2](img/maven_import2.PNG) + +### 3.2 Update Project + +![maven_update](img/maven_update.PNG) + +## 4. War Export + +### 4.1 Export + +Export "warehouse.war "and "webservice.war". + +Right click on the project name(warehouse) + +![create_war1](img/create_war1.PNG) + + + +Select the save Path of war file + +![create_war2](img/create_war2.PNG) + diff --git a/Readme/img/create_war1.PNG b/Readme/img/create_war1.PNG new file mode 100644 index 0000000..67fcfa7 Binary files /dev/null and b/Readme/img/create_war1.PNG differ diff --git a/Readme/img/create_war2.PNG b/Readme/img/create_war2.PNG new file mode 100644 index 0000000..425911c Binary files /dev/null and b/Readme/img/create_war2.PNG differ diff --git a/Readme/img/maven_import.PNG b/Readme/img/maven_import.PNG new file mode 100644 index 0000000..1b89d3f Binary files /dev/null and b/Readme/img/maven_import.PNG differ diff --git a/Readme/img/maven_import1.PNG b/Readme/img/maven_import1.PNG new file mode 100644 index 0000000..aeefcb5 Binary files /dev/null and b/Readme/img/maven_import1.PNG differ diff --git a/Readme/img/maven_import2.PNG b/Readme/img/maven_import2.PNG new file mode 100644 index 0000000..6177ca2 Binary files /dev/null and b/Readme/img/maven_import2.PNG differ diff --git a/Readme/img/maven_model_start.PNG b/Readme/img/maven_model_start.PNG new file mode 100644 index 0000000..8655c63 Binary files /dev/null and b/Readme/img/maven_model_start.PNG differ diff --git a/Readme/img/maven_update.PNG b/Readme/img/maven_update.PNG new file mode 100644 index 0000000..63c9662 Binary files /dev/null and b/Readme/img/maven_update.PNG differ diff --git a/Readme/img/new_maven_model.PNG b/Readme/img/new_maven_model.PNG new file mode 100644 index 0000000..a2a4e2c Binary files /dev/null and b/Readme/img/new_maven_model.PNG differ diff --git a/Readme/img/new_maven_model2.PNG b/Readme/img/new_maven_model2.PNG new file mode 100644 index 0000000..3af2e4f Binary files /dev/null and b/Readme/img/new_maven_model2.PNG differ diff --git a/Readme/img/new_maven_model3.PNG b/Readme/img/new_maven_model3.PNG new file mode 100644 index 0000000..df4d3d9 Binary files /dev/null and b/Readme/img/new_maven_model3.PNG differ diff --git a/Readme/img/new_maven_project.PNG b/Readme/img/new_maven_project.PNG new file mode 100644 index 0000000..abe3420 Binary files /dev/null and b/Readme/img/new_maven_project.PNG differ diff --git a/Readme/img/new_maven_project2.PNG b/Readme/img/new_maven_project2.PNG new file mode 100644 index 0000000..d5f5ace Binary files /dev/null and b/Readme/img/new_maven_project2.PNG differ diff --git a/Readme/img/new_maven_project_start.PNG b/Readme/img/new_maven_project_start.PNG new file mode 100644 index 0000000..66d03fa Binary files /dev/null and b/Readme/img/new_maven_project_start.PNG differ diff --git a/appmarket-core/pom.xml b/appmarket-core/pom.xml new file mode 100644 index 0000000..2b74e32 --- /dev/null +++ b/appmarket-core/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + app.market + appmarket-root + 0.0.1-SNAPSHOT + + appmarket-core + jar + appmarket-core + http://maven.apache.org + + UTF-8 + + + + junit + junit + 3.8.1 + test + + + + app.market + appmarket-persistence + ${project.version} + + + + org.springframework + spring-aspects + ${spring.version} + + + diff --git a/appmarket-core/src/main/java/app/market/core/app/AppCore.java b/appmarket-core/src/main/java/app/market/core/app/AppCore.java new file mode 100644 index 0000000..6db3075 --- /dev/null +++ b/appmarket-core/src/main/java/app/market/core/app/AppCore.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.market.core.app; + +import java.util.List; + +import app.market.model.app.App; +import app.market.model.app.AppExample; +import app.market.model.app.AppVersion; +import app.market.model.app.AppVersionExample; + + + +public interface AppCore { + + /** + * Get application information + * + * @param offset + * @param limit + * @param example + * @return + */ + List selectByExample(int offset, int limit, AppExample example); + + /** + * Get total count of applications + * + * @param example + * @return + */ + int countByExample(AppExample example); + + /** + * Search application by ID + * + * @param appId + * @return + */ + App selectAppByAppId(String appId); + + /** + * Search application by IdCustom + * @param appIdCustom + * @return + */ + App selectAppByAppCustomId(String appIdCustom); + + /** + * Save application information + * + * @param app + * @return + */ + int save(App app); + + /** + * Delete application + * + * @param id + * @return + */ + int deleteByAppId(String id); + + /** + * Save application version + * @param appVer + * @return + */ + int saveVision(AppVersion appVer); + + /** + * Get total count of app versions + * + * @param example + * @return + */ + int countByExample(AppVersionExample example); +} diff --git a/appmarket-core/src/main/java/app/market/core/app/impl/AppCoreImpl.java b/appmarket-core/src/main/java/app/market/core/app/impl/AppCoreImpl.java new file mode 100644 index 0000000..1287484 --- /dev/null +++ b/appmarket-core/src/main/java/app/market/core/app/impl/AppCoreImpl.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.market.core.app.impl; + +import java.util.List; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.session.RowBounds; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import app.market.core.app.AppCore; +import app.market.core.user.impl.UserCoreImpl; +import app.market.model.app.App; +import app.market.model.app.AppExample; +import app.market.model.app.AppVersion; +import app.market.model.app.AppVersionExample; +import app.market.persistence.mapper.app.AppMapper; +import app.market.persistence.mapper.app.AppVersionMapper; +import app.market.utils.Utils; + +@Service +@Transactional +public class AppCoreImpl implements AppCore{ + + private static Logger logger = LoggerFactory.getLogger( UserCoreImpl.class ); + + @Resource(name = "AppMapper") + private AppMapper mapper; + + @Resource(name = "AppVersionMapper") + private AppVersionMapper versionMapper; + + @Override + public List selectByExample(int offset, int limit, AppExample example) { + mapper.selectByExample(example); + return mapper.selectByExample( new RowBounds( offset, limit ), example ); + } + + @Override + public int countByExample(AppExample example) { + int ret = mapper.countByExample( example ); + return ret; + } + + @Override + public App selectAppByAppId(String appId) { + App app = mapper.selectByPrimaryKey( appId ); + return app; + } + + @Override + public App selectAppByAppCustomId(String appIdCustom) { + App app = mapper.selectByCustomId( appIdCustom ); + return app; + } + + @Override + public int save(App app) { + int ret = 0; + if ( StringUtils.isEmpty( app.getAppId() ) ) { + app.setAppId( Utils.generatorUUID() ); + ret = mapper.insert( app ); + } else { + ret = mapper.updateByPrimaryKeySelective(app); + } + + + return ret; + } + + @Override + public int deleteByAppId(String appId) { + int ret = 0; + // delete version + ret = versionMapper.deleteByAppId(appId); + + // delete application information + ret = mapper.deleteByAppId(appId); + return ret; + } + + @Override + public int saveVision(AppVersion appVer) { + int ret = 0; + + if ( StringUtils.isEmpty( appVer.getVersionId())) { + appVer.setVersionId( Utils.generatorUUID() ); + ret = versionMapper.insert(appVer); + } else { + ret = versionMapper.updateByPrimaryKeySelective(appVer); + } + + return ret; + } + + @Override + public int countByExample(AppVersionExample example) { + int ret = versionMapper.countByExample( example ); + return ret; + } +} diff --git a/appmarket-core/src/main/java/app/market/core/authority/AuthorityCore.java b/appmarket-core/src/main/java/app/market/core/authority/AuthorityCore.java new file mode 100644 index 0000000..7f64227 --- /dev/null +++ b/appmarket-core/src/main/java/app/market/core/authority/AuthorityCore.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.market.core.authority; + +import java.util.List; + +import app.market.utils.property.Option; + +public interface AuthorityCore { + + /** + * Get authority list by role + * + * @param hasSpace + * @return + */ + List