34 changed files with 196 additions and 611 deletions
			
			
		| @ -0,0 +1,8 @@ | |||||
|  | dependencies { | ||||
|  | 	api( | ||||
|  | 		"org.springframework.boot:spring-boot-starter-web", | ||||
|  | 		"io.netty:netty-codec-http", | ||||
|  | 		"com.google.code.gson:gson", | ||||
|  | 		"org.codehaus.groovy:groovy", | ||||
|  | 	) | ||||
|  | } | ||||
| @ -1,223 +0,0 @@ | |||||
| ########################################################################## |  | ||||
| #(100) excluded auto configuration - io.sc.platform.core |  | ||||
| ########################################################################## |  | ||||
| spring.autoconfigure.exclude = |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(150) application configuration - io.sc.platform.core |  | ||||
| ########################################################################## |  | ||||
| # - io.sc.platform.core |  | ||||
| application.audit-log-mode = none |  | ||||
| #application.audit-log-mode = none |  | ||||
| #application.audit-log-mode = log |  | ||||
| #application.audit-log-mode = database |  | ||||
| # - io.sc.platform.installer |  | ||||
| application.installer.enabled = true |  | ||||
| # - io.sc.platform.jdbc.liquibase |  | ||||
| application.updater.enabled = true |  | ||||
| # - io.sc.platform.security |  | ||||
| application.default-password = password |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(200) spring.main configuration - io.sc.platform.core |  | ||||
| ########################################################################## |  | ||||
| spring.main.allow-bean-definition-overriding = false |  | ||||
| spring.main.banner-mode = console |  | ||||
| spring.main.lazy-initialization = false |  | ||||
| spring.main.log-startup-info = true |  | ||||
| spring.main.register-shutdown-hook = true |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(210) jasypt encryptor configuration - io.sc.platform.core |  | ||||
| ########################################################################## |  | ||||
| jasypt.encryptor.bean = platformJasyptStringEncryptor |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(300) web server configuration - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| #server.address = 127.0.0.1 |  | ||||
| server.port = 8080 |  | ||||
| server.servlet.context-path = / |  | ||||
| server.servlet.session.timeout = 30m |  | ||||
| server.error.path = /error |  | ||||
| server.error.whitelabel.enabled = true |  | ||||
| server.error.include-exception = true |  | ||||
| server.error.include-binding-errors = always |  | ||||
| server.error.include-message = always |  | ||||
| server.error.include-stacktrace = always |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(1000) dataSource configuration - io.sc.platform.jdbc |  | ||||
| ########################################################################## |  | ||||
| spring.datasource.items[primary].driver-class-name = org.h2.Driver |  | ||||
| spring.datasource.items[primary].url = jdbc:h2:mem:DB_PLATFORM;DB_CLOSE_DELAY=-1 |  | ||||
| spring.datasource.items[primary].username = platform |  | ||||
| spring.datasource.items[primary].password = platform |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(1100) jpa configuration - io.sc.platform.orm.jpa |  | ||||
| ########################################################################## |  | ||||
| spring.jpa.open-in-view = false |  | ||||
| spring.jpa.show-sql = false |  | ||||
| spring.jpa.generate-ddl = false |  | ||||
| spring.jpa.hibernate.ddl-auto = none |  | ||||
| spring.jpa.hibernate.jdbc.batch_size = 25 |  | ||||
| spring.jpa.properties.hibernate.enable_lazy_load_no_trans =true |  | ||||
| spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.H2Dialect |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(1500) hikari configuration - io.sc.platform.jdbc |  | ||||
| ########################################################################## |  | ||||
| #spring.datasource.items[primary].hikari.autoCommit = true |  | ||||
| #spring.datasource.items[primary].hikari.connectionTimeout = 10000 |  | ||||
| #spring.datasource.items[primary].hikari.idleTimeout = 600000 |  | ||||
| #spring.datasource.items[primary].hikari.maxLifetime = 1800000 |  | ||||
| #spring.datasource.items[primary].hikari.minimumIdle = 10 |  | ||||
| #spring.datasource.items[primary].hikari.maximumPoolSize = 10 |  | ||||
| #spring.datasource.items[primary].hikari.metricRegistry = |  | ||||
| #spring.datasource.items[primary].hikari.healthCheckRegistry = |  | ||||
| #spring.datasource.items[primary].hikari.poolName = |  | ||||
| #spring.datasource.items[primary].hikari.initializationFailTimeout = 1 |  | ||||
| #spring.datasource.items[primary].hikari.isolateInternalQueries = false |  | ||||
| #spring.datasource.items[primary].hikari.allowPoolSuspension = false |  | ||||
| #spring.datasource.items[primary].hikari.readOnly = false |  | ||||
| #spring.datasource.items[primary].hikari.registerMbeans = false |  | ||||
| #spring.datasource.items[primary].hikari.catalog = |  | ||||
| #spring.datasource.items[primary].hikari.connectionInitSql = |  | ||||
| #spring.datasource.items[primary].hikari.driverClassName = |  | ||||
| #spring.datasource.items[primary].hikari.transactionIsolation = |  | ||||
| #spring.datasource.items[primary].hikari.validationTimeout = 5000 |  | ||||
| #spring.datasource.items[primary].hikari.leakDetectionThreshold = 0 |  | ||||
| #spring.datasource.items[primary].hikari.dataSource = |  | ||||
| #spring.datasource.items[primary].hikari.schema = |  | ||||
| #spring.datasource.items[primary].hikari.threadFactory = |  | ||||
| #spring.datasource.items[primary].hikari.scheduledExecutor = |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(2100) spring.session configuration - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| spring.session.store-type = none |  | ||||
| #spring.session.store-type = jdbc |  | ||||
| #spring.session.store-type = redis |  | ||||
| spring.session.jdbc.initializer.enabled = false |  | ||||
| spring.session.jdbc.cleanup-cron = 0 */5 * * * * |  | ||||
| spring.session.redis.namespace = spring:session |  | ||||
| spring.session.redis.cleanupCron = 0 */5 * * * * |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(2200) spring web configuration (WebProperties) - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| spring.web.resources.add-mappings = true |  | ||||
| spring.web.resources.cache.cachecontrol.cache-public = true |  | ||||
| spring.web.resources.cache.cachecontrol.must-revalidate = true |  | ||||
| spring.web.resources.chain.cache = true |  | ||||
| spring.web.resources.chain.compressed = true |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(2300) management http server configuration - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| management.endpoints.enabled-by-default = true |  | ||||
| management.endpoints.web.exposure.include = * |  | ||||
| management.context-path = /actuator |  | ||||
| management.security.enabled = false |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(2400) thymeleaf configuration - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| spring.thymeleaf.enabled = true |  | ||||
| spring.thymeleaf.cache = false |  | ||||
| spring.thymeleaf.encoding = UTF-8 |  | ||||
| spring.thymeleaf.mode = HTML |  | ||||
| spring.thymeleaf.prefix = classpath:/templates/ |  | ||||
| spring.thymeleaf.check-template = false |  | ||||
| spring.thymeleaf.check-template-location = false |  | ||||
| spring.thymeleaf.servlet.content-type = text/html |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(2500) jackson configuration - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| spring.jackson.time-zone = Asia/Shanghai |  | ||||
| spring.jackson.date-format = yyyy-MM-dd HH:mm:ss |  | ||||
| spring.jackson.serialization.indent_output = true |  | ||||
| spring.jackson.serialization.fail_on_empty_beans = false |  | ||||
| spring.jackson.deserialization.fail_on_ignored_properties = false |  | ||||
| spring.jackson.parser.allow_comments = true |  | ||||
| spring.jackson.parser.allow_single_quotes = true |  | ||||
| spring.jackson.parser.allow_trailing_comma = true |  | ||||
| spring.jackson.parser.allow_unquoted_field_names = true |  | ||||
| spring.jackson.parser.ignore_undefined = true |  | ||||
| spring.jackson.parser.allow_unquoted_control_chars = true |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(2600) i18n message source configuration - io.sc.platform.mvc |  | ||||
| ########################################################################## |  | ||||
| spring.messages.alwaysUseMessageFormat = false |  | ||||
| spring.messages.cacheDuration = -1 |  | ||||
| spring.messages.encoding = UTF-8 |  | ||||
| spring.messages.fallbackToSystemLocale = false |  | ||||
| spring.messages.useCodeAsDefaultMessage = true |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(3000) platform security configuration - io.sc.platform.security.loginform |  | ||||
| ########################################################################## |  | ||||
| spring.security.formLogin.loginPage = /login |  | ||||
| spring.security.formLogin.loginProcessingUrl = /login |  | ||||
| spring.security.formLogin.failureUrl = /login-error |  | ||||
| spring.security.logout.logoutUrl = /logout |  | ||||
| spring.security.logout.logoutSuccessUrl = / |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(4000) email configuration - io.sc.platform.communication |  | ||||
| ########################################################################## |  | ||||
| spring.mail.host=zzz.xxx.yyy |  | ||||
| spring.mail.port=25 |  | ||||
| spring.mail.protocol=smtp |  | ||||
| spring.mail.test-connection=false |  | ||||
| spring.mail.default-encoding=UTF-8 |  | ||||
| spring.mail.properties.mail.smtp.auth=true |  | ||||
| spring.mail.username=xxx |  | ||||
| spring.mail.password=yyy |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(5000) flowable bpm configuration - io.sc.platform.flowable |  | ||||
| ########################################################################## |  | ||||
| # core |  | ||||
| flowable.asyncExecutorActivate =false |  | ||||
| flowable.asyncHistoryExecutorActivate = false |  | ||||
| flowable.check-process-definitions=false |  | ||||
| flowable.custom-mybatis-mappers= |  | ||||
| flowable.custom-mybatis-x-m-l-mappers= |  | ||||
| flowable.database-schema= |  | ||||
| flowable.database-schema-update=true |  | ||||
| flowable.db-history-used=true |  | ||||
| flowable.deployment-name=SpringBootAutoDeployment |  | ||||
| flowable.history-level= |  | ||||
| flowable.process-definition-location-prefix=classpath*:/processes/ |  | ||||
| flowable.process-definition-location-suffixes=**.bpmn20.xml,**.bpmn |  | ||||
| # process |  | ||||
| flowable.process.definition-cache-limit=-1 |  | ||||
| flowable.process.enable-safe-xml=true |  | ||||
| flowable.process.servlet.load-on-startup=-1 |  | ||||
| flowable.process.servlet.name=Flowable BPMN Rest API |  | ||||
| flowable.process.servlet.path=/process-api |  | ||||
| # cmmn |  | ||||
| flowable.cmmn.enabled=false |  | ||||
| # content |  | ||||
| flowable.content.enabled=false |  | ||||
| # dmn |  | ||||
| flowable.dmn.enabled=false |  | ||||
| # form |  | ||||
| flowable.form.enabled=false |  | ||||
| # idm |  | ||||
| flowable.idm.enabled=false |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(8000) cxf configuration - io.sc.platform.ws.cxf |  | ||||
| ########################################################################## |  | ||||
| cxf.path = /webservices |  | ||||
| 
 |  | ||||
