├── license-api ├── README.md ├── doc │ ├── img │ │ └── favicon.ico │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── api_project.json │ ├── api_project.js │ ├── vendor │ │ ├── prettify │ │ │ ├── prettify.css │ │ │ ├── lang-rd.js │ │ │ ├── lang-tex.js │ │ │ ├── lang-latex.js │ │ │ ├── lang-go.js │ │ │ ├── lang-proto.js │ │ │ ├── lang-ll.js │ │ │ ├── lang-llvm.js │ │ │ ├── lang-yaml.js │ │ │ ├── lang-yml.js │ │ │ ├── lang-basic.js │ │ │ ├── lang-cbm.js │ │ │ ├── lang-lua.js │ │ │ ├── lang-wiki.js │ │ │ ├── lang-erl.js │ │ │ ├── lang-erlang.js │ │ │ ├── lang-hs.js │ │ │ ├── lang-tcl.js │ │ │ ├── lang-pascal.js │ │ │ ├── lang-r.js │ │ │ ├── lang-s.js │ │ │ ├── lang-Splus.js │ │ │ ├── lang-cl.js │ │ │ ├── lang-el.js │ │ │ ├── lang-lisp.js │ │ │ ├── lang-lsp.js │ │ │ ├── lang-rkt.js │ │ │ ├── lang-scm.js │ │ │ ├── lang-ss.js │ │ │ ├── lang-lgt.js │ │ │ ├── lang-logtalk.js │ │ │ ├── lang-clj.js │ │ │ ├── lang-mumps.js │ │ │ ├── lang-css.js │ │ │ ├── lang-scala.js │ │ │ ├── lang-aea.js │ │ │ ├── lang-agc.js │ │ │ ├── lang-apollo.js │ │ │ ├── lang-dart.js │ │ │ ├── lang-fs.js │ │ │ ├── lang-ml.js │ │ │ ├── lang-swift.js │ │ │ ├── lang-vhd.js │ │ │ ├── lang-vhdl.js │ │ │ ├── lang-n.js │ │ │ ├── lang-nemerle.js │ │ │ ├── lang-rust.js │ │ │ ├── lang-sql.js │ │ │ ├── lang-vb.js │ │ │ ├── lang-vbs.js │ │ │ ├── lang-ls.js │ │ │ ├── lang-lasso.js │ │ │ └── lang-lassoscript.js │ │ ├── path-to-regexp │ │ │ └── LICENSE │ │ ├── prettify.css │ │ ├── prism.css │ │ └── polyfill.js │ ├── locales │ │ ├── zh.js │ │ ├── zh_cn.js │ │ ├── tr.js │ │ ├── pl.js │ │ ├── ca.js │ │ ├── cs.js │ │ ├── vi.js │ │ ├── ro.js │ │ ├── de.js │ │ ├── pt_br.js │ │ ├── ru.js │ │ ├── es.js │ │ ├── nl.js │ │ ├── fr.js │ │ ├── it.js │ │ └── locale.js │ └── utils │ │ └── send_sample_request_utils.js └── src │ └── apidoc.json ├── license-app ├── src │ └── main │ │ ├── resources │ │ ├── license.lic │ │ ├── application.properties │ │ ├── application-creator.properties │ │ └── application-verify.properties │ │ └── java │ │ └── com │ │ └── appleyk │ │ └── app │ │ ├── listener │ │ ├── CustomVerifyListenerB.java │ │ └── CustomVerifyListenerA.java │ │ ├── LicenseApp.java │ │ └── excep │ │ └── ExceptionControllerAdvice.java └── pom.xml ├── license-creator ├── src │ └── main │ │ ├── resources │ │ ├── privateKeys.store │ │ └── META-INF │ │ │ ├── spring.factories │ │ │ └── additional-spring-configuration-metadata.json │ │ └── java │ │ └── com │ │ └── appleyk │ │ └── creator │ │ ├── config │ │ ├── LicenseCreatorAutoConfigure.java │ │ └── LicenseCreatorProperties.java │ │ └── service │ │ └── LicenseCreatorService.java └── pom.xml ├── license-verify ├── src │ └── main │ │ ├── resources │ │ ├── publicCerts.store │ │ ├── templates │ │ │ ├── success.html │ │ │ └── login.html │ │ └── META-INF │ │ │ ├── spring.factories │ │ │ └── additional-spring-configuration-metadata.json │ │ └── java │ │ └── com │ │ └── appleyk │ │ └── verify │ │ ├── annotion │ │ └── VLicense.java │ │ ├── controller │ │ ├── PageController.java │ │ ├── VerifyTestController.java │ │ └── LoginTestController.java │ │ ├── config │ │ ├── LicenseVerifyAutoConfigure.java │ │ ├── LicenseInterceptorConfig.java │ │ └── LicenseVerifyProperties.java │ │ ├── listener │ │ ├── ACustomVerifyListener.java │ │ └── LicenseVerifyListener.java │ │ └── interceptor │ │ └── LicenseVerifyInterceptor.java └── pom.xml ├── license-core ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── spring.factories │ │ └── java │ │ └── com │ │ └── appleyk │ │ └── core │ │ ├── config │ │ └── LicenseCoreAutoConfigure.java │ │ ├── controller │ │ └── HardWareInfoController.java │ │ ├── helper │ │ ├── LoggerHelper.java │ │ ├── ServerSerialHelper.java │ │ └── ParamInitHelper.java │ │ ├── result │ │ ├── ResultCode.java │ │ └── ResponseResult.java │ │ ├── ex │ │ └── CommonException.java │ │ ├── model │ │ ├── LicenseResult.java │ │ ├── LicenseVerifyParam.java │ │ ├── LicenseCreatorManager.java │ │ ├── LicenseVerifyManager.java │ │ └── LicenseExtraParam.java │ │ ├── service │ │ ├── LinuxServerInfos.java │ │ └── WindowsServerInfos.java │ │ └── utils │ │ ├── JsonUtils.java │ │ └── DateUtils.java └── pom.xml ├── src └── main │ └── resources │ └── application.properties ├── README.md └── pom.xml /license-api/README.md: -------------------------------------------------------------------------------- 1 | # license-api 2 | 软件许可证书接口文档 3 | 4 | ## npm install -g apidoc 5 | 6 | ## apidoc -i src/ -o doc/ -------------------------------------------------------------------------------- /license-api/doc/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-api/doc/img/favicon.ico -------------------------------------------------------------------------------- /license-app/src/main/resources/license.lic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-app/src/main/resources/license.lic -------------------------------------------------------------------------------- /license-creator/src/main/resources/privateKeys.store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-creator/src/main/resources/privateKeys.store -------------------------------------------------------------------------------- /license-verify/src/main/resources/publicCerts.store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-verify/src/main/resources/publicCerts.store -------------------------------------------------------------------------------- /license-api/doc/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-api/doc/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /license-api/doc/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-api/doc/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /license-api/doc/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-api/doc/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /license-verify/src/main/resources/templates/success.html: -------------------------------------------------------------------------------- 1 | 2 | 认证登录 3 | 4 | License证书文件验证成功,欢迎关注一波! 5 | 6 | -------------------------------------------------------------------------------- /license-api/doc/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/product/license/master/license-api/doc/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /license-core/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.appleyk.core.config.LicenseCoreAutoConfigure -------------------------------------------------------------------------------- /license-creator/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.appleyk.creator.config.LicenseCreatorAutoConfigure -------------------------------------------------------------------------------- /license-verify/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.appleyk.verify.config.LicenseVerifyAutoConfigure -------------------------------------------------------------------------------- /license-app/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | 3 | #激活creator配置类 4 | #spring.profiles.active = creator 5 | 6 | #激活verify配置类 7 | spring.profiles.active = verify 8 | -------------------------------------------------------------------------------- /license-api/src/apidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "License接口API", 3 | "version": "0.2.1", 4 | "description": "v0.2.1 系统软件许可证书 -- 接口文档", 5 | "title": "系统软件许可证书API", 6 | "url" : "http://127.0.0.1:8080", 7 | "template": { 8 | "withCompare": true, 9 | "withGenerator": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /license-app/src/main/resources/application-creator.properties: -------------------------------------------------------------------------------- 1 | 2 | #================License Creator 证书生成配置类===============# 3 | 4 | #License文件自动生成时的临时路径(请注意Windows、Linux、Mac系统的路径区分) 5 | #springboot.license.generate.tempPath=/data/license/ 6 | 7 | #License文件所在的服务器请求下载地址的前缀 8 | springboot.license.server.prefix = http://localhost:8080/license/ 9 | 10 | #================License Creator 证书生成配置类===============# -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8066 2 | 3 | #================License相关配置===============# 4 | 5 | #证书名称 6 | license.subject=landi 7 | #公钥别名 8 | license.publicAlias=publicCert 9 | #公钥库所在的位置 10 | license.publicKeysStorePath=/publicCerts.store 11 | #公钥库访问密码 12 | license.storePass=123456a 13 | #证书所在的位置 14 | license.licensePath =F:\\app\\license.lic 15 | 16 | #================License相关配置===============# 17 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/annotion/VLicense.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.annotion; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.METHOD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface VLicense { 11 | String[] verifies() default{}; 12 | } 13 | -------------------------------------------------------------------------------- /license-creator/src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { "groups": [ 2 | { 3 | "name": "springboot.license.generate", 4 | "sourceType": "com.appleyk.creator.config.LicenseCreatorProperties", 5 | "type": "com.appleyk.creator.config.LicenseCreatorProperties" 6 | } 7 | ], 8 | "properties": [ 9 | { 10 | "name": "springboot.license.generate.tempPath", 11 | "type": "java.lang.String", 12 | "description": "证书生成临时路径." 13 | } 14 | ] } -------------------------------------------------------------------------------- /license-api/doc/api_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "License接口API", 3 | "version": "0.2.1", 4 | "description": "v0.2.1 系统软件许可证书 -- 接口文档", 5 | "title": "系统软件许可证书API", 6 | "url": "http://127.0.0.1:8080", 7 | "template": { 8 | "withCompare": true, 9 | "withGenerator": true 10 | }, 11 | "sampleUrl": false, 12 | "defaultVersion": "0.0.0", 13 | "apidoc": "0.3.0", 14 | "generator": { 15 | "name": "apidoc", 16 | "time": "2020-08-21T17:02:50.014Z", 17 | "url": "https://apidocjs.com", 18 | "version": "0.25.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /license-api/doc/api_project.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "name": "License接口API", 3 | "version": "0.2.1", 4 | "description": "v0.2.1 系统软件许可证书 -- 接口文档", 5 | "title": "系统软件许可证书API", 6 | "url": "http://127.0.0.1:8080", 7 | "template": { 8 | "withCompare": true, 9 | "withGenerator": true 10 | }, 11 | "sampleUrl": false, 12 | "defaultVersion": "0.0.0", 13 | "apidoc": "0.3.0", 14 | "generator": { 15 | "name": "apidoc", 16 | "time": "2020-08-21T17:02:50.014Z", 17 | "url": "https://apidocjs.com", 18 | "version": "0.25.0" 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/controller/PageController.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | 7 | /** 8 | *

WebPage映射

9 | * 10 | * @author appleyk 11 | * @version V.0.2.1 12 | * @blob https://blog.csdn.net/appleyk 13 | * @date created on 00:02 上午 2020/8/22 14 | */ 15 | @Controller 16 | public class PageController { 17 | 18 | @GetMapping("/{page}") 19 | public String getLogin(@PathVariable(name = "page") String page){ 20 | return page+".html"; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/config/LicenseCoreAutoConfigure.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.config; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | import org.springframework.context.annotation.ComponentScan; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | *

license-core模块中的Bean实现自动装配 -- 配置类

9 | * 10 | * @author appleyk 11 | * @version V.0.2.1 12 | * @blob https://blog.csdn.net/appleyk 13 | * @date created on 10:24 下午 2020/8/21 14 | */ 15 | @Configuration 16 | @ComponentScan(basePackages = {"com.appleyk.core"}) 17 | public class LicenseCoreAutoConfigure { 18 | public LicenseCoreAutoConfigure(){ 19 | LoggerHelper.info("============ license-core-spring-boot-starter initialization! ==========="); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/config/LicenseVerifyAutoConfigure.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.config; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | import org.springframework.context.annotation.ComponentScan; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | *

License验证模块自动扫包/装配Bean实例

9 | * 10 | * @author appleyk 11 | * @version V.0.2.1 12 | * @blob https://blog.csdn.net/appleyk 13 | * @date created on 00:02 上午 2020/8/22 14 | */ 15 | @Configuration 16 | @ComponentScan(basePackages = {"com.appleyk.verify"}) 17 | public class LicenseVerifyAutoConfigure { 18 | 19 | public LicenseVerifyAutoConfigure(){ 20 | LoggerHelper.info("============ license-verify-spring-boot-starter initialization! ==========="); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /license-app/src/main/java/com/appleyk/app/listener/CustomVerifyListenerB.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.app.listener; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | import com.appleyk.core.model.LicenseExtraParam; 5 | import com.appleyk.verify.listener.ACustomVerifyListener; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | *

Lic自定义验证监听器B

10 | * 11 | * @author appleyk 12 | * @version V.0.2.1 13 | * @blob https://blog.csdn.net/appleyk 14 | * @date created on 10:24 下午 2020/8/21 15 | */ 16 | @Component 17 | public class CustomVerifyListenerB extends ACustomVerifyListener { 18 | @Override 19 | public boolean verify(LicenseExtraParam licenseExtra) throws CommonException { 20 | System.out.println("======= 自定义证书验证监听器B 实现verify方法 ======="); 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/controller/VerifyTestController.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.controller; 2 | 3 | import com.appleyk.verify.annotion.VLicense; 4 | import org.springframework.web.bind.annotation.CrossOrigin; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | /** 10 | *

证书认证接口测试

11 | * 12 | * @author appleyk 13 | * @version V.0.2.1 14 | * @blob https://blog.csdn.net/appleyk 15 | * @date created on 00:02 上午 2020/8/22 16 | */ 17 | @CrossOrigin 18 | @RestController 19 | @RequestMapping("license") 20 | public class VerifyTestController { 21 | 22 | @VLicense 23 | @GetMapping("/hello") 24 | public String sayHello(){ 25 | return "hello license !"; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[a-zA-Z@]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[{}()\[\]]+/]]),["Rd","rd"]); 18 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Martin S. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); 18 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-latex.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Martin S. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); 18 | -------------------------------------------------------------------------------- /license-creator/src/main/java/com/appleyk/creator/config/LicenseCreatorAutoConfigure.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.creator.config; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | *

License生成模块自动扫包/装配Bean实例

10 | * 11 | * @author appleyk 12 | * @version V.0.2.1 13 | * @blob https://blog.csdn.net/appleyk 14 | * @date created on 11:33 下午 2020/8/21 15 | */ 16 | @Configuration 17 | @ComponentScan(basePackages = {"com.appleyk.creator"}) 18 | @EnableConfigurationProperties({LicenseCreatorProperties.class}) 19 | public class LicenseCreatorAutoConfigure { 20 | public LicenseCreatorAutoConfigure(){ 21 | LoggerHelper.info("============ license-creator-spring-boot-starter initialization! ==========="); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],["pln",/^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]]),["go"]); 18 | -------------------------------------------------------------------------------- /license-app/src/main/java/com/appleyk/app/LicenseApp.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | 8 | /** 9 | *

SpringBoot启动类

10 | * 11 | * @author appleyk 12 | * @version V.0.2.1 13 | * @blob https://blog.csdn.net/appleyk 14 | * @date created on 10:24 下午 2020/8/21 15 | */ 16 | @SpringBootApplication 17 | public class LicenseApp extends SpringBootServletInitializer { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(LicenseApp.class, args); 21 | } 22 | 23 | @Override 24 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 25 | return application.sources(LicenseApp.class); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2006 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 18 | -------------------------------------------------------------------------------- /license-creator/src/main/java/com/appleyk/creator/config/LicenseCreatorProperties.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.creator.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | *

License生成配置类

9 | * 10 | * @author appleyk 11 | * @version V.0.2.1 12 | * @blob https://blog.csdn.net/appleyk 13 | * @date created on 11:35 下午 2020/8/21 14 | */ 15 | @ConfigurationProperties(prefix = "springboot.license.generate") 16 | public class LicenseCreatorProperties { 17 | 18 | /**证书生成临时存放路径*/ 19 | private String tempPath; 20 | 21 | public LicenseCreatorProperties() { 22 | } 23 | 24 | public String getTempPath() { 25 | return tempPath; 26 | } 27 | 28 | public void setTempPath(String tempPath) { 29 | this.tempPath = tempPath; 30 | File file = new File(tempPath); 31 | if(!file.exists()){ 32 | file.mkdirs(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /license-app/src/main/resources/application-verify.properties: -------------------------------------------------------------------------------- 1 | 2 | #================License Verify \u8BC1\u4E66\u9A8C\u8BC1\u914D\u7F6EE===============# 3 | 4 | #\u8BC1\u4E66\u4E3B\u9898 5 | springboot.license.verify.subject=landi 6 | #\u516C\u94A5\u5E93\u8BC1\u4E66\u6761\u76EE\u522B\u540D 7 | springboot.license.verify.publicAlias=publiccert 8 | #\u8BC1\u4E66\u516C\u94A5\u5E93\u5B58\u50A8\u8DEF\u5F84(\u516C\u94A5\u5E93\u53EF\u4EE5\u516C\u5F00\u51FA\u53BB\uFF0C\u4F46\u662F\u79C1\u6709\u5BC6\u94A5\u5E93\u4E00\u5B9A\u8981\u81EA\u5DF1\u4FDD\u5B58\u597D\uFF0C\u5373\u79C1\u6709\u5BC6\u94A5\u5E93\u8981\u4FDD\u5B58\u5728creator\u6A21\u5757\u4E2D) 9 | springboot.license.verify.publicKeysStorePath=/publicCerts.store 10 | #\u8BC1\u4E66\u516C\u94A5\u5E93\u8BBF\u95EE\u5BC6\u7801 11 | springboot.license.verify.storePass=123456a 12 | #\u8BC1\u4E66\u5B58\u653E\u8DEF\u5F84 13 | springboot.license.verify.licensePath=classpath:license.lic 14 | 15 | #================License Verify \u8BC1\u4E66\u9A8C\u8BC1\u914D\u7F6EE===============# -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-ll.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Nikhil Dabas 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); 18 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Nikhil Dabas 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); 18 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/config/LicenseInterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.config; 2 | 3 | import com.appleyk.verify.interceptor.LicenseVerifyInterceptor; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description: License拦截器配置类 11 | * 12 | * @author appleyk 13 | * @version V.0.2.1 14 | * @blob https://blog.csdn.net/appleyk 15 | * @date created on 00:02 上午 2020/8/22 16 | */ 17 | @Configuration 18 | public class LicenseInterceptorConfig implements WebMvcConfigurer { 19 | 20 | @Bean 21 | public LicenseVerifyInterceptor getLicenseCheckInterceptor() { 22 | return new LicenseVerifyInterceptor(); 23 | } 24 | 25 | @Override 26 | public void addInterceptors(InterceptorRegistry registry) { 27 | registry.addInterceptor(this.getLicenseCheckInterceptor()).addPathPatterns("/**"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 ribrdb @ code.google.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", 18 | /^\w+/]]),["yaml","yml"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-yml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 ribrdb @ code.google.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", 18 | /^\w+/]]),["yaml","yml"]); 19 | -------------------------------------------------------------------------------- /license-verify/src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": [ 3 | { 4 | "name": "springboot.license", 5 | "sourceType": "com.appleyk.verify.config.LicenseVerifyProperties", 6 | "type": "com.appleyk.verify.config.LicenseVerifyProperties" 7 | } 8 | ], 9 | "properties": [ 10 | { 11 | "name": "springboot.license.verify.subject", 12 | "type": "java.lang.String", 13 | "description": "证书名称." 14 | }, 15 | { 16 | "name": "springboot.license.verify.publicAlias", 17 | "type": "java.lang.String", 18 | "description": "公钥别名." 19 | }, 20 | { 21 | "name": "springboot.license.verify.publicKeysStorePath", 22 | "type": "java.lang.String", 23 | "description": "公钥库所在的位置." 24 | }, 25 | { 26 | "name": "springboot.license.verify.storePass", 27 | "type": "java.lang.String", 28 | "description": "公钥库访问密码." 29 | }, 30 | { 31 | "name": "springboot.license.verify.licensePath", 32 | "type": "java.lang.String", 33 | "description": "证书所在的位置." 34 | } 35 | ] } -------------------------------------------------------------------------------- /license-api/doc/locales/zh.js: -------------------------------------------------------------------------------- 1 | define({ 2 | zh: { 3 | 'Allowed values​​:' : '允許值:', 4 | 'Compare all with predecessor': '預先比較所有', 5 | 'compare changes to:' : '比較變更:', 6 | 'compared to' : '對比', 7 | 'Default value:' : '預設值:', 8 | 'Description' : '描述', 9 | 'Field' : '欄位', 10 | 'General' : '概括', 11 | 'Generated with' : '生成工具', 12 | 'Name' : '名稱', 13 | 'No response values​​.' : '無對應資料.', 14 | 'optional' : '選填', 15 | 'Parameter' : '參數', 16 | 'Permission:' : '權限:', 17 | 'Response' : '回應', 18 | 'Send' : '發送', 19 | 'Send a Sample Request' : '發送試用需求', 20 | 'show up to version:' : '顯示到版本:', 21 | 'Size range:' : '區間:', 22 | 'Type' : '類型', 23 | 'url' : '網址' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, 18 | null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-cbm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, 18 | null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/path-to-regexp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], 18 | ["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t \xA0a-gi-z0-9]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),["wiki"]); 18 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 19 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/controller/HardWareInfoController.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.controller; 2 | 3 | import com.appleyk.core.result.ResponseResult; 4 | import com.appleyk.core.service.AServerInfos; 5 | import org.springframework.http.MediaType; 6 | import org.springframework.web.bind.annotation.CrossOrigin; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | *

服务器硬件信息获取API

13 | * 14 | * @author appleyk 15 | * @version V.0.2.1 16 | * @blob https://blog.csdn.net/appleyk 17 | * @date created on 10:30 下午 2020/8/21 18 | */ 19 | @CrossOrigin 20 | @RestController 21 | @RequestMapping("/license") 22 | public class HardWareInfoController { 23 | 24 | /** 25 | *

获取服务器硬件信息