| ########################################################################## |  | ||||
| #(9000) p6spy configuration - io.sc.platform.jdbc |  | ||||
| ########################################################################## |  | ||||
| p6spy.enabled = true |  | ||||
| p6spy.ignorePattern = false |  | ||||
| @ -1,48 +0,0 @@ | |||||
| ************************************************************************************** |  | ||||
|     Name: app.platform |  | ||||
|     Version: ${application.version} |  | ||||
|     Base on Spring Boot ${spring-boot.version} |  | ||||
| ************************************************************************************** |  | ||||
| System.environment: |  | ||||
| -------------------------------------------------------------------------------------- |  | ||||
|     java.specification.version                = 1.8 |  | ||||
|     java.specification.vendor                 = Oracle Corporation |  | ||||
|     java.specification.name                   = Java Platform API Specification |  | ||||
|     java.vm.specification.version             = 1.8 |  | ||||
|     java.vm.specification.vendor              = Oracle Corporation |  | ||||
|     java.vm.specification.name                = Java Virtual Machine Specification |  | ||||
|     java.home                                 = /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre |  | ||||
|     java.version                              = 1.8.0_332 |  | ||||
|     java.vendor                               = Azul Systems, Inc. |  | ||||
|     java.vendor.url                           = http://www.azul.com/ |  | ||||
|     java.vm.version                           = 25.332-b09 |  | ||||
|     java.vm.vendor                            = Azul Systems, Inc. |  | ||||
|     java.vm.name                              = OpenJDK 64-Bit Server VM |  | ||||
|     java.class.version                        = 52.0 |  | ||||
|     java.class.path                           = ${java.class.path2} |  | ||||
|     java.library.path                         = /Users/wangshaoping/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. |  | ||||
|     java.io.tmpdir                            = /var/folders/82/6m96_g610hj1v1tcpvhtjysr0000gn/T/ |  | ||||
|     java.ext.dirs                             = /Users/wangshaoping/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java |  | ||||
|     os.name                                   = Mac OS X |  | ||||
|     os.arch                                   = aarch64 |  | ||||
|     os.version                                = 13.5.1 |  | ||||
|     user.name                                 = wangshaoping |  | ||||
|     user.home                                 = /Users/wangshaoping |  | ||||
|     user.dir                                  = /Users/wangshaoping/wspsc/workspace/wangshaoping/v8/platform |  | ||||
|      |  | ||||
| Application.environment |  | ||||
| -------------------------------------------------------------------------------------- |  | ||||
|     application.name                          = app.platform |  | ||||
|     application.is-running-in-development     = false |  | ||||
|     application.is-running-in-web-container   = false |  | ||||
| 
 |  | ||||
|     application.home.dir                      = /Users/wangshaoping/wspsc/workspace/wangshaoping/v8/platform |  | ||||
|     application.installer.enabled             = ${application.installer.enabled} |  | ||||
|     application.updater.enabled               = ${application.updater.enabled} |  | ||||
|     application.audit-log-mode                = ${application.audit-log-mode} |  | ||||
|     spring.config.location                    = file:/Users/wangshaoping/wspsc/workspace/wangshaoping/v8/platform/config/application.properties |  | ||||
|     spring.banner.location                    = file:/Users/wangshaoping/wspsc/workspace/wangshaoping/v8/platform/config/banner.txt |  | ||||
|     logging.config                            = file:/Users/wangshaoping/wspsc/workspace/wangshaoping/v8/platform/config/logback-spring.xml |  | ||||
|     p6spy.enabled                             = ${p6spy.enabled} |  | ||||
|     p6spy.ignorePattern                       = ${p6spy.ignorePattern} |  | ||||
| ************************************************************************************** |  | ||||
| @ -1,216 +0,0 @@ | |||||
|                                  Apache License |  | ||||
|                            Version 2.0, January 2004 |  | ||||
|                         https://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 |  | ||||
| 
 |  | ||||
|        https://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. |  | ||||
| 
 |  | ||||