26 | * @param osName 操作系统类型,如果为空则自动判断 27 | */ 28 | @RequestMapping(value = "/getServerInfos",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE}) 29 | public ResponseResult getServerInfos(@RequestParam(value = "osName",required = false) String osName) { 30 | return ResponseResult.ok(AServerInfos.getServer(osName).getServerInfos()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /license-api/doc/locales/zh_cn.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'zh_cn': { 3 | 'Allowed values:' : '允许值:', 4 | 'Compare all with predecessor': '与所有较早的比较', 5 | 'compare changes to:' : '将当前版本与指定版本比较:', 6 | 'compared to' : '相比于', 7 | 'Default value:' : '默认值:', 8 | 'Description' : '描述', 9 | 'Field' : '字段', 10 | 'General' : '概要', 11 | 'Generated with' : '基于', 12 | 'Name' : '名称', 13 | 'No response values.' : '无返回值.', 14 | 'optional' : '可选', 15 | 'Parameter' : '参数', 16 | 'Parameters' : '参数', 17 | 'Headers' : '头部参数', 18 | 'Permission:' : '权限:', 19 | 'Response' : '返回', 20 | 'Send' : '发送', 21 | 'Send a Sample Request' : '发送示例请求', 22 | 'show up to version:' : '显示到指定版本:', 23 | 'Size range:' : '取值范围:', 24 | 'Type' : '类型', 25 | 'url' : '网址' 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/helper/LoggerHelper.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.helper; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | *

日志输出辅助类

8 | * 9 | * @author appleyk 10 | * @version V.0.2.1 11 | * @blob https://blog.csdn.net/appleyk 12 | * @date created on 10:42 下午 2020/8/21 13 | */ 14 | public class LoggerHelper { 15 | 16 | private static Logger logger = LoggerFactory.getLogger(LoggerHelper.class); 17 | public LoggerHelper() { 18 | } 19 | 20 | public static void info(String message) { 21 | logger.info(message); 22 | } 23 | public static void debug(String message) { 24 | logger.debug(message); 25 | } 26 | public static void error(String message, Exception ex) { 27 | logger.error(message, ex); 28 | } 29 | public static void error(Integer errCode, String message) { 30 | logger.error("错误码:" + errCode + ",错误消息:" + message); 31 | } 32 | public static void error(String message) { 33 | logger.error("错误消息:" + message); 34 | } 35 | public static void error(Integer errCode, String message, Exception ex) { 36 | logger.error("错误码:" + errCode + ",错误消息:" + message + ",异常信息:" + ex.getMessage()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-erl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Andrew Allen 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 18 | ["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Andrew Allen 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 18 | ["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, 18 | null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/locales/tr.js: -------------------------------------------------------------------------------- 1 | define({ 2 | tr: { 3 | 'Allowed values:' : 'İzin verilen değerler:', 4 | 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır', 5 | 'compare changes to:' : 'değişiklikleri karşılaştır:', 6 | 'compared to' : 'karşılaştır', 7 | 'Default value:' : 'Varsayılan değer:', 8 | 'Description' : 'Açıklama', 9 | 'Field' : 'Alan', 10 | 'General' : 'Genel', 11 | 'Generated with' : 'Oluşturan', 12 | 'Name' : 'İsim', 13 | 'No response values.' : 'Dönüş verisi yok.', 14 | 'optional' : 'opsiyonel', 15 | 'Parameter' : 'Parametre', 16 | 'Permission:' : 'İzin:', 17 | 'Response' : 'Dönüş', 18 | 'Send' : 'Gönder', 19 | 'Send a Sample Request' : 'Örnek istek gönder', 20 | 'show up to version:' : 'bu versiyona kadar göster:', 21 | 'Size range:' : 'Boyut aralığı:', 22 | 'Type' : 'Tip', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/pl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | pl: { 3 | 'Allowed values:' : 'Dozwolone wartości:', 4 | 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', 5 | 'compare changes to:' : 'porównaj zmiany do:', 6 | 'compared to' : 'porównaj do:', 7 | 'Default value:' : 'Wartość domyślna:', 8 | 'Description' : 'Opis', 9 | 'Field' : 'Pole', 10 | 'General' : 'Generalnie', 11 | 'Generated with' : 'Wygenerowano z', 12 | 'Name' : 'Nazwa', 13 | 'No response values.' : 'Brak odpowiedzi.', 14 | 'optional' : 'opcjonalny', 15 | 'Parameter' : 'Parametr', 16 | 'Permission:' : 'Uprawnienia:', 17 | 'Response' : 'Odpowiedź', 18 | 'Send' : 'Wyślij', 19 | 'Send a Sample Request' : 'Wyślij przykładowe żądanie', 20 | 'show up to version:' : 'pokaż do wersji:', 21 | 'Size range:' : 'Zakres rozmiaru:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/ca.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ca: { 3 | 'Allowed values:' : 'Valors permesos:', 4 | 'Compare all with predecessor': 'Comparar tot amb versió anterior', 5 | 'compare changes to:' : 'comparar canvis amb:', 6 | 'compared to' : 'comparat amb', 7 | 'Default value:' : 'Valor per defecte:', 8 | 'Description' : 'Descripció', 9 | 'Field' : 'Camp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat amb', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Sense valors en la resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Paràmetre', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petició d\'exemple', 20 | 'show up to version:' : 'mostrar versió:', 21 | 'Size range:' : 'Tamany de rang:', 22 | 'Type' : 'Tipus', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/cs.js: -------------------------------------------------------------------------------- 1 | define({ 2 | cs: { 3 | 'Allowed values:' : 'Povolené hodnoty:', 4 | 'Compare all with predecessor': 'Porovnat vše s předchozími verzemi', 5 | 'compare changes to:' : 'porovnat změny s:', 6 | 'compared to' : 'porovnat s', 7 | 'Default value:' : 'Výchozí hodnota:', 8 | 'Description' : 'Popis', 9 | 'Field' : 'Pole', 10 | 'General' : 'Obecné', 11 | 'Generated with' : 'Vygenerováno pomocí', 12 | 'Name' : 'Název', 13 | 'No response values.' : 'Nebyly vráceny žádné hodnoty.', 14 | 'optional' : 'volitelné', 15 | 'Parameter' : 'Parametr', 16 | 'Permission:' : 'Oprávnění:', 17 | 'Response' : 'Odpověď', 18 | 'Send' : 'Odeslat', 19 | 'Send a Sample Request' : 'Odeslat ukázkový požadavek', 20 | 'show up to version:' : 'zobrazit po verzi:', 21 | 'Size range:' : 'Rozsah velikosti:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/vi.js: -------------------------------------------------------------------------------- 1 | define({ 2 | vi: { 3 | 'Allowed values:' : 'Giá trị chấp nhận:', 4 | 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước', 5 | 'compare changes to:' : 'so sánh sự thay đổi với:', 6 | 'compared to' : 'so sánh với', 7 | 'Default value:' : 'Giá trị mặc định:', 8 | 'Description' : 'Chú thích', 9 | 'Field' : 'Trường dữ liệu', 10 | 'General' : 'Tổng quan', 11 | 'Generated with' : 'Được tạo bởi', 12 | 'Name' : 'Tên', 13 | 'No response values.' : 'Không có kết quả trả về.', 14 | 'optional' : 'Tùy chọn', 15 | 'Parameter' : 'Tham số', 16 | 'Permission:' : 'Quyền hạn:', 17 | 'Response' : 'Kết quả', 18 | 'Send' : 'Gửi', 19 | 'Send a Sample Request' : 'Gửi một yêu cầu mẫu', 20 | 'show up to version:' : 'hiển thị phiên bản:', 21 | 'Size range:' : 'Kích cỡ:', 22 | 'Type' : 'Kiểu', 23 | 'url' : 'liên kết' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Pyrios 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\{+/,null,"{"],["clo",/^\}+/,null,"}"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i], 18 | ["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["tcl"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/locales/ro.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ro: { 3 | 'Allowed values:' : 'Valori permise:', 4 | 'Compare all with predecessor': 'Compară toate cu versiunea precedentă', 5 | 'compare changes to:' : 'compară cu versiunea:', 6 | 'compared to' : 'comparat cu', 7 | 'Default value:' : 'Valoare implicită:', 8 | 'Description' : 'Descriere', 9 | 'Field' : 'Câmp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat cu', 12 | 'Name' : 'Nume', 13 | 'No response values.' : 'Nici o valoare returnată.', 14 | 'optional' : 'opțional', 15 | 'Parameter' : 'Parametru', 16 | 'Permission:' : 'Permisiune:', 17 | 'Response' : 'Răspuns', 18 | 'Send' : 'Trimite', 19 | 'Send a Sample Request' : 'Trimite o cerere de probă', 20 | 'show up to version:' : 'arată până la versiunea:', 21 | 'Size range:' : 'Interval permis:', 22 | 'Type' : 'Tip', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/de.js: -------------------------------------------------------------------------------- 1 | define({ 2 | de: { 3 | 'Allowed values:' : 'Erlaubte Werte:', 4 | 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 5 | 'compare changes to:' : 'vergleiche Änderungen mit:', 6 | 'compared to' : 'verglichen mit', 7 | 'Default value:' : 'Standardwert:', 8 | 'Description' : 'Beschreibung', 9 | 'Field' : 'Feld', 10 | 'General' : 'Allgemein', 11 | 'Generated with' : 'Erstellt mit', 12 | 'Name' : 'Name', 13 | 'No response values.' : 'Keine Rückgabewerte.', 14 | 'optional' : 'optional', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Berechtigung:', 17 | 'Response' : 'Antwort', 18 | 'Send' : 'Senden', 19 | 'Send a Sample Request' : 'Eine Beispielanfrage senden', 20 | 'show up to version:' : 'zeige bis zur Version:', 21 | 'Size range:' : 'Größenbereich:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/pt_br.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'pt_br': { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Compare todos com antecessores', 5 | 'compare changes to:' : 'comparar alterações com:', 6 | 'compared to' : 'comparado com', 7 | 'Default value:' : 'Valor padrão:', 8 | 'Description' : 'Descrição', 9 | 'Field' : 'Campo', 10 | 'General' : 'Geral', 11 | 'Generated with' : 'Gerado com', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Sem valores de resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parâmetro', 16 | 'Permission:' : 'Permissão:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', 20 | 'show up to version:' : 'aparecer para a versão:', 21 | 'Size range:' : 'Faixa de tamanho:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/ru.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ru: { 3 | 'Allowed values:' : 'Допустимые значения:', 4 | 'Compare all with predecessor': 'Сравнить с предыдущей версией', 5 | 'compare changes to:' : 'сравнить с:', 6 | 'compared to' : 'в сравнении с', 7 | 'Default value:' : 'По умолчанию:', 8 | 'Description' : 'Описание', 9 | 'Field' : 'Название', 10 | 'General' : 'Общая информация', 11 | 'Generated with' : 'Сгенерировано с помощью', 12 | 'Name' : 'Название', 13 | 'No response values.' : 'Нет значений для ответа.', 14 | 'optional' : 'необязательный', 15 | 'Parameter' : 'Параметр', 16 | 'Permission:' : 'Разрешено:', 17 | 'Response' : 'Ответ', 18 | 'Send' : 'Отправить', 19 | 'Send a Sample Request' : 'Отправить тестовый запрос', 20 | 'show up to version:' : 'показать версию:', 21 | 'Size range:' : 'Ограничения:', 22 | 'Type' : 'Тип', 23 | 'url' : 'URL' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/es.js: -------------------------------------------------------------------------------- 1 | define({ 2 | es: { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Comparar todo con versión anterior', 5 | 'compare changes to:' : 'comparar cambios con:', 6 | 'compared to' : 'comparado con', 7 | 'Default value:' : 'Valor por defecto:', 8 | 'Description' : 'Descripción', 9 | 'Field' : 'Campo', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generado con', 12 | 'Name' : 'Nombre', 13 | 'No response values.' : 'Sin valores en la respuesta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parámetro', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Respuesta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petición de ejemplo', 20 | 'show up to version:' : 'mostrar a versión:', 21 | 'Size range:' : 'Tamaño de rango:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/nl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | nl: { 3 | 'Allowed values:' : 'Toegestane waarden:', 4 | 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', 5 | 'compare changes to:' : 'vergelijk veranderingen met:', 6 | 'compared to' : 'vergelijk met', 7 | 'Default value:' : 'Standaard waarde:', 8 | 'Description' : 'Omschrijving', 9 | 'Field' : 'Veld', 10 | 'General' : 'Algemeen', 11 | 'Generated with' : 'Gegenereerd met', 12 | 'Name' : 'Naam', 13 | 'No response values.' : 'Geen response waardes.', 14 | 'optional' : 'optioneel', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Permissie:', 17 | 'Response' : 'Antwoorden', 18 | 'Send' : 'Sturen', 19 | 'Send a Sample Request' : 'Stuur een sample aanvragen', 20 | 'show up to version:' : 'toon tot en met versie:', 21 | 'Size range:' : 'Maatbereik:', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/fr.js: -------------------------------------------------------------------------------- 1 | define({ 2 | fr: { 3 | 'Allowed values:' : 'Valeurs autorisées :', 4 | 'Compare all with predecessor': 'Tout comparer avec ...', 5 | 'compare changes to:' : 'comparer les changements à :', 6 | 'compared to' : 'comparer à', 7 | 'Default value:' : 'Valeur par défaut :', 8 | 'Description' : 'Description', 9 | 'Field' : 'Champ', 10 | 'General' : 'Général', 11 | 'Generated with' : 'Généré avec', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Aucune valeur de réponse.', 14 | 'optional' : 'optionnel', 15 | 'Parameter' : 'Paramètre', 16 | 'Permission:' : 'Permission :', 17 | 'Response' : 'Réponse', 18 | 'Send' : 'Envoyer', 19 | 'Send a Sample Request' : 'Envoyer une requête représentative', 20 | 'show up to version:' : 'Montrer à partir de la version :', 21 | 'Size range:' : 'Ordre de grandeur :', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/locales/it.js: -------------------------------------------------------------------------------- 1 | define({ 2 | it: { 3 | 'Allowed values:' : 'Valori permessi:', 4 | 'Compare all with predecessor': 'Confronta tutto con versioni precedenti', 5 | 'compare changes to:' : 'confronta modifiche con:', 6 | 'compared to' : 'confrontato con', 7 | 'Default value:' : 'Valore predefinito:', 8 | 'Description' : 'Descrizione', 9 | 'Field' : 'Campo', 10 | 'General' : 'Generale', 11 | 'Generated with' : 'Creato con', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Nessun valore di risposta.', 14 | 'optional' : 'opzionale', 15 | 'Parameter' : 'Parametro', 16 | 'Permission:' : 'Permessi:', 17 | 'Response' : 'Risposta', 18 | 'Send' : 'Invia', 19 | 'Send a Sample Request' : 'Invia una richiesta di esempio', 20 | 'show up to version:' : 'mostra alla versione:', 21 | 'Size range:' : 'Intervallo dimensione:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/,null,"'"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^\(\*[\s\S]*?(?:\*\)|$)|^\{[\s\S]*?(?:\}|$)/,null],["kwd",/^(?:ABSOLUTE|AND|ARRAY|ASM|ASSEMBLER|BEGIN|CASE|CONST|CONSTRUCTOR|DESTRUCTOR|DIV|DO|DOWNTO|ELSE|END|EXTERNAL|FOR|FORWARD|FUNCTION|GOTO|IF|IMPLEMENTATION|IN|INLINE|INTERFACE|INTERRUPT|LABEL|MOD|NOT|OBJECT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|SHL|SHR|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|VIRTUAL|WHILE|WITH|XOR)\b/i, 18 | null],["lit",/^(?:true|false|self|nil)/i,null],["pln",/^[a-z][a-z0-9]*/i,null],["lit",/^(?:\$[a-f0-9]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?)/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\/]*/,null]]),["pascal"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-s.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-Splus.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-cl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-el.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-lsp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-rkt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-scm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-ss.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /license-creator/src/main/java/com/appleyk/creator/service/LicenseCreatorService.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.creator.service; 2 | 3 | import com.appleyk.core.model.LicenseCreatorManager; 4 | import com.appleyk.core.model.LicenseCreatorParam; 5 | import com.appleyk.core.model.LicenseResult; 6 | import com.appleyk.core.result.ResponseResult; 7 | import com.appleyk.core.utils.DateUtils; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.text.MessageFormat; 11 | 12 | /** 13 | *

证书生成接口实现

14 | * 15 | * @author appleyk 16 | * @version V.0.2.1 17 | * @blob https://blog.csdn.net/appleyk 18 | * @date created on 11:43 下午 2020/8/21 19 | */ 20 | @Service 21 | public class LicenseCreatorService { 22 | /** 23 | *

生成证书

24 | * @param param 证书创建需要的参数对象 25 | * @return Map 26 | */ 27 | public ResponseResult generateLicense(LicenseCreatorParam param) { 28 | LicenseCreatorManager licenseCreator = new LicenseCreatorManager(param); 29 | LicenseResult licenseResult = licenseCreator.generateLicense(); 30 | if(licenseResult.getResult()){ 31 | String message = MessageFormat.format("证书生成成功,证书有效期:{0} - {1}", 32 | DateUtils.date2Str(param.getIssuedTime()), DateUtils.date2Str(param.getExpiryTime())); 33 | return ResponseResult.ok(message,param); 34 | }else{ 35 | return ResponseResult.fail("证书文件生成失败!"); 36 | } 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/listener/ACustomVerifyListener.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.listener; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | import com.appleyk.core.model.LicenseExtraParam; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | *

增加业务系统中自定义证书验证监听器

11 | * 12 | * @author appleyk 13 | * @version V.0.2.1 14 | * @blob https://blog.csdn.net/appleyk 15 | * @date created on 00:02 上午 2020/8/22 16 | * @date updated on 23:09 下午 2020/8/30 17 | */ 18 | public abstract class ACustomVerifyListener { 19 | 20 | /**软件证书参数全局验证监听容器*/ 21 | private static final List CUSTOM_VERIFY_LISTENER_LIST = new ArrayList<>(16); 22 | 23 | public static List getCustomListenerList(){ 24 | return CUSTOM_VERIFY_LISTENER_LIST; 25 | } 26 | 27 | /*** 28 | * 默认构造函数,干了一件事情,就是会把所有实现了这个抽象类的子类实例全部添加到全局自定义验证监听器列表中 29 | * 因为在调用子类的构造函数时,会首先调用父类的构造器 30 | */ 31 | public ACustomVerifyListener() { 32 | addCustomListener(this); 33 | } 34 | 35 | public synchronized static void addCustomListener(ACustomVerifyListener verifyListener){ 36 | CUSTOM_VERIFY_LISTENER_LIST.add(verifyListener); 37 | } 38 | 39 | /** 40 | * 业务系统自定义证书认证方法 41 | * @param licenseExtra 自定义验证参数 42 | * @return boolean 是否成功 43 | */ 44 | public abstract boolean verify(LicenseExtraParam licenseExtra) throws CommonException; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /license-api/doc/locales/locale.js: -------------------------------------------------------------------------------- 1 | define([ 2 | './locales/ca.js', 3 | './locales/cs.js', 4 | './locales/de.js', 5 | './locales/es.js', 6 | './locales/fr.js', 7 | './locales/it.js', 8 | './locales/nl.js', 9 | './locales/pl.js', 10 | './locales/pt_br.js', 11 | './locales/ro.js', 12 | './locales/ru.js', 13 | './locales/tr.js', 14 | './locales/vi.js', 15 | './locales/zh.js', 16 | './locales/zh_cn.js' 17 | ], function() { 18 | var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); 19 | var language = langId.substr(0, 2); 20 | var locales = {}; 21 | 22 | for (index in arguments) { 23 | for (property in arguments[index]) 24 | locales[property] = arguments[index][property]; 25 | } 26 | if ( ! locales['en']) 27 | locales['en'] = {}; 28 | 29 | if ( ! locales[langId] && ! locales[language]) 30 | language = 'en'; 31 | 32 | var locale = (locales[langId] ? locales[langId] : locales[language]); 33 | 34 | function __(text) { 35 | var index = locale[text]; 36 | if (index === undefined) 37 | return text; 38 | return index; 39 | }; 40 | 41 | function setLanguage(language) { 42 | locale = locales[language]; 43 | } 44 | 45 | return { 46 | __ : __, 47 | locales : locales, 48 | locale : locale, 49 | setLanguage: setLanguage 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-lgt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2014 Paulo Moura 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], 18 | ["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-logtalk.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2014 Paulo Moura 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], 18 | ["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); 19 | -------------------------------------------------------------------------------- /license-app/src/main/java/com/appleyk/app/excep/ExceptionControllerAdvice.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.app.excep; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | import com.appleyk.core.result.ResponseResult; 5 | import org.springframework.http.HttpStatus; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.WebDataBinder; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.Optional; 12 | 13 | /** 14 | *

全局接口异常拦截器

15 | * 16 | * @author appleyk 17 | * @version V.0.2.1 18 | * @blob https://blog.csdn.net/appleyk 19 | * @date created on 00:41 下午 2020/8/31 20 | */ 21 | @CrossOrigin 22 | @ControllerAdvice 23 | @RestControllerAdvice 24 | public class ExceptionControllerAdvice { 25 | public ExceptionControllerAdvice() { 26 | } 27 | 28 | @InitBinder 29 | public void initBinder(WebDataBinder binder) { 30 | } 31 | 32 | @ModelAttribute 33 | public void addAttributes(Model model) { 34 | } 35 | 36 | @ResponseBody 37 | @ExceptionHandler(value = Exception.class) 38 | public ResponseEntity errorHandler(Exception ex) { 39 | if (ex instanceof CommonException) { 40 | CommonException commonException = (CommonException) ex; 41 | return ResponseEntity.ok(commonException.buildResult()); 42 | } 43 | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) 44 | .body(ResponseResult.fail(ex.getMessage())); 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[\(\{\[]+/,null,"([{"],["clo",/^[\)\}\]]+/,null,")]}"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, 17 | null],["typ",/^:[0-9a-zA-Z\-]+/]]),["clj"]); 18 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Kitware Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"]|\\.)*")/,null,'"']],[["com",/^;[^\r\n]*/,null,";"],["dec",/^(?:\$(?:D|DEVICE|EC|ECODE|ES|ESTACK|ET|ETRAP|H|HOROLOG|I|IO|J|JOB|K|KEY|P|PRINCIPAL|Q|QUIT|ST|STACK|S|STORAGE|SY|SYSTEM|T|TEST|TL|TLEVEL|TR|TRESTART|X|Y|Z[A-Z]*|A|ASCII|C|CHAR|D|DATA|E|EXTRACT|F|FIND|FN|FNUMBER|G|GET|J|JUSTIFY|L|LENGTH|NA|NAME|O|ORDER|P|PIECE|QL|QLENGTH|QS|QSUBSCRIPT|Q|QUERY|R|RANDOM|RE|REVERSE|S|SELECT|ST|STACK|T|TEXT|TR|TRANSLATE|NaN))\b/i, 18 | null],["kwd",/^(?:[^\$]B|BREAK|C|CLOSE|D|DO|E|ELSE|F|FOR|G|GOTO|H|HALT|H|HANG|I|IF|J|JOB|K|KILL|L|LOCK|M|MERGE|N|NEW|O|OPEN|Q|QUIT|R|READ|S|SET|TC|TCOMMIT|TRE|TRESTART|TRO|TROLLBACK|TS|TSTART|U|USE|V|VIEW|W|WRITE|X|XECUTE)\b/i,null],["lit",/^[+-]?(?:(?:\.\d+|\d+(?:\.\d*)?)(?:E[+\-]?\d+)?)/i],["pln",/^[a-z][a-zA-Z0-9]*/i],["pun",/^[^\w\t\n\r\xA0\"\$;%\^]|_/]]),["mumps"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']+)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], 18 | ["com",/^(?:\x3c!--|--\x3e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}\b/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]); 19 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/controller/LoginTestController.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.controller; 2 | 3 | import com.appleyk.core.result.ResponseResult; 4 | import com.appleyk.verify.annotion.VLicense; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | /** 8 | *

登录测试

9 | * 10 | * @author appleyk 11 | * @version V.0.2.1 12 | * @blob https://blog.csdn.net/appleyk 13 | * @date created on 00:02 上午 2020/8/22 14 | */ 15 | @CrossOrigin 16 | @RestController 17 | @RequestMapping("/user") 18 | public class LoginTestController { 19 | 20 | @VLicense 21 | @PostMapping("/login") 22 | public ResponseResult checkLicense(@RequestBody User user){ 23 | if("admin".equals(user.getUserName()) && "admin".equals(user.getPassword())){ 24 | return ResponseResult.ok("登陆成功!"); 25 | }else{ 26 | return ResponseResult.fail("用户名或密码不对!"); 27 | } 28 | } 29 | } 30 | 31 | class User { 32 | 33 | private String userName ; 34 | private String password ; 35 | 36 | public User(){ 37 | 38 | } 39 | 40 | public User(String userName, String password) { 41 | this.userName = userName; 42 | this.password = password; 43 | } 44 | 45 | public String getUserName() { 46 | return userName; 47 | } 48 | 49 | public void setUserName(String userName) { 50 | this.userName = userName; 51 | } 52 | 53 | public String getPassword() { 54 | return password; 55 | } 56 | 57 | public void setPassword(String password) { 58 | this.password = password; 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,null,'"'],["lit",/^`(?:[^\r\n\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],["lit",/^'[a-zA-Z_$][\w$]*(?!['$\w])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 18 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],["typ",/^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],["pln",/^[$a-zA-Z_][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-aea.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-agc.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /license-creator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | license-spring-boot 8 | com.appleyk.spring.boot 9 | 0.2.1-SNAPSHOT 10 | 11 | 12 | 4.0.0 13 | license-creator 14 | license-creator-spring-boot-starter 15 | 0.2.1-SNAPSHOT 16 | jar 17 | 系统软件证书生成模块,负责拉取服务器硬件信息和生成、下载lic证书文件 18 | 19 | 20 | 21 | 22 | 23 | com.appleyk.spring.boot 24 | license-core-spring-boot-starter 25 | 0.2.1-SNAPSHOT 26 | 27 | 28 | 29 | 30 | 31 | license-creator-spring-boot-starter 32 | 33 | 34 | org.apache.maven.plugins 35 | maven-compiler-plugin 36 | 3.3 37 | 38 | 1.8 39 | 1.8 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!(?:.*)/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/(?:.*)/],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|async|await|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|sync|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 18 | ["typ",/^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],["str",/^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],["str",/^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],["str",/^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],["typ",/^[A-Z]\w*/],["pln",/^[a-z_$][a-z0-9_]*/i],["pun",/^[~!%^&*+=|?:<>/-]/],["lit",/^\b0x[0-9a-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit", 19 | /^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(){}\[\],.;]/]]),["dart"]); 20 | -------------------------------------------------------------------------------- /license-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | license-spring-boot 8 | com.appleyk.spring.boot 9 | 0.2.1-SNAPSHOT 10 | 11 | 12 | 4.0.0 13 | license-core-spring-boot-starter 14 | license-core 15 | 0.2.1-SNAPSHOT 16 | jar 17 | 系统软件证书核心业务模块,提供lic相关模型类和通用api控制器 18 | 19 | 20 | 21 | 22 | de.schlichtherle.truelicense 23 | truelicense-core 24 | 1.33 25 | 26 | 27 | 28 | 29 | license-core-spring-boot-starter 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-compiler-plugin 34 | 3.3 35 | 36 | 1.8 37 | 1.8 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-fs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 18 | ["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 18 | ["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); 19 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/result/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.result; 2 | 3 | /** 4 | *

请求响应结果码

5 | * 6 | * @author appleyk 7 | * @version V.0.2.1 8 | * @blob https://blog.csdn.net/appleyk 9 | * @date created on 10:35 下午 2020/8/21 10 | */ 11 | public enum ResultCode { 12 | 13 | OK(200,"成功"), 14 | FAIL(400,"失败"), 15 | 16 | /** 17 | * 定义内部错误码值 18 | * 字段码范围:10000 -- 10100 19 | */ 20 | FIELD_MISSING(10000,"字段缺失"), 21 | FILED_VALUE_INVALID(10001,"字段值无效/不合法"), 22 | 23 | /** 24 | * 对象 25 | * 对象码范围:10100 -- 10200 26 | */ 27 | OBJECT_NOT_EXIST(10101,"对象不存在"), // 修改删除对象时 28 | OBJECT_IS_EXIST(10102,"对象已存在"), // 创建对象时 29 | OBJECT_NAME_NOT_NULL(10103,"对象名称不能为空"),//创建对象时 30 | OBJECT_ID_NOT_NULL(10104,"对象ID不能为空"),//创建对象时 31 | OBJECT_NAME_REPEATED(10104,"对象名称重复"),//创建对象时 32 | 33 | /** 34 | * 授权/令牌请求接口返回码 35 | * 授权码范围:10200 -- 10300 36 | */ 37 | INVALID_REQUEST(10200,"非法的请求"), 38 | INVALID_CLIENT(10201,"用户认证失败"), 39 | INVALID_GRANT(10202,"非法的授权信息"), 40 | EXPIRED_TOKEN(10203,"令牌过期"), 41 | ACCESS_DENIED(10204,"用户或授权服务器拒绝授予数据访问权限"), 42 | INVALID_USER_ID(10205,"无效的用户ID"), 43 | 44 | /** 45 | * 数据存储 46 | * 授权码范围:10300 -- 10400 47 | */ 48 | DATA_CREATE_ERROR(10300,"数据创建失败"), 49 | DATA_DELETE_ERROR(10301,"数据删除失败"), 50 | DATA_UPDATE_ERROR(10302,"数据更新失败"); 51 | 52 | 53 | /** 结果状态码*/ 54 | private final Integer code; 55 | 56 | /**结果状态码表示的内容*/ 57 | private final String name; 58 | 59 | ResultCode(final Integer code , final String name){ 60 | this.code = code; 61 | this.name = name; 62 | } 63 | 64 | public Integer getCode() { 65 | return code; 66 | } 67 | 68 | public String getName() { 69 | return name; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /license-verify/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | license-spring-boot 7 | com.appleyk.spring.boot 8 | 0.2.1-SNAPSHOT 9 | 10 | 11 | 4.0.0 12 | license-verify 13 | license-verify-spring-boot-starter 14 | 0.2.1-SNAPSHOT 15 | jar 16 | 系统软件证书验证模块,负责用户自定义验证规则的实现,可扩展 17 | 18 | 19 | 20 | 21 | 22 | com.appleyk.spring.boot 23 | license-core-spring-boot-starter 24 | 0.2.1-SNAPSHOT 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-thymeleaf 30 | 31 | 32 | 33 | 34 | 35 | license-verify-spring-boot-starter 36 | 37 | 38 | org.apache.maven.plugins 39 | maven-compiler-plugin 40 | 3.3 41 | 42 | 1.8 43 | 1.8 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/ex/CommonException.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.ex; 2 | 3 | 4 | import com.appleyk.core.result.ResponseResult; 5 | import com.appleyk.core.result.ResultCode; 6 | import org.springframework.http.HttpStatus; 7 | 8 | /** 9 | *

自定义通用异常类

10 | * 11 | * @author appleyk 12 | * @version V.0.2.1 13 | * @blob https://blog.csdn.net/appleyk 14 | * @date created on 上午 10:59 2019-4-27 15 | */ 16 | public class CommonException extends Exception{ 17 | 18 | /** 结果状态码*/ 19 | private ResultCode resultCode; 20 | 21 | /** 结果消息*/ 22 | private String message; 23 | 24 | public CommonException(String message){ 25 | super(message); 26 | this.resultCode = ResultCode.FAIL; 27 | this.message = message; 28 | } 29 | 30 | public CommonException(ResultCode resultCode, String message){ 31 | super(message); 32 | this.resultCode = resultCode; 33 | this.message = message; 34 | } 35 | 36 | public class ResultError{ 37 | 38 | /** 错误码*/ 39 | private Integer code; 40 | 41 | /** 错误名称*/ 42 | private String name; 43 | 44 | public ResultError(Integer code , String name){ 45 | this.code = code; 46 | this.name = name; 47 | } 48 | 49 | public Integer getCode() { 50 | return code; 51 | } 52 | 53 | public void setCode(Integer code) { 54 | this.code = code; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public void setName(String name) { 62 | this.name = name; 63 | } 64 | } 65 | 66 | public ResponseResult buildResult(){ 67 | Integer code = this.resultCode.getCode(); 68 | String name = this.resultCode.getName(); 69 | return new ResponseResult(HttpStatus.BAD_REQUEST.value(),this.message , new ResultError(code, name)); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/helper/ServerSerialHelper.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.helper; 2 | 3 | import com.appleyk.core.utils.CommonUtils; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.InputStreamReader; 7 | import java.util.Scanner; 8 | 9 | /** 10 | *

获取服务器硬件序列号辅助类

11 | * 12 | * @author appleyk 13 | * @version V.0.2.1 14 | * @blob https://blog.csdn.net/appleyk 15 | * @date created on 10:42 下午 2020/8/21 16 | */ 17 | public class ServerSerialHelper { 18 | 19 | /** 20 | * 执行Linux的shell获取Linux信息 21 | * @param shell 命令 22 | * @return String Server信息 23 | * @throws Exception 默认异常 24 | */ 25 | public static String getLinuxSerial(String[] shell) throws Exception { 26 | String serial = ""; 27 | /** 使用dmidecode命令获取列号 */ 28 | Process process = Runtime.getRuntime().exec(shell); 29 | process.getOutputStream().close(); 30 | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); 31 | String line = reader.readLine().trim(); 32 | if(CommonUtils.isNotEmpty(line)){ 33 | serial = line; 34 | } 35 | reader.close(); 36 | return serial; 37 | } 38 | 39 | /** 40 | * 执行windows的command获取Windows信息 41 | * @param command 命令 42 | * @return String Server信息 43 | * @throws Exception 默认异常 44 | */ 45 | public static String getWindowsSerial(String command) throws Exception { 46 | String serial = ""; 47 | /** 使用WMIC获取序列号 */ 48 | Process process = Runtime.getRuntime().exec(command); 49 | process.getOutputStream().close(); 50 | Scanner scanner = new Scanner(process.getInputStream()); 51 | if(scanner.hasNext()){ 52 | scanner.next(); 53 | } 54 | if(scanner.hasNext()){ 55 | serial = scanner.next().trim(); 56 | } 57 | scanner.close(); 58 | return serial; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-swift.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 Google Inc. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | */ 15 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \n\r\t\v\f\0]+/,null," \n\r\t\v\f\x00"],["str",/^"(?:[^"\\]|(?:\\.)|(?:\\\((?:[^"\\)]|\\.)*\)))*"/,null,'"']],[["lit",/^(?:(?:0x[\da-fA-F][\da-fA-F_]*\.[\da-fA-F][\da-fA-F_]*[pP]?)|(?:\d[\d_]*\.\d[\d_]*[eE]?))[+-]?\d[\d_]*/,null],["lit",/^-?(?:(?:0(?:(?:b[01][01_]*)|(?:o[0-7][0-7_]*)|(?:x[\da-fA-F][\da-fA-F_]*)))|(?:\d[\d_]*))/,null],["lit",/^(?:true|false|nil)\b/,null],["kwd",/^\b(?:__COLUMN__|__FILE__|__FUNCTION__|__LINE__|#available|#else|#elseif|#endif|#if|#line|arch|arm|arm64|associativity|as|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|dynamicType|else|enum|fallthrough|final|for|func|get|import|indirect|infix|init|inout|internal|i386|if|in|iOS|iOSApplicationExtension|is|lazy|left|let|mutating|none|nonmutating|operator|optional|OSX|OSXApplicationExtension|override|postfix|precedence|prefix|private|protocol|Protocol|public|required|rethrows|return|right|safe|self|set|static|struct|subscript|super|switch|throw|try|Type|typealias|unowned|unsafe|var|weak|watchOS|while|willSet|x86_64)\b/, 16 | null],["com",/^\/\/.*?[\n\r]/,null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["pun",/^<<=|<=|<<|>>=|>=|>>|===|==|\.\.\.|&&=|\.\.<|!==|!=|&=|~=|~|\(|\)|\[|\]|{|}|@|#|;|\.|,|:|\|\|=|\?\?|\|\||&&|&\*|&\+|&-|&=|\+=|-=|\/=|\*=|\^=|%=|\|=|->|`|==|\+\+|--|\/|\+|!|\*|%|<|>|&|\||\^|\?|=|-|_/,null],["typ",/^\b(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null]]),["swift"]); 17 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-vhd.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 benoit@ryder.fr 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 18 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], 19 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 benoit@ryder.fr 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 18 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], 19 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Zimin A.V. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/, 18 | null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 19 | null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-nemerle.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Zimin A.V. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/, 18 | null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 19 | null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | /* Vim sunburst theme by David Leibovic */ 3 | 4 | pre .str, code .str { color: #65B042; } /* string - green */ 5 | pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ 6 | pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ 7 | pre .typ, code .typ { color: #89bdff; } /* type - light blue */ 8 | pre .lit, code .lit { color: #3387CC; } /* literal - blue */ 9 | pre .pun, code .pun { color: #fff; } /* punctuation - white */ 10 | pre .pln, code .pln { color: #fff; } /* plaintext - white */ 11 | pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ 12 | pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ 13 | pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ 14 | pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ 15 | 16 | pre.prettyprint, code.prettyprint { 17 | background-color: #000; 18 | -moz-border-radius: 8px; 19 | -webkit-border-radius: 8px; 20 | -o-border-radius: 8px; 21 | -ms-border-radius: 8px; 22 | -khtml-border-radius: 8px; 23 | border-radius: 8px; 24 | } 25 | 26 | pre.prettyprint { 27 | width: 95%; 28 | margin: 1em auto; 29 | padding: 1em; 30 | white-space: pre-wrap; 31 | } 32 | 33 | 34 | /* Specify class=linenums on a pre to get line numbering */ 35 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ 36 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } 37 | /* Alternate shading for lines */ 38 | li.L1,li.L3,li.L5,li.L7,li.L9 { } 39 | 40 | @media print { 41 | pre .str, code .str { color: #060; } 42 | pre .kwd, code .kwd { color: #006; font-weight: bold; } 43 | pre .com, code .com { color: #600; font-style: italic; } 44 | pre .typ, code .typ { color: #404; font-weight: bold; } 45 | pre .lit, code .lit { color: #044; } 46 | pre .pun, code .pun { color: #440; } 47 | pre .pln, code .pln { color: #000; } 48 | pre .tag, code .tag { color: #006; font-weight: bold; } 49 | pre .atn, code .atn { color: #404; } 50 | pre .atv, code .atv { color: #060; } 51 | } 52 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/model/LicenseResult.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.model; 2 | 3 | import de.schlichtherle.license.LicenseContent; 4 | 5 | /** 6 | *

License证书验证结果对象

7 | * 8 | * @author appleyk 9 | * @version V.0.2.1 10 | * @blob https://blog.csdn.net/appleyk 11 | * @date created on 10:42 下午 2020/8/21 12 | */ 13 | public class LicenseResult { 14 | 15 | /** 检验结果 */ 16 | private Boolean result; 17 | /** 附加信息 */ 18 | private String message; 19 | /** 证书内容 */ 20 | private LicenseContent content; 21 | /** 检验失败错误 */ 22 | private Exception exception; 23 | 24 | public LicenseResult(LicenseContent content) { 25 | this.result = true; 26 | this.content = content; 27 | } 28 | 29 | public LicenseResult(String message, LicenseContent content) { 30 | this.result = true; 31 | this.message = message; 32 | this.content = content; 33 | } 34 | 35 | public LicenseResult(Exception exception) { 36 | this.result = false; 37 | this.exception = exception; 38 | } 39 | 40 | public LicenseResult(String message, Exception exception) { 41 | this.result = false; 42 | this.message = message; 43 | this.exception = exception; 44 | } 45 | 46 | public LicenseResult(boolean result , String message, Exception exception) { 47 | this.result = result; 48 | this.message = message; 49 | this.exception = exception; 50 | } 51 | 52 | public Boolean getResult() { 53 | return result; 54 | } 55 | 56 | public void setResult(Boolean result) { 57 | this.result = result; 58 | } 59 | 60 | public String getMessage() { 61 | return message; 62 | } 63 | 64 | public void setMessage(String message) { 65 | this.message = message; 66 | } 67 | 68 | public LicenseContent getContent() { 69 | return content; 70 | } 71 | 72 | public void setContent(LicenseContent content) { 73 | this.content = content; 74 | } 75 | 76 | public Exception getException() { 77 | return exception; 78 | } 79 | 80 | public void setException(Exception exception) { 81 | this.exception = exception; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /license-app/src/main/java/com/appleyk/app/listener/CustomVerifyListenerA.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.app.listener; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | import com.appleyk.core.model.LicenseExtraParam; 5 | import com.appleyk.core.result.ResultCode; 6 | import com.appleyk.verify.listener.ACustomVerifyListener; 7 | import com.sun.media.sound.SoftTuning; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | *

Lic自定义验证监听器A

12 | * 13 | * @author appleyk 14 | * @version V.0.2.1 15 | * @blob https://blog.csdn.net/appleyk 16 | * @date created on 10:24 下午 2020/8/21 17 | */ 18 | @Component 19 | public class CustomVerifyListenerA extends ACustomVerifyListener { 20 | 21 | /**单例Bean,这个静态变量会缓存证书中最大用户注册数的*/ 22 | private static Long registerAmount = 0L; 23 | 24 | @Override 25 | public boolean verify(LicenseExtraParam licenseExtra) throws CommonException { 26 | registerAmount = licenseExtra.getRegisterAmount(); 27 | System.out.println("======= 自定义证书验证监听器A 实现verify方法 ======="); 28 | System.out.println("证书最大验证人数是:"+registerAmount); 29 | /** 30 | * 这里,可以做一些和业务系统有关的参数验证 31 | * 比如在XX接口(Controller)上加@VLicense注解时,会触发这个方法的调用 32 | * 在这个业务系统这个监听方法中,我们可以先去user表查询下,当前系统的注册用户数量 33 | * 然后拿着这个数量和lic参数中约束的最大注册用户量进行比较,如果>,则抛出异常 34 | * 这样做的目的是防止业务系统部署到客户端本地服务器上时,数据库是公开的,防止对方通过手动改表来添加用户 35 | */ 36 | long count = 1001; 37 | if(count>=registerAmount){ 38 | throw new CommonException(ResultCode.FAIL,"系统当前用户数超过最大用户注册限制数【"+registerAmount+"】"); 39 | } 40 | 41 | System.out.println("系统注册最大用户数量未超过"+count+",验证用过!"); 42 | return true; 43 | } 44 | 45 | /** 46 | * 这个单独的重载的验证方法,主要是用于业务系统中进行调用,带参数的verify方法用于注解 47 | * 而这个不带参数的verify,更加灵活些,比如在系统中注册接口(Controller)上,除了自身@VLicense注解外, 48 | * 可以在调用这个方法,来额外的验证注册人数是否已满 49 | * @return 50 | * @throws CommonException 51 | */ 52 | public boolean verify() throws CommonException{ 53 | Long count = 100L; 54 | if(count.equals(registerAmount)){ 55 | throw new CommonException(ResultCode.FAIL, 56 | "系统当前用户数已达到最大用户注册限制数【"+registerAmount+"】,无法再注册新用户。如需扩充用户注册的数量,请联系我们重新购买License!"); 57 | } 58 | return true; 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-rust.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 Chris Morgan 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([],[["pln",/^[\t\n\r \xA0]+/],["com",/^\/\/.*/],["com",/^\/\*[\s\S]*?(?:\*\/|$)/],["str",/^b"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}))*?"/],["str",/^"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}|u\{\[\da-fA-F]{1,6}\}))*?"/],["str",/^b?r(#*)\"[\s\S]*?\"\1/],["str",/^b'([^\\]|\\(.|x[\da-fA-F]{2}))'/],["str",/^'([^\\]|\\(.|x[\da-fA-F]{2}|u\{[\da-fA-F]{1,6}\}))'/],["tag",/^'\w+?\b/],["kwd",/^(?:match|if|else|as|break|box|continue|extern|fn|for|in|if|impl|let|loop|pub|return|super|unsafe|where|while|use|mod|trait|struct|enum|type|move|mut|ref|static|const|crate)\b/], 18 | ["kwd",/^(?:alignof|become|do|offsetof|priv|pure|sizeof|typeof|unsized|yield|abstract|virtual|final|override|macro)\b/],["typ",/^(?:[iu](8|16|32|64|size)|char|bool|f32|f64|str|Self)\b/],["typ",/^(?:Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\b/],["lit",/^(self|true|false|null)\b/], 19 | ["lit",/^\d[0-9_]*(?:[iu](?:size|8|16|32|64))?/],["lit",/^0x[a-fA-F0-9_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0o[0-7_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0b[01_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^\d[0-9_]*\.(?![^\s\d.])/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)(?:[eE][+-]?[0-9_]+)?(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)?(?:f32|f64)/], 20 | ["atn",/^[a-z_]\w*!/i],["pln",/^[a-z_]\w*/i],["atv",/^#!?\[[\s\S]*?\]/],["pun",/^[+\-/*=^&|!<>%[\](){}?:.,;]/],["pln",/./]]),["rust"]); 21 | -------------------------------------------------------------------------------- /license-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | license-spring-boot 8 | com.appleyk.spring.boot 9 | 0.2.1-SNAPSHOT 10 | 11 | 12 | 13 | 4.0.0 14 | license-app-spring-boot-starter 15 | license-app 16 | 0.2.1-SNAPSHOT 17 | war 18 | 系统软件证书应用模块,可打包成war包,运行与web容器中,对外提供lic相关服务 19 | 20 | 21 | 1.8 22 | UTF-8 23 | UTF-8 24 | 2.9.6 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | com.appleyk.spring.boot 39 | license-verify-spring-boot-starter 40 | 0.2.1-SNAPSHOT 41 | 42 | 43 | 44 | 45 | 46 | license-app-spring-boot-starter 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-compiler-plugin 51 | 3.3 52 | 53 | 1.8 54 | 1.8 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/config/LicenseVerifyProperties.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.config; 2 | 3 | import com.appleyk.core.model.LicenseVerifyParam; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

License验证属性类

9 | * 10 | * @author appleyk 11 | * @version V.0.2.1 12 | * @blob https://blog.csdn.net/appleyk 13 | * @date created on 00:02 上午 2020/8/22 14 | */ 15 | @Component 16 | @ConfigurationProperties(prefix = "springboot.license.verify") 17 | public class LicenseVerifyProperties { 18 | 19 | private String subject; 20 | private String publicAlias; 21 | private String publicKeysStorePath = ""; 22 | private String storePass = ""; 23 | private String licensePath; 24 | 25 | public LicenseVerifyProperties() { 26 | } 27 | 28 | public String getSubject() { 29 | return subject; 30 | } 31 | 32 | public void setSubject(String subject) { 33 | this.subject = subject; 34 | } 35 | 36 | public String getPublicAlias() { 37 | return publicAlias; 38 | } 39 | 40 | public void setPublicAlias(String publicAlias) { 41 | this.publicAlias = publicAlias; 42 | } 43 | 44 | public String getPublicKeysStorePath() { 45 | return publicKeysStorePath; 46 | } 47 | 48 | public void setPublicKeysStorePath(String publicKeysStorePath) { 49 | this.publicKeysStorePath = publicKeysStorePath; 50 | } 51 | 52 | public String getStorePass() { 53 | return storePass; 54 | } 55 | 56 | public void setStorePass(String storePass) { 57 | this.storePass = storePass; 58 | } 59 | 60 | public String getLicensePath() { 61 | return licensePath; 62 | } 63 | 64 | public void setLicensePath(String licensePath) { 65 | this.licensePath = licensePath; 66 | } 67 | 68 | public LicenseVerifyParam getVerifyParam() { 69 | LicenseVerifyParam param = new LicenseVerifyParam(); 70 | param.setSubject(subject); 71 | param.setPublicAlias(publicAlias); 72 | param.setStorePass(storePass); 73 | param.setLicensePath(licensePath); 74 | param.setPublicKeysStorePath(publicKeysStorePath); 75 | return param; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONNECT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOLLOWING|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|MATCH|MATCHED|MERGE|NATURAL|NATIONAL|NOCHECK|NONCLUSTERED|NOCYCLE|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PARTITION|PERCENT|PIVOT|PLAN|PRECEDING|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|ROWS?|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|START|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNBOUNDED|UNION|UNIQUE|UNPIVOT|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WITHIN|WRITETEXT|XML)(?=[^\w-]|$)/i, 18 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),["sql"]); 19 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, 18 | null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb", 19 | "vbs"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-vbs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, 18 | null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb", 19 | "vbs"]); 20 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/model/LicenseVerifyParam.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.model; 2 | 3 | /** 4 | *

License校验类需要的参数

5 | * 6 | * @author appleyk 7 | * @version V.0.2.1 8 | * @blob https://blog.csdn.net/appleyk 9 | * @date created on 10:42 下午 2020/8/21 10 | */ 11 | public class LicenseVerifyParam { 12 | 13 | /**证书主题*/ 14 | private String subject; 15 | 16 | /**公钥别名*/ 17 | private String publicAlias; 18 | 19 | /** 访问公钥库的密码*/ 20 | private String storePass; 21 | 22 | /**证书生成路径*/ 23 | private String licensePath; 24 | 25 | /**公钥库存储路径*/ 26 | private String publicKeysStorePath; 27 | 28 | public LicenseVerifyParam() { 29 | 30 | } 31 | 32 | public LicenseVerifyParam(String subject, String publicAlias, String storePass, String licensePath, String publicKeysStorePath) { 33 | this.subject = subject; 34 | this.publicAlias = publicAlias; 35 | this.storePass = storePass; 36 | this.licensePath = licensePath; 37 | this.publicKeysStorePath = publicKeysStorePath; 38 | } 39 | 40 | public String getSubject() { 41 | return subject; 42 | } 43 | 44 | public void setSubject(String subject) { 45 | this.subject = subject; 46 | } 47 | 48 | public String getPublicAlias() { 49 | return publicAlias; 50 | } 51 | 52 | public void setPublicAlias(String publicAlias) { 53 | this.publicAlias = publicAlias; 54 | } 55 | 56 | public String getStorePass() { 57 | return storePass; 58 | } 59 | 60 | public void setStorePass(String storePass) { 61 | this.storePass = storePass; 62 | } 63 | 64 | public String getLicensePath() { 65 | return licensePath; 66 | } 67 | 68 | public void setLicensePath(String licensePath) { 69 | this.licensePath = licensePath; 70 | } 71 | 72 | public String getPublicKeysStorePath() { 73 | return publicKeysStorePath; 74 | } 75 | 76 | public void setPublicKeysStorePath(String publicKeysStorePath) { 77 | this.publicKeysStorePath = publicKeysStorePath; 78 | } 79 | 80 | @Override 81 | public String toString() { 82 | return "LicenseVerifyParam{" + 83 | "subject='" + subject + '\'' + 84 | ", publicAlias='" + publicAlias + '\'' + 85 | ", storePass='" + storePass + '\'' + 86 | ", licensePath='" + licensePath + '\'' + 87 | ", publicKeysStorePath='" + publicKeysStorePath + '\'' + 88 | '}'; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prism.css: -------------------------------------------------------------------------------- 1 | /* PrismJS 1.21.0 2 | https://prismjs.com/download.html#themes=prism-tomorrow&languages=clike+javascript+bash+c+csharp+cpp+clojure+elixir+erlang+go+http+json+json5+jsonp+lua+perl+python+rust */ 3 | /** 4 | * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML 5 | * Based on https://github.com/chriskempson/tomorrow-theme 6 | * @author Rose Pritchard 7 | */ 8 | 9 | code[class*="language-"], 10 | pre[class*="language-"] { 11 | color: #ccc; 12 | background: none; 13 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 14 | font-size: 1em; 15 | text-align: left; 16 | white-space: pre; 17 | word-spacing: normal; 18 | word-break: normal; 19 | word-wrap: normal; 20 | line-height: 1.5; 21 | 22 | -moz-tab-size: 4; 23 | -o-tab-size: 4; 24 | tab-size: 4; 25 | 26 | -webkit-hyphens: none; 27 | -moz-hyphens: none; 28 | -ms-hyphens: none; 29 | hyphens: none; 30 | 31 | } 32 | 33 | /* Code blocks */ 34 | pre[class*="language-"] { 35 | padding: 1em; 36 | margin: .5em 0; 37 | overflow: auto; 38 | } 39 | 40 | :not(pre) > code[class*="language-"], 41 | pre[class*="language-"] { 42 | background: #2d2d2d; 43 | } 44 | 45 | /* Inline code */ 46 | :not(pre) > code[class*="language-"] { 47 | padding: .1em; 48 | border-radius: .3em; 49 | white-space: normal; 50 | } 51 | 52 | .token.comment, 53 | .token.block-comment, 54 | .token.prolog, 55 | .token.doctype, 56 | .token.cdata { 57 | color: #999; 58 | } 59 | 60 | .token.punctuation { 61 | color: #ccc; 62 | } 63 | 64 | .token.tag, 65 | .token.attr-name, 66 | .token.namespace, 67 | .token.deleted { 68 | color: #e2777a; 69 | } 70 | 71 | .token.function-name { 72 | color: #6196cc; 73 | } 74 | 75 | .token.boolean, 76 | .token.number, 77 | .token.function { 78 | color: #f08d49; 79 | } 80 | 81 | .token.property, 82 | .token.class-name, 83 | .token.constant, 84 | .token.symbol { 85 | color: #f8c555; 86 | } 87 | 88 | .token.selector, 89 | .token.important, 90 | .token.atrule, 91 | .token.keyword, 92 | .token.builtin { 93 | color: #cc99cd; 94 | } 95 | 96 | .token.string, 97 | .token.char, 98 | .token.attr-value, 99 | .token.regex, 100 | .token.variable { 101 | color: #7ec699; 102 | } 103 | 104 | .token.operator, 105 | .token.entity, 106 | .token.url { 107 | color: #67cdcc; 108 | } 109 | 110 | .token.important, 111 | .token.bold { 112 | font-weight: bold; 113 | } 114 | .token.italic { 115 | font-style: italic; 116 | } 117 | 118 | .token.entity { 119 | cursor: help; 120 | } 121 | 122 | .token.inserted { 123 | color: green; 124 | } 125 | 126 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-ls.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Eric Knibbe 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], 18 | ["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], 19 | ["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-lasso.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Eric Knibbe 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], 18 | ["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], 19 | ["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); 20 | -------------------------------------------------------------------------------- /license-api/doc/vendor/prettify/lang-lassoscript.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Eric Knibbe 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], 18 | ["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], 19 | ["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); 20 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/service/LinuxServerInfos.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.service; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStreamReader; 8 | 9 | /** 10 | *

用于获取客户Linux服务器的基本信息

11 | * 12 | * @author appleyk 13 | * @version V.0.2.1 14 | * @blob https://blog.csdn.net/appleyk 15 | * @date created on 10:42 下午 2020/8/21 16 | */ 17 | public class LinuxServerInfos extends AServerInfos { 18 | 19 | private final String[] CPU_SHELL = {"/bin/bash","-c","dmidecode -t processor | grep 'ID' | awk -F ':' '{print $2}' | head -n 1"}; 20 | private final String[] MAIN_BOARD_SHELL = {"/bin/bash","-c","dmidecode | grep 'Serial Number' | awk -F ':' '{print $2}' | head -n 1"}; 21 | 22 | @Override 23 | protected String getCPUSerial() throws Exception { 24 | String result = ""; 25 | String CPU_ID_CMD = "dmidecode"; 26 | BufferedReader bufferedReader = null; 27 | Process p = null; 28 | try { 29 | p = Runtime.getRuntime().exec(new String[] { "sh", "-c", CPU_ID_CMD });// 管道 30 | bufferedReader = new BufferedReader(new InputStreamReader(p.getInputStream())); 31 | String line = null; 32 | int index = -1; 33 | while ((line = bufferedReader.readLine()) != null) { 34 | // 寻找标示字符串[hwaddr] 35 | index = line.toLowerCase().indexOf("uuid"); 36 | if (index >= 0) {// 找到了 37 | // 取出mac地址并去除2边空格 38 | result = line.substring(index + "uuid".length() + 1).trim(); 39 | break; 40 | } 41 | } 42 | } catch (IOException e) { 43 | LoggerHelper.error("获取cpu信息错误", e); 44 | } 45 | return result.trim(); 46 | // return GxServerSerialHelper.getLinuxSerial(CPU_SHELL); 47 | } 48 | 49 | @Override 50 | protected String getMainBoardSerial() throws Exception { 51 | String result = ""; 52 | String maniBord_cmd = "dmidecode | grep 'Serial Number' | awk '{print $3}' | tail -1"; 53 | Process p; 54 | try { 55 | p = Runtime.getRuntime().exec(new String[] { "sh", "-c", maniBord_cmd });// 管道 56 | BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); 57 | String line; 58 | while ((line = br.readLine()) != null) { 59 | result += line; 60 | break; 61 | } 62 | br.close(); 63 | } catch (IOException e) { 64 | LoggerHelper.error("获取主板信息错误", e); 65 | } 66 | return result; 67 | // return GxServerSerialHelper.getLinuxSerial(MAIN_BOARD_SHELL); 68 | } 69 | 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/utils/JsonUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.utils; 2 | 3 | import com.fasterxml.jackson.core.JsonParser; 4 | import com.fasterxml.jackson.core.JsonProcessingException; 5 | import com.fasterxml.jackson.core.type.TypeReference; 6 | import com.fasterxml.jackson.databind.DeserializationFeature; 7 | import com.fasterxml.jackson.databind.JavaType; 8 | import com.fasterxml.jackson.databind.ObjectMapper; 9 | 10 | import java.io.IOException; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | *

Json正反序列化工具类

16 | * 17 | * @author appleyk 18 | * @version V.0.2.1 19 | * @blob https://blog.csdn.net/appleyk 20 | * @date created on 11:04 下午 2020/8/21 21 | */ 22 | public class JsonUtils { 23 | 24 | public static final ObjectMapper MAPPER = new ObjectMapper(); 25 | 26 | static { 27 | MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); 28 | MAPPER.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true); 29 | MAPPER.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); 30 | MAPPER.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); 31 | MAPPER.configure(JsonParser.Feature.ALLOW_COMMENTS, true); 32 | } 33 | 34 | public JsonUtils() { 35 | } 36 | 37 | public static String objectToJson(Object data) { 38 | try { 39 | return MAPPER.writeValueAsString(data); 40 | } catch (JsonProcessingException var2) { 41 | var2.printStackTrace(); 42 | return null; 43 | } 44 | } 45 | 46 | public static String objectToJsonWithType(Object data, TypeReference typeReference) { 47 | try { 48 | return MAPPER.writerFor(typeReference).writeValueAsString(data); 49 | } catch (JsonProcessingException var3) { 50 | var3.printStackTrace(); 51 | return null; 52 | } 53 | } 54 | 55 | public static T jsonToPojo(String jsonData, Class beanType) { 56 | try { 57 | return MAPPER.readValue(jsonData, beanType); 58 | } catch (Exception var3) { 59 | var3.printStackTrace(); 60 | return null; 61 | } 62 | } 63 | 64 | public static List jsonToList(String jsonData, Class beanType) { 65 | JavaType javaType = MAPPER.getTypeFactory().constructParametricType(List.class, new Class[]{beanType}); 66 | 67 | try { 68 | return (List) MAPPER.readValue(jsonData, javaType); 69 | } catch (Exception var4) { 70 | var4.printStackTrace(); 71 | return null; 72 | } 73 | } 74 | 75 | public static Map parseMap(String jsonStr) throws IOException { 76 | return (Map) MAPPER.readValue(jsonStr, Map.class); 77 | } 78 | 79 | public static List parseList(String jsonStr) throws IOException { 80 | return (List) MAPPER.readValue(jsonStr, new TypeReference>() { 81 | }); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/model/LicenseCreatorManager.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.model; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | import com.appleyk.core.helper.LoggerHelper; 5 | import com.appleyk.core.helper.ParamInitHelper; 6 | import com.appleyk.core.result.ResultCode; 7 | import de.schlichtherle.license.LicenseContent; 8 | import de.schlichtherle.license.LicenseManager; 9 | import de.schlichtherle.license.LicenseParam; 10 | 11 | import java.io.File; 12 | import java.io.FileInputStream; 13 | import java.io.InputStream; 14 | import java.text.MessageFormat; 15 | 16 | /** 17 | *

系统软件证书生成管理器

18 | * 19 | * @author appleyk 20 | * @version V.0.2.1 21 | * @blob https://blog.csdn.net/appleyk 22 | * @date created on 10:42 下午 2020/8/21 23 | */ 24 | public class LicenseCreatorManager { 25 | 26 | private LicenseCreatorParam param; 27 | 28 | public LicenseCreatorManager(LicenseCreatorParam param) { 29 | this.param = param; 30 | } 31 | 32 | /** 33 | *

生成License证书

34 | * @return GxLicenseResult 证书生成结果 35 | */ 36 | public LicenseResult generateLicense(){ 37 | try { 38 | // 1、根据外部传入的创建Lic的参数信息初始化lic参数(秘钥部分) 39 | LicenseParam licenseParam = ParamInitHelper.initLicenseParam(param); 40 | // 2、根据外部传入的创建Lic的属性信息初始化lic内容(除了truelicense自带的还包括自己定义的) 41 | LicenseContent licenseContent = ParamInitHelper.initLicenseContent(param); 42 | // 3、构建Lic管理器 43 | LicenseManager licenseManager = new LicenseCustomManager(licenseParam); 44 | // 4、根据param传入的lic生成的路径创建空文件 45 | File licenseFile = new File(this.param.getLicensePath()); 46 | // 5、通过Lic管理器,将内容写入Lic文件中 47 | licenseManager.store(licenseContent, licenseFile); 48 | return new LicenseResult("证书生成成功!",licenseContent); 49 | }catch (Exception e){ 50 | LoggerHelper.error(e.getMessage()); 51 | String message = MessageFormat.format("证书生成失败!:{0}", param); 52 | LoggerHelper.error(message,e); 53 | return new LicenseResult(message,e); 54 | } 55 | } 56 | 57 | /** 58 | *

下载License证书

59 | * @return InputStream 证书文件输入流 60 | * @throws Exception 证书下载失败 61 | */ 62 | public InputStream download() throws Exception { 63 | try { 64 | LicenseParam licenseParam = ParamInitHelper.initLicenseParam(param); 65 | LicenseContent licenseContent = ParamInitHelper.initLicenseContent(param); 66 | LicenseManager licenseManager = new LicenseCustomManager(licenseParam); 67 | File licenseFile = new File(param.getLicensePath()); 68 | licenseManager.store(licenseContent,licenseFile); 69 | return new FileInputStream(licenseFile); 70 | }catch (Exception e){ 71 | e.printStackTrace(); 72 | LoggerHelper.error(e.getMessage()); 73 | LoggerHelper.error(MessageFormat.format("证书下载失败:{0}",param),e); 74 | throw new CommonException(ResultCode.FAIL,e.getMessage()); 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/interceptor/LicenseVerifyInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.interceptor; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | import com.appleyk.core.model.LicenseExtraParam; 5 | import com.appleyk.core.model.LicenseResult; 6 | import com.appleyk.core.model.LicenseVerifyManager; 7 | import com.appleyk.core.result.ResultCode; 8 | import com.appleyk.core.utils.CommonUtils; 9 | import com.appleyk.verify.annotion.VLicense; 10 | import com.appleyk.verify.config.LicenseVerifyProperties; 11 | import com.appleyk.verify.listener.ACustomVerifyListener; 12 | import de.schlichtherle.license.LicenseContent; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.web.method.HandlerMethod; 15 | import org.springframework.web.servlet.HandlerInterceptor; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.servlet.http.HttpServletResponse; 19 | import java.lang.reflect.Method; 20 | import java.util.List; 21 | 22 | /** 23 | *

License验证拦截器

24 | * 25 | * @author appleyk 26 | * @version V.0.2.1 27 | * @blob https://blog.csdn.net/appleyk 28 | * @date created on 00:32 上午 2020/8/22 29 | */ 30 | public class LicenseVerifyInterceptor implements HandlerInterceptor { 31 | 32 | @Autowired 33 | private LicenseVerifyProperties properties; 34 | 35 | public LicenseVerifyInterceptor() { 36 | } 37 | 38 | @Override 39 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 40 | if (handler instanceof HandlerMethod) { 41 | HandlerMethod handlerMethod = (HandlerMethod) handler; 42 | Method method = handlerMethod.getMethod(); 43 | VLicense annotation = method.getAnnotation(VLicense.class); 44 | if (CommonUtils.isNotEmpty(annotation)) { 45 | LicenseVerifyManager licenseVerifyManager = new LicenseVerifyManager(); 46 | /** 1、校验证书是否有效 */ 47 | LicenseResult verifyResult = licenseVerifyManager.verify(properties.getVerifyParam()); 48 | if(!verifyResult.getResult()){ 49 | throw new CommonException(verifyResult.getMessage()); 50 | } 51 | LicenseContent content = verifyResult.getContent(); 52 | LicenseExtraParam licenseCheck = (LicenseExtraParam) content.getExtra(); 53 | if (verifyResult.getResult()) { 54 | /** 增加业务系统监听,是否自定义验证 */ 55 | List customListenerList = ACustomVerifyListener.getCustomListenerList(); 56 | boolean compare = true; 57 | for (ACustomVerifyListener listener : customListenerList) { 58 | boolean verify = listener.verify(licenseCheck); 59 | compare = compare && verify; 60 | } 61 | return compare; 62 | } 63 | throw new CommonException(ResultCode.FAIL,verifyResult.getException().getMessage()); 64 | } 65 | } 66 | return true; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/result/ResponseResult.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.result; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 6 | import org.springframework.http.HttpStatus; 7 | 8 | import java.util.Date; 9 | 10 | /** 11 | *

请求结果(封装)

12 | * 13 | * @author appleyk 14 | * @version V.0.2.1 15 | * @blob https://blog.csdn.net/appleyk 16 | * @date created on 10:32 下午 2020/8/21 17 | */ 18 | public class ResponseResult { 19 | 20 | /** 响应结果状态码*/ 21 | private Integer status; 22 | 23 | /** 响应结果消息*/ 24 | private String message; 25 | 26 | /** 响应结果对应的(包含)的数据,空的话不反序列话*/ 27 | @JsonInclude(value = Include.NON_NULL) 28 | private Object data; 29 | 30 | /** 响应时间*/ 31 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 32 | private Date timeStamp = new Date(); 33 | 34 | public ResponseResult() { 35 | this.status = null; 36 | this.message = null; 37 | this.data = null; 38 | } 39 | 40 | public ResponseResult(Integer status, String message) { 41 | this.status = status; 42 | this.message = message; 43 | this.data = null; 44 | } 45 | 46 | public ResponseResult(Integer status ,String message,Object data){ 47 | this.status = status; 48 | this.message = message; 49 | this.data = data; 50 | } 51 | 52 | public ResponseResult(ResultCode resultCode, String message){ 53 | this.status = resultCode.getCode(); 54 | this.message = message; 55 | } 56 | 57 | /** 58 | * 默认成功返回的实例 59 | * @param data 对象 60 | */ 61 | private ResponseResult(Object data){ 62 | this.status = ResultCode.OK.getCode(); 63 | this.message = ResultCode.OK.getName(); 64 | this.data = data; 65 | } 66 | 67 | private ResponseResult(String message,Object data){ 68 | this.status = ResultCode.OK.getCode(); 69 | this.message = message; 70 | this.data = data; 71 | } 72 | 73 | private ResponseResult(ResultCode code){ 74 | this.status = code.getCode(); 75 | this.message = code.getName(); 76 | this.data = null; 77 | } 78 | 79 | public Integer getStatus() { 80 | return status; 81 | } 82 | 83 | public String getMessage() { 84 | return message; 85 | } 86 | 87 | public Object getData() { 88 | return data; 89 | } 90 | 91 | public Date getTimeStamp() { 92 | return timeStamp; 93 | } 94 | 95 | public static ResponseResult ok(Object data){ 96 | return new ResponseResult(data); 97 | } 98 | 99 | public static ResponseResult ok(String message,Object data){ 100 | return new ResponseResult(data); 101 | } 102 | 103 | public static ResponseResult fail(ResultCode code){ 104 | return new ResponseResult(code); 105 | } 106 | 107 | public static ResponseResult fail(String message){ 108 | return new ResponseResult(HttpStatus.BAD_REQUEST.value(),"失败",message); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # license 2 | 软件许可证书生成+验证 3 | 4 | 作者:appleyk 5 | 6 | 博客地址:https://blog.csdn.net/appleyk 7 | 8 | 本篇博客地址:https://blog.csdn.net/Appleyk/article/details/101530203 9 | 10 | ## license.app 11 | 12 | 软件许可应用(WebApp,主要用于引入license模块,便于测试) 13 | 14 | 1、首先要用KeyTool工具来生成密钥库:(-alias别名 –validity 3650表示10年有效) 15 | keytool -genkey -alias privatekeys -keysize 1024 -keystore privateKeys.store -validity 3650 16 | 17 | 2、然后将密钥库中名称为‘privatekeys’的证书条目导出到证书文件certfile.cer中: 18 | keytool -export -alias privatekeys -file certfile.cer -keystore privateKeys.store 19 | 20 | 3、然后再把这个证书文件的信息导入到公钥库中别名为publiccert的证书条目中: 21 | keytool -import -alias publiccert -file certfile.cer -keystore publicCerts.store 22 | 23 | 最后生成的文件privateKeys.store和publicCerts.store拷贝出来备用。 24 | 25 | application.properties文件中添加如下配置: 26 | 27 | ##License相关配置 28 | 证书名称 29 | - > springboot.license.verify.subject=landi 30 | 31 | 公钥别名 32 | - > springboot.license.verify.publicAlias=publiccert 33 | 34 | 公钥库所在的位置 35 | - > springboot.license.verify.publicKeysStorePath=/publicCerts.store 36 | 37 | 公钥库访问密码 38 | - > springboot.license.verify.storePass=123456a 39 | 40 | 证书生成的临时位置(如果参数不指定,则由程序自动进行处理) 41 | - > springboot.license.generate.temp.dir=D:/app/licenses/ 42 | 43 | 证书所在系统中的的位置(默认放在classes下面) 44 | - > springboot.license.verify.licensePath =classpath:license.lic 45 | 46 | 47 | ============License相关配置============= 48 | 49 | 生成证书的请求参数(json): 50 | 51 | ```json 52 | { 53 | "subject": "landi", 54 | "privateAlias": "privateKeys", 55 | "keyPass": "123456a", 56 | "storePass": "123456a", 57 | "privateKeysStorePath": "/privateKeys.store", 58 | "issuedTime": "2020-05-01 08:30:00", 59 | "expiryTime": "2021-05-01 08:30:00", 60 | "description": "系统软件许可证书", 61 | "licenseCheck": { 62 | "ipAddress": [ 63 | "192.168.1.2", 64 | "2408:8221:1d:bbd0:ad77:446e:4904:a776", 65 | "2408:8221:1d:bbd0:71b6:d1b0:39c6:3c4e", 66 | "192.168.145.1", 67 | "192.168.239.1" 68 | ], 69 | "macAddress": [ 70 | "64-FB-81-6F-0E-C2", 71 | "00-50-56-C0-00-08", 72 | "00-50-56-C0-00-01" 73 | ], 74 | "cpuSerial": "BFEBFBFF000206D7", 75 | "mainBoardSerial": "MB-201706282017", 76 | "registerAmount": 1000, 77 | "macCheck": false, 78 | "boardCheck": false, 79 | "cpuCheck": false, 80 | "ipCheck": false, 81 | "registerCheck": true 82 | } 83 | } 84 | ``` 85 | 86 | ============License相关配置============= 87 | 88 | ### license.api 89 | 证书接口文档 90 | 91 | ### license.app 92 | 证书应用App 93 | 94 | :可打包成war(默认war)或jar,进行部署 95 | 96 | ### license.core 97 | 证书核心模块 98 | 99 | 100 | ### license.creator 101 | 证书生成模块 102 | 103 | :也包括lic文件下载接口 104 | 105 | ### license.verify 106 | 证书验证模块 107 | 108 | :内置lic文件变动定时检测功能,如业务系统需要用到,只需要在SpringBoot启动类上,添加@EnableScheduling注解即可 109 | 110 | :如需在接口上开启License验证功能,只需要在对应的API方法上添加@VLicense注解即可 111 | 112 | ### 效果图 113 | 114 | ![图1](https://i.postimg.cc/wBz3ZLHM/11.png) 115 | 116 | 117 | ![图2](https://i.postimg.cc/G2V4MNpw/12.png) 118 | 119 | 120 | ![图3](https://i.postimg.cc/jqnwWs8s/13.png) 121 | 122 | 123 | ![图4](https://i.postimg.cc/bwpsF1qJ/14.png) 124 | -------------------------------------------------------------------------------- /license-api/doc/vendor/polyfill.js: -------------------------------------------------------------------------------- 1 | // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys 2 | if (!Object.keys) { 3 | Object.keys = (function () { 4 | 'use strict'; 5 | var hasOwnProperty = Object.prototype.hasOwnProperty, 6 | hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), 7 | dontEnums = [ 8 | 'toString', 9 | 'toLocaleString', 10 | 'valueOf', 11 | 'hasOwnProperty', 12 | 'isPrototypeOf', 13 | 'propertyIsEnumerable', 14 | 'constructor' 15 | ], 16 | dontEnumsLength = dontEnums.length; 17 | 18 | return function (obj) { 19 | if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { 20 | throw new TypeError('Object.keys called on non-object'); 21 | } 22 | 23 | var result = [], prop, i; 24 | 25 | for (prop in obj) { 26 | if (hasOwnProperty.call(obj, prop)) { 27 | result.push(prop); 28 | } 29 | } 30 | 31 | if (hasDontEnumBug) { 32 | for (i = 0; i < dontEnumsLength; i++) { 33 | if (hasOwnProperty.call(obj, dontEnums[i])) { 34 | result.push(dontEnums[i]); 35 | } 36 | } 37 | } 38 | return result; 39 | }; 40 | }()); 41 | } 42 | 43 | //Production steps of ECMA-262, Edition 5, 15.4.4.18 44 | //Reference: http://es5.github.com/#x15.4.4.18 45 | if (!Array.prototype.forEach) { 46 | Array.prototype.forEach = function (callback, thisArg) { 47 | var T, k; 48 | 49 | if (this == null) { 50 | throw new TypeError(' this is null or not defined'); 51 | } 52 | 53 | // 1. Let O be the result of calling ToObject passing the |this| value as the argument. 54 | var O = Object(this); 55 | 56 | // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". 57 | // 3. Let len be ToUint32(lenValue). 58 | var len = O.length >>> 0; 59 | 60 | // 4. If IsCallable(callback) is false, throw a TypeError exception. 61 | // See: http://es5.github.com/#x9.11 62 | if (typeof callback !== "function") { 63 | throw new TypeError(callback + " is not a function"); 64 | } 65 | 66 | // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. 67 | if (arguments.length > 1) { 68 | T = thisArg; 69 | } 70 | 71 | // 6. Let k be 0 72 | k = 0; 73 | 74 | // 7. Repeat, while k < len 75 | while (k < len) { 76 | var kValue; 77 | 78 | // a. Let Pk be ToString(k). 79 | // This is implicit for LHS operands of the in operator 80 | // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. 81 | // This step can be combined with c 82 | // c. If kPresent is true, then 83 | if (k in O) { 84 | // i. Let kValue be the result of calling the Get internal method of O with argument Pk. 85 | kValue = O[k]; 86 | 87 | // ii. Call the Call internal method of callback with T as the this value and 88 | // argument list containing kValue, k, and O. 89 | callback.call(T, kValue, k, O); 90 | } 91 | // d. Increase k by 1. 92 | k++; 93 | } 94 | // 8. return undefined 95 | }; 96 | } 97 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.1.4.RELEASE 10 | 11 | 12 | 4.0.0 13 | com.appleyk.spring.boot 14 | license-spring-boot 15 | 0.2.1-SNAPSHOT 16 | pom 17 | 18 | 19 | license-core 20 | license-creator 21 | license-app 22 | license-verify 23 | 24 | 25 | 26 | 1.8 27 | UTF-8 28 | UTF-8 29 | 2.10.0 30 | 31 | 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-web 37 | 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-starter-tomcat 42 | 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-test 47 | 48 | 49 | 50 | 51 | junit 52 | junit 53 | 4.12 54 | 55 | 56 | 57 | 58 | 59 | com.fasterxml.jackson.core 60 | jackson-core 61 | ${jackson.version} 62 | 63 | 64 | com.fasterxml.jackson.core 65 | jackson-annotations 66 | ${jackson.version} 67 | 68 | 69 | com.fasterxml.jackson.core 70 | jackson-databind 71 | ${jackson.version} 72 | 73 | 74 | 75 | 76 | 77 | license-spring-boot 78 | 79 | 80 | org.apache.maven.plugins 81 | maven-compiler-plugin 82 | 3.3 83 | 84 | 1.8 85 | 1.8 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/service/WindowsServerInfos.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.service; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.File; 7 | import java.io.FileWriter; 8 | import java.io.InputStreamReader; 9 | 10 | /** 11 | *

用于获取客户Windows服务器的基本信息

12 | * 13 | * @author appleyk 14 | * @version V.0.2.1 15 | * @blob https://blog.csdn.net/appleyk 16 | * @date created on 10:42 下午 2020/8/21 17 | */ 18 | public class WindowsServerInfos extends AServerInfos { 19 | 20 | private final String CPU_COMMAND = "wmic cpu get processorid"; 21 | private final String MAIN_BOARD_COMMAND = "wmic baseboard get serialnumber"; 22 | 23 | @Override 24 | protected String getCPUSerial() throws Exception { 25 | String result = ""; 26 | try { 27 | File file = File.createTempFile("tmp", ".vbs"); 28 | file.deleteOnExit(); 29 | FileWriter fw = new FileWriter(file); 30 | String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" 31 | + "Set colItems = objWMIService.ExecQuery _ \n" + " (\"Select * from Win32_Processor\") \n" 32 | + "For Each objItem in colItems \n" + " Wscript.Echo objItem.ProcessorId \n" 33 | + " exit for ' do the first cpu only! \n" + "Next \n"; 34 | 35 | fw.write(vbs); 36 | fw.close(); 37 | Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath()); 38 | BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); 39 | String line; 40 | while ((line = input.readLine()) != null) { 41 | result += line; 42 | } 43 | input.close(); 44 | file.delete(); 45 | } catch (Exception e) { 46 | LoggerHelper.error("获取cpu信息错误", e); 47 | } 48 | return result.trim(); 49 | // return GxServerSerialHelper.getWindowsSerial(CPU_COMMAND); 50 | } 51 | 52 | @Override 53 | protected String getMainBoardSerial() throws Exception { 54 | 55 | String result = ""; 56 | try { 57 | File file = File.createTempFile("realhowto", ".vbs"); 58 | file.deleteOnExit(); 59 | FileWriter fw = new FileWriter(file); 60 | 61 | String vbs = "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n" 62 | + "Set colItems = objWMIService.ExecQuery _ \n" + " (\"Select * from Win32_BaseBoard\") \n" 63 | + "For Each objItem in colItems \n" + " Wscript.Echo objItem.SerialNumber \n" 64 | + " exit for ' do the first cpu only! \n" + "Next \n"; 65 | 66 | fw.write(vbs); 67 | fw.close(); 68 | Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath()); 69 | BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); 70 | String line; 71 | while ((line = input.readLine()) != null) { 72 | result += line; 73 | } 74 | input.close(); 75 | } catch (Exception e) { 76 | LoggerHelper.error("获取主板信息错误", e); 77 | } 78 | return result.trim(); 79 | // return GxServerSerialHelper.getWindowsSerial(MAIN_BOARD_COMMAND); 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/helper/ParamInitHelper.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.helper; 2 | 3 | import com.appleyk.core.model.LicenseCreatorParam; 4 | import com.appleyk.core.model.LicenseVerifyManager; 5 | import com.appleyk.core.model.LicenseVerifyParam; 6 | import de.schlichtherle.license.*; 7 | 8 | import javax.security.auth.x500.X500Principal; 9 | import java.util.prefs.Preferences; 10 | 11 | /** 12 | *

GxParamInitHelper

13 | * 14 | * @author appleyk 15 | * @version V.0.2.1 16 | * @blob https://blog.csdn.net/appleyk 17 | * @date created on 10:42 下午 2020/8/21 18 | */ 19 | public class ParamInitHelper { 20 | 21 | /** 证书的发行者和主体字段信息 */ 22 | private final static X500Principal DEFAULT_HOLDER_AND_ISSUER = new X500Principal("CN=a, OU=a, O=a, L=a, ST=a, C=a"); 23 | 24 | /** 25 | *

初始化证书生成参数

26 | * @param param GxLicenseCreatorParam 生成证书参数 27 | * @return LicenseParam 证书参数 28 | */ 29 | public static LicenseParam initLicenseParam(LicenseCreatorParam param){ 30 | Preferences preferences = Preferences.userNodeForPackage(LicenseCreator.class); 31 | /** 设置对证书内容加密的秘钥 */ 32 | CipherParam cipherParam = new DefaultCipherParam(param.getStorePass()); 33 | KeyStoreParam privateStoreParam = new DefaultKeyStoreParam(LicenseCreator.class 34 | ,param.getPrivateKeysStorePath() 35 | ,param.getPrivateAlias() 36 | ,param.getStorePass() 37 | ,param.getKeyPass()); 38 | return new DefaultLicenseParam(param.getSubject(),preferences,privateStoreParam,cipherParam); 39 | } 40 | 41 | /** 42 | *

初始化证书内容信息对象

43 | * @param param GxLicenseCreatorParam 生成证书参数 44 | * @return LicenseContent 证书内容 45 | */ 46 | public static LicenseContent initLicenseContent(LicenseCreatorParam param){ 47 | LicenseContent licenseContent = new LicenseContent(); 48 | licenseContent.setHolder(DEFAULT_HOLDER_AND_ISSUER); 49 | licenseContent.setIssuer(DEFAULT_HOLDER_AND_ISSUER); 50 | /** 设置证书名称 */ 51 | licenseContent.setSubject(param.getSubject()); 52 | /** 设置证书有效期 */ 53 | licenseContent.setIssued(param.getIssuedTime()); 54 | /** 设置证书生效日期 */ 55 | licenseContent.setNotBefore(param.getIssuedTime()); 56 | /** 设置证书失效日期 */ 57 | licenseContent.setNotAfter(param.getExpiryTime()); 58 | /** 设置证书用户类型 */ 59 | licenseContent.setConsumerType(param.getConsumerType()); 60 | /** 设置证书用户数量 */ 61 | licenseContent.setConsumerAmount(param.getConsumerAmount()); 62 | /** 设置证书描述信息 */ 63 | licenseContent.setInfo(param.getDescription()); 64 | /** 设置证书扩展信息(对象 -- 额外的ip、mac、cpu等信息) */ 65 | licenseContent.setExtra(param.getLicenseCheck()); 66 | return licenseContent; 67 | } 68 | 69 | /** 70 | *

初始化证书生成参数

71 | * @param param License校验类需要的参数 72 | */ 73 | public static LicenseParam initLicenseParam(LicenseVerifyParam param){ 74 | Preferences preferences = Preferences.userNodeForPackage(LicenseVerifyManager.class); 75 | CipherParam cipherParam = new DefaultCipherParam(param.getStorePass()); 76 | KeyStoreParam publicStoreParam = new DefaultKeyStoreParam(LicenseVerifyManager.class 77 | /** 公钥库存储路径 */ 78 | ,param.getPublicKeysStorePath() 79 | /** 公匙别名 */ 80 | ,param.getPublicAlias() 81 | /** 公钥库访问密码 */ 82 | ,param.getStorePass() 83 | ,null); 84 | return new DefaultLicenseParam(param.getSubject(),preferences,publicStoreParam,cipherParam); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /license-verify/src/main/java/com/appleyk/verify/listener/LicenseVerifyListener.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.verify.listener; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | import com.appleyk.core.model.LicenseResult; 5 | import com.appleyk.core.model.LicenseVerifyManager; 6 | import com.appleyk.core.utils.CommonUtils; 7 | import com.appleyk.verify.config.LicenseVerifyProperties; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.context.ApplicationListener; 10 | import org.springframework.context.event.ContextRefreshedEvent; 11 | import org.springframework.scheduling.annotation.Scheduled; 12 | import org.springframework.stereotype.Component; 13 | import org.springframework.util.DigestUtils; 14 | import org.springframework.util.ResourceUtils; 15 | 16 | import java.io.File; 17 | import java.io.FileInputStream; 18 | import java.io.FileNotFoundException; 19 | 20 | /** 21 | *

项目启动时安装证书&定时检测lic变化,自动更替lic

22 | * 23 | * @author appleyk 24 | * @version V.0.2.1 25 | * @blob https://blog.csdn.net/appleyk 26 | * @date created on 00:02 上午 2020/8/22 27 | */ 28 | @Component 29 | public class LicenseVerifyListener implements ApplicationListener { 30 | 31 | @Autowired 32 | private LicenseVerifyProperties properties; 33 | 34 | /**文件唯一身份标识 == 相当于人类的指纹一样*/ 35 | private static String md5 = ""; 36 | private static boolean isLoad = false; 37 | 38 | @Override 39 | public void onApplicationEvent(ContextRefreshedEvent event) { 40 | if(CommonUtils.isNotEmpty(properties.getLicensePath())){ 41 | install(); 42 | try{ 43 | String readMd5 = getMd5(properties.getLicensePath()); 44 | isLoad = true; 45 | if(LicenseVerifyListener.md5 == null || "".equals(LicenseVerifyListener.md5)){ 46 | LicenseVerifyListener.md5 =readMd5; 47 | } 48 | }catch (Exception e){ 49 | 50 | } 51 | } 52 | } 53 | 54 | /**5秒检测一次,不能太快也不能太慢*/ 55 | @Scheduled(cron = "0/5 * * * * ?") 56 | protected void timer() throws Exception { 57 | if(!isLoad){ 58 | return; 59 | } 60 | String readMd5 = getMd5(properties.getLicensePath()); 61 | // 不相等,说明lic变化了 62 | if(!readMd5.equals(LicenseVerifyListener.md5)){ 63 | install(); 64 | LicenseVerifyListener.md5 = readMd5; 65 | } 66 | } 67 | 68 | private void install() { 69 | LoggerHelper.info("++++++++ 开始安装证书 ++++++++"); 70 | LicenseVerifyManager licenseVerifyManager = new LicenseVerifyManager(); 71 | /** 走定义校验证书并安装 */ 72 | LicenseResult result = licenseVerifyManager.install(properties.getVerifyParam()); 73 | if(result.getResult()){ 74 | LoggerHelper.info("++++++++ 证书安装成功 ++++++++"); 75 | }else{ 76 | LoggerHelper.info("++++++++ 证书安装失败 ++++++++"); 77 | } 78 | } 79 | 80 | /** 81 | *

获取文件的md5

82 | */ 83 | public String getMd5(String filePath) throws Exception { 84 | File file; 85 | String md5 = ""; 86 | try { 87 | file = ResourceUtils.getFile(filePath); 88 | if (file.exists()) { 89 | FileInputStream is = new FileInputStream(file); 90 | byte[] data = new byte[is.available()]; 91 | is.read(data); 92 | md5 = DigestUtils.md5DigestAsHex(data); 93 | is.close(); 94 | } 95 | } catch (FileNotFoundException e) { 96 | 97 | } 98 | return md5; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /license-api/doc/utils/send_sample_request_utils.js: -------------------------------------------------------------------------------- 1 | //this block is used to make this module works with Node (CommonJS module format) 2 | if (typeof define !== 'function') { 3 | var define = require('amdefine')(module) 4 | } 5 | 6 | define(['lodash'], function (_) { 7 | 8 | var log = console; 9 | 10 | function handleNestedFields(object, key, params, paramType) { 11 | var attributes = key.split('.'); 12 | var field = attributes[0]; 13 | params.push(field); 14 | if (attributes.length > 1 && paramType[params.join('.')] == 'Object') { 15 | var nestedField = attributes.slice(1).join('.'); 16 | if (!object[field]) 17 | object[field] = {}; 18 | if (typeof object[field] == 'object') { 19 | object[field][nestedField] = object[key]; 20 | delete object[key]; 21 | handleNestedFields(object[field], nestedField, params, paramType); 22 | } 23 | } 24 | } 25 | 26 | function handleNestedFieldsForAllParams(param, paramType) { 27 | var result = Object.assign({}, param); 28 | Object.keys(result).forEach(function (key) { 29 | handleNestedFields(result, key, [], paramType); 30 | }); 31 | return result 32 | } 33 | 34 | function handleArraysAndObjectFields(param, paramType) { 35 | var result = Object.assign({}, param); 36 | Object.keys(paramType).forEach(function (key) { 37 | if (result[key] && (paramType[key].endsWith('[]') || paramType[key] === 'Object')) { 38 | try { 39 | result[key] = JSON.parse(result[key]); 40 | } catch (e) {;} 41 | } 42 | }); 43 | return result 44 | } 45 | 46 | function tryParsingAsType(object, path, type) { 47 | var val = _.get(object, path); 48 | if (val !== undefined) { 49 | if (type === 'Boolean') { 50 | if (val === 'true') { 51 | _.set(object, path, true); 52 | } else if (val === 'false') { 53 | _.set(object, path, false); 54 | } else { 55 | log.warn('Failed to parse object value at path [' + path + ']. Value: (' + val + '). Type: (' + type + ')'); 56 | } 57 | } else if (type === 'Number') { 58 | var parsedInt = parseInt(val, 10); 59 | if (!_.isNaN(parsedInt)) { 60 | _.set(object, path, parsedInt); 61 | } else { 62 | log.warn('Failed to parse object value at path [' + path + ']. Value: (' + val + '). Type: (' + type + ')'); 63 | } 64 | } 65 | } 66 | } 67 | 68 | function handleNestedAndParsingFields(param, paramType) { 69 | var result = handleArraysAndObjectFields(param, paramType); 70 | result = handleNestedFieldsForAllParams(result, paramType); 71 | return result; 72 | } 73 | 74 | function tryParsingWithTypes(param, paramType) { 75 | var result = Object.assign({}, param); 76 | Object.keys(paramType).forEach(function (key) { 77 | tryParsingAsType(result, key, paramType[key]); 78 | }); 79 | return result; 80 | } 81 | 82 | // Converts path params in the {param} format to the accepted :param format, used before inserting the URL params. 83 | function convertPathParams(url) { 84 | return url.replace(/{(.+?)}/g, ':$1'); 85 | } 86 | 87 | function setLogger(logger) { 88 | log = logger; 89 | } 90 | 91 | return { 92 | handleNestedAndParsingFields, 93 | convertPathParams, 94 | tryParsingWithTypes, 95 | setLogger 96 | }; 97 | }); 98 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/model/LicenseVerifyManager.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.model; 2 | 3 | import com.appleyk.core.helper.LoggerHelper; 4 | import com.appleyk.core.helper.ParamInitHelper; 5 | import com.appleyk.core.utils.DateUtils; 6 | import de.schlichtherle.license.*; 7 | import org.springframework.util.ResourceUtils; 8 | 9 | import java.io.File; 10 | import java.text.DateFormat; 11 | import java.text.MessageFormat; 12 | import java.text.SimpleDateFormat; 13 | 14 | /** 15 | *

License校验类

16 | * 17 | * @author appleyk 18 | * @version V.0.2.1 19 | * @blob https://blog.csdn.net/appleyk 20 | * @date created on 10:42 下午 2020/8/21 21 | */ 22 | public class LicenseVerifyManager { 23 | 24 | /** 25 | *

安装License证书

26 | * @param param License校验类需要的参数 27 | */ 28 | public synchronized LicenseResult install(LicenseVerifyParam param){ 29 | try{ 30 | /** 1、初始化License证书参数 */ 31 | LicenseParam licenseParam = ParamInitHelper.initLicenseParam(param); 32 | /** 2、创建License证书管理器对象 */ 33 | // LicenseManager licenseManager =new LicenseManager(licenseParam); 34 | //走自定义的Lic管理 35 | LicenseCustomManager licenseManager = new LicenseCustomManager(licenseParam); 36 | /** 3、获取要安装的证书文件 */ 37 | File licenseFile = ResourceUtils.getFile(param.getLicensePath()); 38 | /** 4、如果之前安装过证书,先卸载之前的证书 == 给null */ 39 | licenseManager.uninstall(); 40 | /** 5、开始安装 */ 41 | LicenseContent content = licenseManager.install(licenseFile); 42 | String message = MessageFormat.format("证书安装成功,证书有效期:{0} - {1}", 43 | DateUtils.date2Str(content.getNotBefore()),DateUtils.date2Str(content.getNotAfter())); 44 | LoggerHelper.info(message); 45 | return new LicenseResult(message,content); 46 | }catch (LicenseContentException contentExc){ 47 | String message = contentExc.getMessage(); 48 | LoggerHelper.error(message); 49 | return new LicenseResult(false,message,contentExc); 50 | } catch (Exception e){ 51 | LoggerHelper.error(e.getMessage(),e); 52 | return new LicenseResult(false,e.getMessage(),e); 53 | } 54 | } 55 | 56 | /** 57 | *

校验License证书

58 | * @param param License校验类需要的参数 59 | */ 60 | public LicenseResult verify(LicenseVerifyParam param){ 61 | 62 | /** 1、初始化License证书参数 */ 63 | LicenseParam licenseParam = ParamInitHelper.initLicenseParam(param); 64 | /** 2、创建License证书管理器对象 */ 65 | LicenseManager licenseManager = new LicenseCustomManager(licenseParam); 66 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 67 | 68 | /** 3、开始校验证书 */ 69 | try { 70 | LicenseContent licenseContent = licenseManager.verify(); 71 | String message = MessageFormat.format("证书校验通过,证书有效期:{0} - {1}", 72 | format.format(licenseContent.getNotBefore()),format.format(licenseContent.getNotAfter())); 73 | LoggerHelper.info(message); 74 | return new LicenseResult(message,licenseContent); 75 | }catch (NoLicenseInstalledException ex){ 76 | String message = "证书未安装!"; 77 | LoggerHelper.error(message,ex); 78 | return new LicenseResult(false,message,ex); 79 | }catch (LicenseContentException cex){ 80 | LoggerHelper.error(cex.getMessage(),cex); 81 | return new LicenseResult(false,cex.getMessage(),cex); 82 | } catch (Exception e){ 83 | String message = "证书校验失败!"; 84 | LoggerHelper.error(message,e); 85 | return new LicenseResult(false,message,e); 86 | } 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/model/LicenseExtraParam.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.model; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | *

自定义需要校验的License参数

8 | * 9 | * @author appleyk 10 | * @version V.0.2.1 11 | * @blob https://blog.csdn.net/appleyk 12 | * @date created on 10:42 下午 2020/8/21 13 | */ 14 | public class LicenseExtraParam implements Serializable { 15 | 16 | private static final long serialVersionUID = 8600137500316662317L; 17 | 18 | /** 是否认证ip*/ 19 | private boolean isIpCheck ; 20 | 21 | /** 可被允许的IP地址*/ 22 | private List ipAddress; 23 | 24 | /**是否认证mac*/ 25 | private boolean isMacCheck ; 26 | 27 | /** 可被允许的mac地址*/ 28 | private List macAddress; 29 | 30 | /**是否认证cpu序列号*/ 31 | private boolean isCpuCheck ; 32 | 33 | /** 可被允许的CPU序列号*/ 34 | private String cpuSerial; 35 | 36 | /** 是否认证主板号*/ 37 | private boolean isBoardCheck ; 38 | 39 | /**可被允许的主板序列号*/ 40 | private String mainBoardSerial; 41 | 42 | /** 是否限制注册人数*/ 43 | private boolean isRegisterCheck; 44 | 45 | /** 限制系统中可注册的人数*/ 46 | private Long registerAmount; 47 | 48 | /**其他可自行扩展字段*/ 49 | 50 | public LicenseExtraParam(){ 51 | 52 | } 53 | 54 | public static long getSerialVersionUID() { 55 | return serialVersionUID; 56 | } 57 | 58 | public List getIpAddress() { 59 | return ipAddress; 60 | } 61 | 62 | public void setIpAddress(List ipAddress) { 63 | this.ipAddress = ipAddress; 64 | } 65 | 66 | public List getMacAddress() { 67 | return macAddress; 68 | } 69 | 70 | public void setMacAddress(List macAddress) { 71 | this.macAddress = macAddress; 72 | } 73 | 74 | public String getCpuSerial() { 75 | return cpuSerial; 76 | } 77 | 78 | public void setCpuSerial(String cpuSerial) { 79 | this.cpuSerial = cpuSerial; 80 | } 81 | 82 | public String getMainBoardSerial() { 83 | return mainBoardSerial; 84 | } 85 | 86 | public void setMainBoardSerial(String mainBoardSerial) { 87 | this.mainBoardSerial = mainBoardSerial; 88 | } 89 | 90 | public boolean isIpCheck() { 91 | return isIpCheck; 92 | } 93 | 94 | public void setIpCheck(boolean ipCheck) { 95 | isIpCheck = ipCheck; 96 | } 97 | 98 | public boolean isMacCheck() { 99 | return isMacCheck; 100 | } 101 | 102 | public void setMacCheck(boolean macCheck) { 103 | isMacCheck = macCheck; 104 | } 105 | 106 | public boolean isCpuCheck() { 107 | return isCpuCheck; 108 | } 109 | 110 | public void setCpuCheck(boolean cpuCheck) { 111 | isCpuCheck = cpuCheck; 112 | } 113 | 114 | public boolean isBoardCheck() { 115 | return isBoardCheck; 116 | } 117 | 118 | public void setBoardCheck(boolean boardCheck) { 119 | isBoardCheck = boardCheck; 120 | } 121 | 122 | public Long getRegisterAmount() { 123 | return registerAmount; 124 | } 125 | 126 | public void setRegisterAmount(Long registerAmount) { 127 | this.registerAmount = registerAmount; 128 | } 129 | 130 | public boolean isRegisterCheck() { 131 | return isRegisterCheck; 132 | } 133 | 134 | public void setRegisterCheck(boolean registerCheck) { 135 | isRegisterCheck = registerCheck; 136 | } 137 | 138 | @Override 139 | public String toString() { 140 | return "LicenseExtraParam{" + 141 | "ipAddress=" + ipAddress + 142 | ", macAddress=" + macAddress + 143 | ", cpuSerial='" + cpuSerial + '\'' + 144 | ", mainBoardSerial='" + mainBoardSerial + '\'' + 145 | ", registerAmount='" + registerAmount + '\'' + 146 | '}'; 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /license-verify/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 用户登录页面 7 | 8 | 9 | 10 | 11 | 12 | 66 | 67 | 68 |
69 |
70 |
71 |

LOGIN

72 |
73 |
74 | 75 | 77 |
78 |
79 | 80 | 82 |
83 |
84 | 85 |
86 |
87 | 89 |
90 |
91 |
92 |
93 |
94 | 95 | -------------------------------------------------------------------------------- /license-core/src/main/java/com/appleyk/core/utils/DateUtils.java: -------------------------------------------------------------------------------- 1 | package com.appleyk.core.utils; 2 | 3 | import com.appleyk.core.ex.CommonException; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.time.LocalDate; 7 | import java.time.LocalDateTime; 8 | import java.time.ZoneId; 9 | import java.time.format.DateTimeFormatter; 10 | import java.util.Calendar; 11 | import java.util.Date; 12 | 13 | /** 14 | *

日期工具类

15 | * 16 | * @author appleyk 17 | * @version V.0.1.1 18 | * @blob https://blog.csdn.net/appleyk 19 | * @date created on 10:40 下午 2020/8/21 20 | */ 21 | public class DateUtils { 22 | 23 | private static SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH_mm_ss"); 24 | private static DateTimeFormatter dtF = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); 25 | private static Calendar calendar = Calendar.getInstance(); 26 | 27 | public DateUtils() { 28 | } 29 | 30 | public static synchronized String getCurrentDateForFile() { 31 | long currentTimeMillis = System.currentTimeMillis(); 32 | Date date = new Date(currentTimeMillis); 33 | return sDateFormat.format(date); 34 | } 35 | 36 | public static Long getTime(String time) throws CommonException { 37 | if (CommonUtils.isEmpty(time)) { 38 | throw new CommonException("时间[" + time + "]格式不合法"); 39 | } else if (time.length() < 11) { 40 | dtF = DateTimeFormatter.ofPattern("yyyy-MM-dd"); 41 | LocalDate parse = LocalDate.parse(time, dtF); 42 | return LocalDate.from(parse).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); 43 | } else { 44 | LocalDateTime parse = LocalDateTime.parse(time, dtF); 45 | return LocalDateTime.from(parse).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); 46 | } 47 | } 48 | 49 | public static synchronized String getDate() { 50 | Date date = new Date(); 51 | sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 52 | return sDateFormat.format(date); 53 | } 54 | 55 | public static synchronized String date2Str(Long time) { 56 | Date date = new Date(time); 57 | sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 58 | return sDateFormat.format(date); 59 | } 60 | 61 | public static synchronized String date2Str(Date time) { 62 | sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 63 | return sDateFormat.format(time); 64 | } 65 | 66 | public static synchronized Date str2Date(String time) throws CommonException { 67 | sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 68 | 69 | try { 70 | return sDateFormat.parse(time); 71 | } catch (Exception var2) { 72 | throw new CommonException("字符串[" + time + "]转换日期格式异常"); 73 | } 74 | } 75 | 76 | public static Date addYear(Date date, int mount) { 77 | calendar.setTime(date); 78 | calendar.add(1, mount); 79 | return calendar.getTime(); 80 | } 81 | 82 | public static Date addYear(Long time, int mount) { 83 | Date date = new Date(time); 84 | calendar.setTime(date); 85 | calendar.add(1, mount); 86 | return calendar.getTime(); 87 | } 88 | 89 | public static Date addMonth(Date date, int mount) { 90 | calendar.setTime(date); 91 | calendar.add(2, mount); 92 | return calendar.getTime(); 93 | } 94 | 95 | public static Date addMonth(Long time, int mount) { 96 | Date date = new Date(time); 97 | calendar.setTime(date); 98 | calendar.add(1, mount); 99 | return calendar.getTime(); 100 | } 101 | 102 | public static Date addDay(Date date, int mount) { 103 | calendar.setTime(date); 104 | calendar.add(5, mount); 105 | return calendar.getTime(); 106 | } 107 | 108 | public static Date addDay(Long time, int mount) { 109 | Date date = new Date(time); 110 | calendar.setTime(date); 111 | calendar.add(5, mount); 112 | return calendar.getTime(); 113 | } 114 | 115 | public static void main(String[] args) { 116 | Long time = 1555588742901L; 117 | date2Str(time); 118 | } 119 | } 120 | --------------------------------------------------------------------------------