| =======================================================================    |  | ||||
| 
 |  | ||||
| To the extent any open source subcomponents are licensed under the EPL and/or other  |  | ||||
| similar licenses that require the source code and/or modifications to  |  | ||||
| source code to be made available (as would be noted above), you may obtain a  |  | ||||
| copy of the source code corresponding to the binaries for such open source  |  | ||||
| components and modifications thereto, if any, (the "Source Files"), by  |  | ||||
| downloading the Source Files from https://www.springsource.org/download,  |  | ||||
| or by sending a request, with your name and address to: VMware, Inc., 3401 Hillview  |  | ||||
| Avenue, Palo Alto, CA 94304, United States of America or email info@vmware.com.  All  |  | ||||
| such requests should clearly specify:  OPEN SOURCE FILES REQUEST, Attention General  |  | ||||
| Counsel.  VMware shall mail a copy of the Source Files to you on a CD or equivalent  |  | ||||
| physical medium.  This offer to obtain a copy of the Source Files is valid for three  |  | ||||
| years from the date you acquired this Software product. |  | ||||
| @ -1,66 +0,0 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||
| <!-- 自动扫描本文件,如果发生变化,则重新初始化日志系统,并设置每隔5秒钟扫描一次 --> |  | ||||
| <configuration debug="false" scan="true" scanPeriod="5 seconds"> |  | ||||
| 	<!--  |  | ||||
| 		以下为 logback 的 spring 扩展支持的功能,即支持从 application.properties 文件中获取属性,并在此文件中采用 ${} 方式使用。 |  | ||||
| 		要使用此功能,必须使用 logback-ext-spring 扩展 jar 包,以 gradle 构建系统,则需要加入以下依赖 |  | ||||
| 		dependencies { |  | ||||
| 			compile( |  | ||||
| 				"org.logback-extensions:logback-ext-spring:0.1.2" |  | ||||
| 			) |  | ||||
| 		} |  | ||||
| 	--> |  | ||||
| 	<property name="homedir" value="/Users/wangshaoping/wspsc/workspace/wangshaoping/v8/platform"/> |  | ||||
| 	<property name="pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/> |  | ||||
| 	 |  | ||||
| 	<!-- 在控制台中输出日志 --> |  | ||||
|     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |  | ||||
|         <encoder><pattern>${pattern}</pattern></encoder> |  | ||||
|     </appender> |  | ||||
| 
 |  | ||||
| 	<!-- 在磁盘文件中输出日志 --> |  | ||||
|     <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |  | ||||
|     	<encoder><pattern>${pattern}</pattern></encoder> |  | ||||
|         <file>${homedir}/logs/log.log</file> |  | ||||
|         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |  | ||||
|             <fileNamePattern>${homedir}/logs/log.%d.log</fileNamePattern> |  | ||||
|             <maxHistory>30</maxHistory> |  | ||||
|         </rollingPolicy> |  | ||||
|     </appender> |  | ||||
|      |  | ||||
|     <root level="info"> |  | ||||
|         <appender-ref ref="STDOUT" /> |  | ||||
|         <appender-ref ref="FILE" /> |  | ||||
|     </root> |  | ||||
|      |  | ||||
|     <logger name="org.wsp.engine.model.core.code" level="info" additivity="false"/> |  | ||||
|      |  | ||||
|     <logger name="org.wsp.engine.rule.core.code" level="debug" additivity="false"> |  | ||||
|         <appender-ref ref="STDOUT" /> |  | ||||
|         <appender-ref ref="FILE" /> |  | ||||
|     </logger> |  | ||||
| 
 |  | ||||
|     <logger name="org.springframework.security" level="info" additivity="false"> |  | ||||
|         <appender-ref ref="STDOUT" /> |  | ||||
|         <appender-ref ref="FILE" /> |  | ||||
|     </logger> |  | ||||
|      |  | ||||
|      |  | ||||
|     <!-- 可对不同的日志写入不同的文件示例 --> |  | ||||
|     <!--  |  | ||||
|     <appender name="RULE_ENGINE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |  | ||||
|     	<encoder><pattern>${pattern}</pattern></encoder> |  | ||||
|         <file>${homedir}/logs/rule-engine.log</file> |  | ||||
|         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |  | ||||
|             <fileNamePattern>${homedir}/logs/rule-engine.%d.log</fileNamePattern> |  | ||||
|             <maxHistory>30</maxHistory> |  | ||||
|         </rollingPolicy> |  | ||||
|     </appender> |  | ||||
|      |  | ||||
|     <logger name="org.wsp.engine.rule.core.code" level="debug" additivity="false"> |  | ||||
|         <appender-ref ref="STDOUT" /> |  | ||||
|         <appender-ref ref="FILE" /> |  | ||||
|         <appender-ref ref="RULE_ENGINE_FILE" /> |  | ||||
|     </logger> |  | ||||
|     --> |  | ||||
| </configuration> |  | ||||
| @ -1,6 +1,6 @@ | |||||
| dependencies { | dependencies { | ||||
|     api( |     api( | ||||
|         project(":io.sc.platform.orm"), |         project(":io.sc.platform.orm"), | ||||
|         "org.mybatis:mybatis:${mybatis_version}", |         "org.mybatis.spring.boot:mybatis-spring-boot-starter:2.3.2", | ||||
|     ) |     ) | ||||
| } | } | ||||
|  | |||||
| @ -1,2 +1,2 @@ | |||||
| io.sc.platform.security.initializer.CorporationInitializer | io.sc.platform.security.initializer.CorporationInitializer | ||||
| io.sc.platform.security.initializer.AdministratorRoleAndUserInitializer | io.sc.platform.security.initializer.RoleAndUserInitializer | ||||
| @ -1,17 +1,15 @@ | |||||
| package io.sc.platform.system.corporation.controller; | package io.sc.platform.system.corporation.controller; | ||||
| 
 | 
 | ||||
| import io.sc.platform.mvc.controller.support.RestCrudController; | import io.sc.platform.mvc.controller.support.RestCrudController; | ||||
| import io.sc.platform.system.api.corporation.CorporationVo; |  | ||||
| import io.sc.platform.system.corporation.convertor.CorporationEntityVoConverter; | import io.sc.platform.system.corporation.convertor.CorporationEntityVoConverter; | ||||
| import io.sc.platform.system.corporation.jpa.entity.CorporationEntity; | import io.sc.platform.system.corporation.jpa.entity.CorporationEntity; | ||||
| import io.sc.platform.system.corporation.jpa.repository.CorporationRepository; | import io.sc.platform.system.corporation.jpa.repository.CorporationRepository; | ||||
| import io.sc.platform.system.corporation.service.CorporationService; | import io.sc.platform.system.corporation.service.CorporationService; | ||||
| import io.sc.platform.system.org.convertor.OrgEntityVoConverter; |  | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | 
 | ||||
| @RestController | @RestController | ||||
| @RequestMapping("api/system/corporation") | @RequestMapping("api/system/corporation") | ||||
| public class CorporationController extends RestCrudController<CorporationEntity,String,CorporationRepository, CorporationService> { | public class CorporationWebController extends RestCrudController<CorporationEntity,String,CorporationRepository, CorporationService> { | ||||
|     private CorporationEntityVoConverter converter =new CorporationEntityVoConverter(); |     private CorporationEntityVoConverter converter =new CorporationEntityVoConverter(); | ||||
| } | } | ||||
| @ -0,0 +1,92 @@ | |||||
|  | package io.sc.platform.system.initializer; | ||||
|  | 
 | ||||
|  | import io.sc.platform.core.initializer.ApplicationInitializer; | ||||
|  | import io.sc.platform.core.initializer.ApplicationInitializerExecuteException; | ||||
|  | import io.sc.platform.jdbc.sql.builder.SqlBuilder; | ||||
|  | import io.sc.platform.security.service.support.Role; | ||||
|  | import io.sc.platform.system.menu.convertor.MenuEntityVoConvertor; | ||||
|  | import io.sc.platform.system.menu.jpa.entity.MenuEntity; | ||||
|  | import org.slf4j.Logger; | ||||
|  | import org.slf4j.LoggerFactory; | ||||
|  | import org.springframework.context.ApplicationContext; | ||||
|  | import org.springframework.jdbc.core.JdbcTemplate; | ||||
|  | 
 | ||||
|  | import java.util.List; | ||||
|  | 
 | ||||
|  | public class RoleAndMenuInitializer implements ApplicationInitializer{ | ||||
|  | 	private static final Logger log =LoggerFactory.getLogger(RoleAndMenuInitializer.class); | ||||
|  | 	private Boolean isInitialized =null; | ||||
|  | 	private JdbcTemplate jdbcTemplate; | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public void init(ApplicationContext applicationContext) { | ||||
|  | 		this.jdbcTemplate =applicationContext.getBean(JdbcTemplate.class); | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public String getName() { | ||||
|  | 		return "Role and Menu Initializer"; | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public String getDescription() { | ||||
|  | 		return "Initialize Role and Menu"; | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public int getOrder() { | ||||
|  | 		return 3000; | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public synchronized boolean isInitialized() { | ||||
|  | 		if(isInitialized!=null) { | ||||
|  | 			return isInitialized; | ||||
|  | 		} | ||||
|  | 		 | ||||
|  | 		try { | ||||
|  | 			int count = countRoleAndMenu(); | ||||
|  | 			if(count==0) { | ||||
|  | 				isInitialized =false; | ||||
|  | 				return isInitialized; | ||||
|  | 			} | ||||
|  | 		} catch (Exception e) { | ||||
|  | 			log.error("",e); | ||||
|  | 		} | ||||
|  | 		isInitialized =true; | ||||
|  | 		return isInitialized; | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	@Override | ||||
|  | 	public void execute() throws ApplicationInitializerExecuteException { | ||||
|  | 		Role role =findAdminRole(); | ||||
|  | 		if(role!=null){ | ||||
|  | 			List<MenuEntity> menus =findMenus(); | ||||
|  | 			if(menus!=null && !menus.isEmpty()){ | ||||
|  | 				for(MenuEntity menu : menus){ | ||||
|  | 					insertRoleAndMenu(role.getId(),menu.getId()); | ||||
|  | 				} | ||||
|  | 			} | ||||
|  | 		} | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	private Role findAdminRole(){ | ||||
|  | 		return jdbcTemplate.query("select * from SYS_ROLE where CODE_='admin'", Role.getResultSetExtractor()); | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	private List<MenuEntity> findMenus(){ | ||||
|  | 		return jdbcTemplate.query("select * from SYS_MENU",new MenuEntityVoConvertor()); | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	private void insertRoleAndMenu(String roleId,String menuId){ | ||||
|  | 		SqlBuilder.getInsertIntoSqlBuilder() | ||||
|  | 				.table("SYS_ROLE_MENU") | ||||
|  | 				.field("ROLE_ID_",roleId) | ||||
|  | 				.field("MENU_ID_",menuId) | ||||
|  | 				.insert(jdbcTemplate); | ||||
|  | 	} | ||||
|  | 
 | ||||
|  | 	private int countRoleAndMenu(){ | ||||
|  | 		return jdbcTemplate.queryForObject("select count(*) from SYS_ROLE_MENU", Integer.class); | ||||
|  | 	} | ||||
|  | } | ||||
| @ -1,2 +1,3 @@ | |||||
| io.sc.platform.system.initializer.MenuInitializer | io.sc.platform.system.initializer.MenuInitializer | ||||
|  | io.sc.platform.system.initializer.RoleAndMenuInitializer | ||||
| io.sc.platform.system.initializer.ParameterInitializer | io.sc.platform.system.initializer.ParameterInitializer | ||||
					Loading…
					
					
				
		Reference in new issue