├── README.md ├── common-test ├── src │ └── main │ │ ├── resources │ │ ├── test40 │ │ │ ├── reduce.js │ │ │ └── map.js │ │ ├── test37.sh │ │ ├── test44 │ │ │ └── SimSun.ttf │ │ ├── dblist.result │ │ └── test41 │ │ │ └── excel.html │ │ └── java │ │ └── com │ │ └── xkcoding │ │ └── test │ │ ├── test44 │ │ ├── CountDiffAnalyse.java │ │ ├── ResultDiffAnalyse.java │ │ ├── ResultAnalyse.java │ │ └── Test44_2.java │ │ ├── test1 │ │ ├── DbInfo.java │ │ ├── TableInfo.java │ │ ├── ViewInfo.java │ │ ├── ColumnInfo.java │ │ ├── Neo.java │ │ ├── ThreadTaskManager.java │ │ └── IdUtil.java │ │ ├── test14 │ │ └── Test14.java │ │ ├── test38 │ │ └── Test38.java │ │ ├── test15 │ │ ├── TableInfo.java │ │ └── ColumnInfo.java │ │ ├── test2 │ │ └── User.java │ │ ├── test13 │ │ ├── case1 │ │ │ ├── OrderEventFactory.java │ │ │ ├── OrderEvent.java │ │ │ ├── OrderEventHandler.java │ │ │ ├── Test13.java │ │ │ └── OrderEventProducer.java │ │ └── case2 │ │ │ ├── OrderEventFactory.java │ │ │ ├── OrderEvent.java │ │ │ ├── OrderEventHandler.java │ │ │ └── Test13.java │ │ ├── test37 │ │ └── Test37.java │ │ ├── test8 │ │ ├── Test8.java │ │ └── server │ │ │ ├── Mem.java │ │ │ ├── Sys.java │ │ │ └── Cpu.java │ │ ├── test40 │ │ ├── Data1.java │ │ ├── Data2.java │ │ └── JoinDataVO.java │ │ ├── test45 │ │ ├── Test45_1.java │ │ └── Test45.java │ │ ├── test42 │ │ └── Test42.java │ │ ├── test6 │ │ ├── MyPipeline.java │ │ ├── Test6.java │ │ └── CsdnProcessor.java │ │ ├── test34 │ │ └── Test34.java │ │ ├── test39 │ │ └── Test39.java │ │ ├── test47 │ │ └── Test47.java │ │ ├── test31 │ │ └── Test31.java │ │ ├── test11 │ │ └── Test11.java │ │ ├── test19 │ │ └── Test19.java │ │ ├── test21 │ │ └── Test21.java │ │ ├── test7 │ │ ├── Test7.java │ │ └── XclientProcessor.java │ │ ├── test5 │ │ └── Test5.java │ │ ├── test18 │ │ └── Test18.java │ │ ├── test20 │ │ └── Test20.java │ │ ├── test33 │ │ └── Test33.java │ │ ├── test28 │ │ └── Test28.java │ │ ├── test49 │ │ └── Test49.java │ │ ├── test3 │ │ └── Test3.java │ │ ├── test43 │ │ └── Test43.java │ │ ├── test36 │ │ └── Test36.java │ │ ├── test9 │ │ └── Test9.java │ │ ├── test29 │ │ └── Test29.java │ │ ├── test16 │ │ └── Test16.java │ │ ├── test32 │ │ └── Test32.java │ │ ├── test4 │ │ └── Test4.java │ │ ├── test48 │ │ └── CaffeineTest.java │ │ ├── test10 │ │ └── Test10.java │ │ ├── test25 │ │ └── Test25.java │ │ └── test35 │ │ └── Test35.java └── .gitignore ├── spring-boot-test ├── src │ ├── main │ │ ├── resources │ │ │ ├── static │ │ │ │ ├── editor-app │ │ │ │ │ ├── libs │ │ │ │ │ │ ├── es5-shim-15.3.4.5 │ │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ │ ├── tests │ │ │ │ │ │ │ │ ├── helpers │ │ │ │ │ │ │ │ │ ├── h.js │ │ │ │ │ │ │ │ │ ├── h-matchers.js │ │ │ │ │ │ │ │ │ └── h-kill.js │ │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ │ └── jasmine_favicon.png │ │ │ │ │ │ │ │ ├── spec │ │ │ │ │ │ │ │ │ └── s-number.js │ │ │ │ │ │ │ │ ├── index.min.html │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── .bower.json │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── CONTRIBUTORS.md │ │ │ │ │ │ ├── bootstrap_3.1.1 │ │ │ │ │ │ │ └── fonts │ │ │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ │ │ │ ├── angular-translate-storage-cookie │ │ │ │ │ │ │ ├── angular-translate-storage-cookie.min.js │ │ │ │ │ │ │ ├── angular-translate-storage-cookie.js │ │ │ │ │ │ │ └── .bower.json │ │ │ │ │ │ ├── angular-translate-loader-static-files │ │ │ │ │ │ │ ├── angular-translate-loader-static-files.min.js │ │ │ │ │ │ │ ├── .bower.json │ │ │ │ │ │ │ └── angular-translate-loader-static-files.js │ │ │ │ │ │ ├── angular-cookies_1.2.13 │ │ │ │ │ │ │ └── angular-cookies.min.js │ │ │ │ │ │ └── json3_3.2.6 │ │ │ │ │ │ │ └── LICENSE │ │ │ │ │ ├── images │ │ │ │ │ │ ├── logo.png │ │ │ │ │ │ ├── delete.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── logo-2x.png │ │ │ │ │ │ ├── wrench.png │ │ │ │ │ │ ├── bpmn-error.png │ │ │ │ │ │ ├── bpmn-warning.png │ │ │ │ │ │ ├── datadefinition.png │ │ │ │ │ │ ├── nw-handle-dark.gif │ │ │ │ │ │ ├── se-handle-dark.gif │ │ │ │ │ │ └── shapemenu_highlight.png │ │ │ │ │ ├── popups │ │ │ │ │ │ ├── icon-template.html │ │ │ │ │ │ ├── select-shape.html │ │ │ │ │ │ ├── unsaved-changes.html │ │ │ │ │ │ └── save-model.html │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── activiti-admin-webfont.eot │ │ │ │ │ │ ├── activiti-admin-webfont.ttf │ │ │ │ │ │ ├── activiti-admin-webfont.woff │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ │ │ ├── stencilsets │ │ │ │ │ │ └── bpmn2.0 │ │ │ │ │ │ │ └── icons │ │ │ │ │ │ │ ├── diagram.png │ │ │ │ │ │ │ ├── activity │ │ │ │ │ │ │ ├── task.png │ │ │ │ │ │ │ ├── subprocess.png │ │ │ │ │ │ │ ├── list │ │ │ │ │ │ │ │ ├── type.camel.png │ │ │ │ │ │ │ │ ├── type.mule.png │ │ │ │ │ │ │ │ ├── type.send.png │ │ │ │ │ │ │ │ ├── type.shell.png │ │ │ │ │ │ │ │ ├── type.user.png │ │ │ │ │ │ │ │ ├── type.manual.png │ │ │ │ │ │ │ │ ├── type.receive.png │ │ │ │ │ │ │ │ ├── type.script.png │ │ │ │ │ │ │ │ ├── type.service.png │ │ │ │ │ │ │ │ └── type.business.rule.png │ │ │ │ │ │ │ ├── event.subprocess.png │ │ │ │ │ │ │ ├── expanded.subprocess.png │ │ │ │ │ │ │ └── event.subprocess.collapsed.png │ │ │ │ │ │ │ ├── catching │ │ │ │ │ │ │ ├── error.png │ │ │ │ │ │ │ ├── timer.png │ │ │ │ │ │ │ ├── cancel.png │ │ │ │ │ │ │ ├── message.png │ │ │ │ │ │ │ ├── signal.png │ │ │ │ │ │ │ └── compensation.png │ │ │ │ │ │ │ ├── endevent │ │ │ │ │ │ │ ├── error.png │ │ │ │ │ │ │ ├── none.png │ │ │ │ │ │ │ ├── cancel.png │ │ │ │ │ │ │ └── terminate.png │ │ │ │ │ │ │ ├── swimlane │ │ │ │ │ │ │ ├── lane.png │ │ │ │ │ │ │ └── pool.png │ │ │ │ │ │ │ ├── throwing │ │ │ │ │ │ │ ├── none.png │ │ │ │ │ │ │ └── signal.png │ │ │ │ │ │ │ ├── gateway │ │ │ │ │ │ │ ├── parallel.png │ │ │ │ │ │ │ ├── eventbased.png │ │ │ │ │ │ │ ├── inclusive.png │ │ │ │ │ │ │ └── exclusive.databased.png │ │ │ │ │ │ │ ├── startevent │ │ │ │ │ │ │ ├── error.png │ │ │ │ │ │ │ ├── none.png │ │ │ │ │ │ │ ├── timer.png │ │ │ │ │ │ │ ├── message.png │ │ │ │ │ │ │ └── signal.png │ │ │ │ │ │ │ ├── connector │ │ │ │ │ │ │ ├── messageflow.png │ │ │ │ │ │ │ ├── sequenceflow.png │ │ │ │ │ │ │ ├── association.undirected.png │ │ │ │ │ │ │ └── association.unidirectional.png │ │ │ │ │ │ │ ├── dataobject │ │ │ │ │ │ │ └── data.store.png │ │ │ │ │ │ │ └── artifact │ │ │ │ │ │ │ └── text.annotation.png │ │ │ │ │ ├── configuration │ │ │ │ │ │ ├── properties │ │ │ │ │ │ │ ├── boolean-property-template.html │ │ │ │ │ │ │ ├── fields-write-template.html │ │ │ │ │ │ │ ├── assignment-write-template.html │ │ │ │ │ │ │ ├── in-parameters-write-template.html │ │ │ │ │ │ │ ├── text-property-write-template.html │ │ │ │ │ │ │ ├── event-listeners-write-template.html │ │ │ │ │ │ │ ├── form-properties-write-template.html │ │ │ │ │ │ │ ├── out-parameters-write-template.html │ │ │ │ │ │ │ ├── task-listeners-write-template.html │ │ │ │ │ │ │ ├── fields-display-template.html │ │ │ │ │ │ │ ├── sequenceflow-order-write-template.html │ │ │ │ │ │ │ ├── condition-expression-write-template.html │ │ │ │ │ │ │ ├── execution-listeners-write-template.html │ │ │ │ │ │ │ ├── message-definitions-write-template.html │ │ │ │ │ │ │ ├── signal-definitions-write-template.html │ │ │ │ │ │ │ ├── sequenceflow-order-display-template.html │ │ │ │ │ │ │ ├── condition-expression-display-template.html │ │ │ │ │ │ │ ├── subprocess-reference-write-template.html │ │ │ │ │ │ │ ├── subprocess-reference-display-template.html │ │ │ │ │ │ │ ├── in-parameters-display-template.html │ │ │ │ │ │ │ ├── message-definitions-display-template.html │ │ │ │ │ │ │ ├── out-parameters-display-template.html │ │ │ │ │ │ │ ├── signal-definitions-display-template.html │ │ │ │ │ │ │ ├── task-listeners-display-template.html │ │ │ │ │ │ │ ├── event-listeners-display-template.html │ │ │ │ │ │ │ ├── form-properties-display-template.html │ │ │ │ │ │ │ ├── execution-listeners-display-template.html │ │ │ │ │ │ │ ├── default-value-display-template.html │ │ │ │ │ │ │ ├── string-property-write-mode-template.html │ │ │ │ │ │ │ ├── multiinstance-property-write-template.html │ │ │ │ │ │ │ ├── signal-property-write-template.html │ │ │ │ │ │ │ ├── message-property-write-template.html │ │ │ │ │ │ │ ├── assignment-display-template.html │ │ │ │ │ │ │ ├── text-popup.html │ │ │ │ │ │ │ ├── feedback-popup.html │ │ │ │ │ │ │ └── condition-expression-popup.html │ │ │ │ │ │ ├── toolbar-custom-actions.js │ │ │ │ │ │ ├── properties-custom-controllers.js │ │ │ │ │ │ ├── properties-multiinstance-controller.js │ │ │ │ │ │ ├── url-config.js │ │ │ │ │ │ ├── properties-signal-scope-controller.js │ │ │ │ │ │ ├── properties-message-scope-controller.js │ │ │ │ │ │ └── properties-condition-expression-controller.js │ │ │ │ │ ├── partials │ │ │ │ │ │ ├── root-stencil-item-template.html │ │ │ │ │ │ └── stencil-item-template.html │ │ │ │ │ ├── app-cfg.js │ │ │ │ │ ├── editor-config.js │ │ │ │ │ └── header-controller.js │ │ │ │ └── diagram-viewer │ │ │ │ │ ├── images │ │ │ │ │ ├── bg.png │ │ │ │ │ ├── breadcrumbs.png │ │ │ │ │ ├── checker-bg.png │ │ │ │ │ └── deployer │ │ │ │ │ │ ├── send.png │ │ │ │ │ │ ├── timer.png │ │ │ │ │ │ ├── user.png │ │ │ │ │ │ ├── manual.png │ │ │ │ │ │ ├── receive.png │ │ │ │ │ │ ├── script.png │ │ │ │ │ │ ├── service.png │ │ │ │ │ │ ├── error_catch.png │ │ │ │ │ │ ├── error_throw.png │ │ │ │ │ │ ├── signal_catch.png │ │ │ │ │ │ ├── signal_throw.png │ │ │ │ │ │ ├── business_rule.png │ │ │ │ │ │ ├── message_catch.png │ │ │ │ │ │ ├── message_throw.png │ │ │ │ │ │ └── blue │ │ │ │ │ │ └── message_catch.png │ │ │ │ │ └── js │ │ │ │ │ └── jstools.js │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── xkcoding │ │ │ └── springboottest │ │ │ ├── constants │ │ │ ├── BaseEnum.java │ │ │ └── enums │ │ │ │ └── GenderEnum.java │ │ │ ├── controller │ │ │ ├── enum_test │ │ │ │ ├── QueryRequest.java │ │ │ │ └── EnumTestController.java │ │ │ ├── TestController.java │ │ │ ├── event │ │ │ │ └── EventBusController.java │ │ │ ├── easyexcel │ │ │ │ └── ExcelListener.java │ │ │ └── activiti │ │ │ │ └── StencilsetRestResource.java │ │ │ ├── entity │ │ │ ├── event │ │ │ │ └── TestEvent.java │ │ │ ├── hutool │ │ │ │ └── excel │ │ │ │ │ └── ExcelModel.java │ │ │ ├── iexcel │ │ │ │ └── ExcelModel.java │ │ │ ├── easypoi │ │ │ │ └── ExcelModel.java │ │ │ └── easyexcel │ │ │ │ └── ExcelModel.java │ │ │ ├── config │ │ │ ├── event │ │ │ │ ├── EventListener.java │ │ │ │ └── EventBusConfig.java │ │ │ ├── WebMvcConfig.java │ │ │ └── convert │ │ │ │ ├── IntegerToEnumConverter.java │ │ │ │ ├── StringToEnumConverter.java │ │ │ │ ├── IntegerCodeToGenderEnumConverter.java │ │ │ │ ├── StringCodeToGenderEnumConverter.java │ │ │ │ └── factory │ │ │ │ ├── StringCodeToEnumConverterFactory.java │ │ │ │ └── IntegerCodeToEnumConverterFactory.java │ │ │ ├── SpringBootTestApplication.java │ │ │ └── service │ │ │ └── event │ │ │ └── EventBusService.java │ └── test │ │ └── java │ │ └── com │ │ └── xkcoding │ │ └── springboottest │ │ └── SpringBootTestApplicationTests.java └── .gitignore ├── .gitignore └── scaffold-demo-test └── src ├── main ├── java │ └── com │ │ └── xkcoding │ │ └── demo │ │ ├── DemoApplication.java │ │ ├── config │ │ └── LogConfig.java │ │ ├── model │ │ └── User.java │ │ └── service │ │ └── CustomLogServiceImpl.java └── resources │ └── application.yml └── test └── java └── com └── xkcoding └── demo └── DemoTest.java /README.md: -------------------------------------------------------------------------------- 1 | # owntest 2 | 个人的一些测试代码 -------------------------------------------------------------------------------- /common-test/src/main/resources/test40/reduce.js: -------------------------------------------------------------------------------- 1 | function (k, v) {return v.value === v.relation} -------------------------------------------------------------------------------- /common-test/src/main/resources/test37.sh: -------------------------------------------------------------------------------- 1 | #!/bin/#!/usr/bin/env bash 2 | param=$1 3 | 4 | echo "脚本接收到的参数是:$param" -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/es5-shim-15.3.4.5/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /common-test/src/main/resources/test40/map.js: -------------------------------------------------------------------------------- 1 | function () { 2 | emit(this.sourceId, {value: this.value, relation: this.relation}); 3 | } -------------------------------------------------------------------------------- /common-test/src/main/resources/test44/SimSun.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/common-test/src/main/resources/test44/SimSun.ttf -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h.js: -------------------------------------------------------------------------------- 1 | function implement() { 2 | throw 'Not implemented'; 3 | } -------------------------------------------------------------------------------- /common-test/src/main/resources/dblist.result: -------------------------------------------------------------------------------- 1 | mysql 192.168.220.80 3306 2 | mysql 192.168.230.211 3306 3 | mysql 192.168.230.24 3306 4 | mysql 192.168.220.52 3306 5 | 1111111 -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/logo.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/diagram-viewer/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/diagram-viewer/images/bg.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/delete.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/loading.gif -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/logo-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/logo-2x.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/wrench.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/bpmn-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/bpmn-error.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/images/bpmn-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xkcoding/owntest/HEAD/spring-boot-test/src/main/resources/static/editor-app/images/bpmn-warning.png -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/popups/icon-template.html: -------------------------------------------------------------------------------- 1 |
8 | * 数量比对分析 9 | *
10 | * 11 | * @author yangkai.shen 12 | * @date Created in 2020/2/12 17:38 13 | */ 14 | @Data 15 | @AllArgsConstructor 16 | public class CountDiffAnalyse { 17 | private String startIp; 18 | private String endIp; 19 | 20 | private Integer countA; 21 | private Integer countB; 22 | } 23 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test1/DbInfo.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test1; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | *7 | * 数据库信息 8 | *
9 | * 10 | * @package: com.xkcoding.test.test1 11 | * @description: 数据库信息 12 | * @author: yangkai.shen 13 | * @date: Created in 2018/11/12 16:18 14 | * @copyright: Copyright (c) 2018 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | @Data 19 | public class DbInfo { 20 | private String id; 21 | private String dbName; 22 | } 23 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test14/Test14.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test14; 2 | 3 | /** 4 | *5 | * 测试 Disruptor 多生产者/多消费者模型 6 | *
7 | * 8 | * @package: com.xkcoding.test.test14 9 | * @description: 测试 Disruptor 多生产者/多消费者模型 10 | * @author: yangkai.shen 11 | * @date: Created in 2019-01-28 17:48 12 | * @copyright: Copyright (c) 2019 13 | * @version: V1.0 14 | * @modified: yangkai.shen 15 | */ 16 | public class Test14 { 17 | public static void main(String[] args) { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test44/ResultDiffAnalyse.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test44; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | /** 7 | *8 | * 结果比对分析 9 | *
10 | * 11 | * @author yangkai.shen 12 | * @date Created in 2020/2/12 17:42 13 | */ 14 | @Data 15 | @AllArgsConstructor 16 | public class ResultDiffAnalyse { 17 | private String ip; 18 | private String port; 19 | 20 | private String type; 21 | private Boolean status; 22 | 23 | private Boolean belongA; 24 | private Boolean belongB; 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/constants/BaseEnum.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.constants; 2 | 3 | /** 4 | *5 | * 通用枚举接口 6 | *
7 | * 8 | * @package: com.xkcoding.springboottest.constants 9 | * @description: 通用枚举接口 10 | * @author: yangkai.shen 11 | * @date: Created in 2019-01-30 11:04 12 | * @copyright: Copyright (c) 2019 13 | * @version: V1.0 14 | * @modified: yangkai.shen 15 | */ 16 | public interface BaseEnum { 17 | /** 18 | * 获取枚举编码 19 | * 20 | * @return 编码 21 | */ 22 | Integer getCode(); 23 | } 24 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/partials/root-stencil-item-template.html: -------------------------------------------------------------------------------- 1 | 8 | 9 |8 | * 测试 mica-http 1.1.9 9 | *
10 | * 11 | * @author yangkai.shen 12 | * @date Created in 2019/9/30 17:06 13 | */ 14 | public class Test38 { 15 | public static void main(String[] args) { 16 | String body = HttpRequest.get("https://github.com").log(LogLevel.BODY).execute().asString().trim(); 17 | // System.out.println("body = " + body); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test15/TableInfo.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test15; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | *9 | * 表实体 10 | *
11 | * 12 | * @package: com.xkcoding.test.test15 13 | * @description: 表实体 14 | * @author: yangkai.shen 15 | * @date: Created in 2019-01-30 09:43 16 | * @copyright: Copyright (c) 2019 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | @Data 21 | public class TableInfo { 22 | private String tableName; 23 | private String tableComment; 24 | private Date createTime; 25 | } 26 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test2/User.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test2; 2 | 3 | import lombok.Data; 4 | import lombok.experimental.Accessors; 5 | 6 | /** 7 | *8 | * 测试 9 | *
10 | * 11 | * @package: com.xkcoding.test.test2 12 | * @description: 测试 13 | * @author: yangkai.shen 14 | * @date: Created in 2018-12-05 13:33 15 | * @copyright: Copyright (c) 2018 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | @Data 20 | @Accessors(chain = true) 21 | public class User { 22 | private String name; 23 | private Integer age; 24 | private String desc; 25 | } 26 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test1/TableInfo.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test1; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | *7 | * 表信息 8 | *
9 | * 10 | * @package: com.xkcoding.test.test1 11 | * @description: 表信息 12 | * @author: yangkai.shen 13 | * @date: Created in 2018/11/12 16:19 14 | * @copyright: Copyright (c) 2018 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | @Data 19 | public class TableInfo { 20 | private String id; 21 | private String dbName; 22 | private String schemaName; 23 | private String tableName; 24 | 25 | private DbInfo dbInfo; 26 | } 27 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test1/ViewInfo.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test1; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | *7 | * 视图信息 8 | *
9 | * 10 | * @package: com.xkcoding.test.test1 11 | * @description: 视图信息 12 | * @author: yangkai.shen 13 | * @date: Created in 2018/11/12 16:20 14 | * @copyright: Copyright (c) 2018 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | @Data 19 | public class ViewInfo { 20 | private String id; 21 | private String dbName; 22 | private String schemaName; 23 | private String viewName; 24 | 25 | private DbInfo dbInfo; 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-number.js: -------------------------------------------------------------------------------- 1 | describe('Number', function () { 2 | 'use strict'; 3 | 4 | describe('toFixed', function () { 5 | it('should convert numbers correctly', function () { 6 | expect((0.00008).toFixed(3)).toBe('0.000'); 7 | expect((0.9).toFixed(0)).toBe('1'); 8 | expect((1.255).toFixed(2)).toBe('1.25'); 9 | expect((1843654265.0774949).toFixed(5)).toBe('1843654265.07749'); 10 | expect((1000000000000000128).toFixed(0)).toBe('1000000000000000128'); 11 | }); 12 | }); 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test15/ColumnInfo.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test15; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | *7 | * 字段实体 8 | *
9 | * 10 | * @package: com.xkcoding.test.test15 11 | * @description: 字段实体 12 | * @author: yangkai.shen 13 | * @date: Created in 2019-01-30 10:25 14 | * @copyright: Copyright (c) 2019 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | @Data 19 | public class ColumnInfo { 20 | private String columnName; 21 | private String dataType; 22 | private String columnComment; 23 | private String columnKey; 24 | private String extra; 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/controller/enum_test/QueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.controller.enum_test; 2 | 3 | import com.xkcoding.springboottest.constants.enums.GenderEnum; 4 | import lombok.Data; 5 | 6 | /** 7 | *8 | * 请求参数 9 | *
10 | * 11 | * @package: com.xkcoding.springboottest.controller.enum_test 12 | * @description: 请求参数 13 | * @author: yangkai.shen 14 | * @date: Created in 2019-01-30 14:02 15 | * @copyright: Copyright (c) 2019 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | @Data 20 | public class QueryRequest { 21 | private GenderEnum gender; 22 | } 23 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test13/case1/OrderEventFactory.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test13.case1; 2 | 3 | import com.lmax.disruptor.EventFactory; 4 | 5 | /** 6 | *7 | * 订单事件工厂类 8 | *
9 | * 10 | * @package: com.xkcoding.test.test13 11 | * @description: 订单事件工厂类 12 | * @author: yangkai.shen 13 | * @date: Created in 2019-01-29 10:41 14 | * @copyright: Copyright (c) 2019 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | public class OrderEventFactory implements EventFactory7 | * 订单事件工厂类 8 | *
9 | * 10 | * @package: com.xkcoding.test.test13 11 | * @description: 订单事件工厂类 12 | * @author: yangkai.shen 13 | * @date: Created in 2019-01-29 10:41 14 | * @copyright: Copyright (c) 2019 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | public class OrderEventFactory implements EventFactory8 | * 测试 hutool 执行shell脚本 9 | *
10 | * 11 | * @author yangkai.shen 12 | * @date Created in 2019-08-22 14:55 13 | */ 14 | public class Test37 { 15 | public static void main(String[] args) { 16 | 17 | ClassPathResource resource = new ClassPathResource("test37.sh"); 18 | String s = RuntimeUtil.execForStr("sh",resource.getAbsolutePath(),"参数1|参数2"); 19 | System.out.println("s = " + s); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test13/case1/OrderEvent.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test13.case1; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | 7 | /** 8 | *9 | * 订单事件 10 | *
11 | * 12 | * @package: com.xkcoding.test.test13 13 | * @description: 订单事件 14 | * @author: yangkai.shen 15 | * @date: Created in 2019-01-29 10:39 16 | * @copyright: Copyright (c) 2019 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | @Data 21 | public class OrderEvent { 22 | /** 23 | * 订单编号 24 | */ 25 | private Long id; 26 | /** 27 | * 订单金额 28 | */ 29 | private BigDecimal price; 30 | } 31 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test13/case2/OrderEvent.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test13.case2; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | 7 | /** 8 | *9 | * 订单事件 10 | *
11 | * 12 | * @package: com.xkcoding.test.test13 13 | * @description: 订单事件 14 | * @author: yangkai.shen 15 | * @date: Created in 2019-01-29 10:39 16 | * @copyright: Copyright (c) 2019 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | @Data 21 | public class OrderEvent { 22 | /** 23 | * 订单编号 24 | */ 25 | private Long id; 26 | /** 27 | * 订单金额 28 | */ 29 | private BigDecimal price; 30 | } 31 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test44/ResultAnalyse.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test44; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | *11 | * 扫描结果对象 12 | *
13 | * 14 | * @author yangkai.shen 15 | * @date Created in 2020/2/12 17:29 16 | */ 17 | @Data 18 | @AllArgsConstructor 19 | public class ResultAnalyse { 20 | private String taskId; 21 | private String taskName; 22 | 23 | private List9 | * EventBus测试 10 | *
11 | * 12 | * @package: com.xkcoding.springboottest.entity.event 13 | * @description: EventBus测试 14 | * @author: yangkai.shen 15 | * @date: Created in 2018-12-03 10:20 16 | * @copyright: Copyright (c) 2018 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | @Data 21 | @NoArgsConstructor 22 | @AllArgsConstructor 23 | public class TestEvent { 24 | private Long jobId; 25 | } 26 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test8/Test8.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test8; 2 | 3 | import cn.hutool.json.JSONUtil; 4 | 5 | /** 6 | *7 | * 测试获取硬件信息 8 | *
9 | * 10 | * @package: com.xkcoding.test.test8 11 | * @description: 测试获取硬件信息 12 | * @author: yangkai.shen 13 | * @date: Created in 2018-12-13 16:54 14 | * @copyright: Copyright (c) 2018 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | public class Test8 { 19 | public static void main(String[] args) throws Exception { 20 | Server server = new Server(); 21 | server.copyTo(); 22 | System.out.println("server = " + JSONUtil.toJsonStr(server)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /scaffold-demo-test/src/main/java/com/xkcoding/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.demo; 2 | 3 | import com.xkcoding.scaffold.launcher.ScaffoldApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | *8 | * 启动器 9 | *
10 | * 11 | * @package: com.xkcoding.demo 12 | * @description: 启动器 13 | * @author: yangkai.shen 14 | * @date: Created in 2019-03-11 09:45 15 | * @copyright: Copyright (c) 2019 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | @SpringBootApplication 20 | public class DemoApplication { 21 | public static void main(String[] args) { 22 | ScaffoldApplication.run("demo", DemoApplication.class, args); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test13/case2/OrderEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test13.case2; 2 | 3 | import cn.hutool.json.JSONUtil; 4 | import com.lmax.disruptor.WorkHandler; 5 | 6 | /** 7 | *8 | * 订单事件处理 9 | *
10 | * 11 | * @package: com.xkcoding.test.test13 12 | * @description: 订单事件处理 13 | * @author: yangkai.shen 14 | * @date: Created in 2019-01-29 10:50 15 | * @copyright: Copyright (c) 2019 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | public class OrderEventHandler implements WorkHandler12 | * 测试表结构 1 13 | *
14 | * 15 | * @author yangkai.shen 16 | * @date Created in 2019/11/27 10:21 17 | */ 18 | @Data 19 | @Document 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class Data1 { 23 | @Id 24 | private Long id; 25 | @Indexed 26 | private String key; 27 | private String value; 28 | } 29 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test40/Data2.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test40; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.springframework.data.annotation.Id; 7 | import org.springframework.data.mongodb.core.index.Indexed; 8 | import org.springframework.data.mongodb.core.mapping.Document; 9 | 10 | /** 11 | *12 | * 测试表结构 2 13 | *
14 | * 15 | * @author yangkai.shen 16 | * @date Created in 2019/11/27 10:22 17 | */ 18 | @Data 19 | @Document 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class Data2 { 23 | @Id 24 | private Long id; 25 | @Indexed 26 | private String key; 27 | private String value; 28 | } 29 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test1/ColumnInfo.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test1; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | *7 | * 列信息 8 | *
9 | * 10 | * @package: com.xkcoding.test.test1 11 | * @description: 列信息 12 | * @author: yangkai.shen 13 | * @date: Created in 2018/11/12 16:21 14 | * @copyright: Copyright (c) 2018 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | @Data 19 | public class ColumnInfo { 20 | private String id; 21 | private String dbName; 22 | private String schemaName; 23 | private String tableName; 24 | private Integer tableType; 25 | private String columnName; 26 | 27 | private TableInfo tableInfo; 28 | private ViewInfo viewInfo; 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | servlet: 4 | context-path: /test 5 | spring: 6 | main: 7 | allow-bean-definition-overriding: true 8 | activiti: 9 | database-schema-update: true 10 | job-executor-activate: true 11 | history-level: full 12 | check-process-definitions: false 13 | ext: 14 | database-schema-update: false 15 | datasource: 16 | url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false 17 | driver-class-name: com.mysql.cj.jdbc.Driver 18 | username: root 19 | password: root 20 | type: com.zaxxer.hikari.HikariDataSource 21 | # spring boot 2.0 启动创建数据表需要开启这个选项 22 | initialization-mode: always 23 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * angular-translate - v2.4.2 - 2014-10-21 3 | * http://github.com/angular-translate/angular-translate 4 | * Copyright (c) 2014 ; Licensed MIT 5 | */ 6 | angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",["$q","$http",function(a,b){return function(c){if(!c||!angular.isString(c.prefix)||!angular.isString(c.suffix))throw new Error("Couldn't load static files, no prefix or suffix specified!");var d=a.defer();return b(angular.extend({url:[c.prefix,c.key,c.suffix].join(""),method:"GET",params:""},c.$http)).success(function(a){d.resolve(a)}).error(function(){d.reject(c.key)}),d.promise}}]); -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test40/JoinDataVO.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test40; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.springframework.data.annotation.Id; 7 | import org.springframework.data.mongodb.core.mapping.Document; 8 | 9 | /** 10 | *11 | * 管理对象 VO 12 | *
13 | * 14 | * @author yangkai.shen 15 | * @date Created in 2019/11/27 17:18 16 | */ 17 | @Data 18 | @Document(value = "join_data") 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class JoinDataVO { 22 | @Id 23 | private Long id; 24 | private Long sourceId; 25 | private String key; 26 | private String value; 27 | private String relation; 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * angular-translate - v2.4.2 - 2014-10-21 3 | * http://github.com/angular-translate/angular-translate 4 | * Copyright (c) 2014 ; Licensed MIT 5 | */ 6 | angular.module('pascalprecht.translate').factory('$translateCookieStorage', [ 7 | '$cookieStore', 8 | function ($cookieStore) { 9 | var $translateCookieStorage = { 10 | get: function (name) { 11 | return $cookieStore.get(name); 12 | }, 13 | set: function (name, value) { 14 | $cookieStore.put(name, value); 15 | } 16 | }; 17 | return $translateCookieStorage; 18 | } 19 | ]); -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test13/case1/OrderEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test13.case1; 2 | 3 | import cn.hutool.json.JSONUtil; 4 | import com.lmax.disruptor.EventHandler; 5 | 6 | /** 7 | *8 | * 订单事件处理 9 | *
10 | * 11 | * @package: com.xkcoding.test.test13 12 | * @description: 订单事件处理 13 | * @author: yangkai.shen 14 | * @date: Created in 2019-01-29 10:50 15 | * @copyright: Copyright (c) 2019 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | public class OrderEventHandler implements EventHandler10 | * 日志配置 11 | *
12 | * 13 | * @package: com.xkcoding.demo.config 14 | * @description: 日志配置 15 | * @author: yangkai.shen 16 | * @date: Created in 2019-03-13 14:13 17 | * @copyright: Copyright (c) 2019 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | @Configuration 22 | public class LogConfig { 23 | @Bean 24 | public LogService logService() { 25 | return new CustomLogServiceImpl(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | *9 | * 测试 10 | *
11 | * 12 | * @package: com.xkcoding.springboottest.controller 13 | * @description: 测试 14 | * @author: yangkai.shen 15 | * @date: Created in 2018-12-03 10:33 16 | * @copyright: Copyright (c) 2018 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | @RestController 21 | @RequestMapping 22 | public class TestController { 23 | @GetMapping 24 | public String test() { 25 | return "test"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/diagram-viewer/js/jstools.js: -------------------------------------------------------------------------------- 1 | if (typeof (console) == "undefined") { 2 | var console = { 3 | info: function () { 4 | }, 5 | warn: function () { 6 | }, 7 | error: function () { 8 | }, 9 | log: function () { 10 | }, 11 | time: function () { 12 | }, 13 | timeEnd: function () { 14 | } 15 | }; 16 | } 17 | 18 | if (!Array.isArray) { 19 | Array.isArray = function (vArg) { 20 | return Object.prototype.toString.call(vArg) === "[object Array]"; 21 | }; 22 | } 23 | 24 | if (!Object.isSVGElement) { 25 | Object.isSVGElement = function (vArg) { 26 | var str = Object.prototype.toString.call(vArg); 27 | return (str.indexOf("[object SVG") == 0); 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test45/Test45_1.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test45; 2 | 3 | import cn.hutool.core.date.StopWatch; 4 | 5 | /** 6 | *7 | * 测试 hutool 的 stopwatch 8 | *
9 | * 10 | * @author yangkai.shen 11 | * @date Created in 2020/2/13 10:51 12 | */ 13 | public class Test45_1 { 14 | public static void main(String[] args) { 15 | StopWatch stopWatch = new StopWatch("task 1"); 16 | try { 17 | stopWatch.start("task 1.1"); 18 | Thread.sleep(2000); 19 | stopWatch.stop(); 20 | 21 | stopWatch.start("task 1.2"); 22 | Thread.sleep(2000); 23 | stopWatch.stop(); 24 | } catch (Exception e) { 25 | e.printStackTrace(); 26 | } 27 | 28 | System.out.println(stopWatch.prettyPrint()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /scaffold-demo-test/src/main/java/com/xkcoding/demo/model/User.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.demo.model; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | *9 | * 用户测试实体类 10 | *
11 | * 12 | * @package: com.xkcoding.demo.model 13 | * @description: 用户测试实体类 14 | * @author: yangkai.shen 15 | * @date: Created in 2019-04-08 10:22 16 | * @copyright: Copyright (c) 2019 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | @Data 21 | @ApiModel(description = "用户信息") 22 | public class User { 23 | @ApiModelProperty(value = "主键") 24 | private Long id; 25 | @ApiModelProperty(value = "用户名") 26 | private String name; 27 | @ApiModelProperty(value = "年龄") 28 | private Integer age; 29 | @ApiModelProperty(value = "邮箱") 30 | private String email; 31 | } -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/config/event/EventListener.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.config.event; 2 | 3 | import com.google.common.eventbus.Subscribe; 4 | import com.xkcoding.springboottest.entity.event.TestEvent; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | *10 | * 事件监听 11 | *
12 | * 13 | * @package: com.xkcoding.springboottest.config.event 14 | * @description: 事件监听 15 | * @author: yangkai.shen 16 | * @date: Created in 2018-12-03 10:07 17 | * @copyright: Copyright (c) 2018 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | @Component 22 | @Slf4j 23 | public class EventListener { 24 | @Subscribe 25 | public void subscribeEvent1(TestEvent event) { 26 | log.info("test event dispatch,event is {}", event); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/constants/enums/GenderEnum.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.constants.enums; 2 | 3 | import com.xkcoding.springboottest.constants.BaseEnum; 4 | import lombok.Getter; 5 | 6 | /** 7 | *8 | * 性别枚举 9 | *
10 | * 11 | * @package: com.xkcoding.springboottest.constants.enums 12 | * @description: 性别枚举 13 | * @author: yangkai.shen 14 | * @date: Created in 2019-01-30 11:06 15 | * @copyright: Copyright (c) 2019 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | @Getter 20 | public enum GenderEnum implements BaseEnum { 21 | /** 22 | * 男 23 | */ 24 | MALE(0), 25 | /** 26 | * 女 27 | */ 28 | FEMALE(1); 29 | 30 | /** 31 | * 性别编码 32 | */ 33 | private Integer code; 34 | 35 | GenderEnum(int code) { 36 | this.code = code; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test42/Test42.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test42; 2 | 3 | import cn.hutool.core.io.FileUtil; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | *9 | * 测试 hutool 的 FileUtil 10 | *
11 | * 12 | * @author yangkai.shen 13 | * @date Created in 2019/12/29 11:17 14 | */ 15 | public class Test42 { 16 | public static void main(String[] args) { 17 | String dir = "/Users/yangkai.shen/Desktop"; 18 | System.out.println(FileUtil.listFileNames(dir)); 19 | for (File file : FileUtil.ls(dir)) { 20 | System.err.println(file.getAbsolutePath()); 21 | if (FileUtil.isDirectory(file)) { 22 | for (File subFile : FileUtil.ls(file.getAbsolutePath())) { 23 | System.err.println("\t" + subFile.getAbsolutePath()); 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/configuration/properties/assignment-display-template.html: -------------------------------------------------------------------------------- 1 | {{'PROPERTY.ASSIGNMENT.ASSIGNEE_DISPLAY' | translate:property.value.assignment }} 2 | {{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS_DISPLAY' | translate:property.value.assignment.candidateUsers}} 3 | {{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS_DISPLAY' | translate:property.value.assignment.candidateGroups}} 4 | PROPERTY.ASSIGNMENT.EMPTY -------------------------------------------------------------------------------- /scaffold-demo-test/src/test/java/com/xkcoding/demo/DemoTest.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.demo; 2 | 3 | import com.xkcoding.scaffold.test.ScaffoldBaseTest; 4 | import com.xkcoding.scaffold.test.ScaffoldTest; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.junit.Test; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | /** 10 | *11 | * 测试 12 | *
13 | * 14 | * @package: com.xkcoding.demo 15 | * @description: 测试 16 | * @author: yangkai.shen 17 | * @date: Created in 2019-03-11 10:48 18 | * @copyright: Copyright (c) 2019 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | @SpringBootTest 23 | @ScaffoldTest(appName = "demo-test", profile = "test") 24 | @Slf4j 25 | public class DemoTest extends ScaffoldBaseTest { 26 | 27 | @Test 28 | public void test01() { 29 | log.info("1111111111"); 30 | log.error("1111111111"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/SpringBootTestApplication.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | *8 | * 启动器 9 | *
10 | * 11 | * @package: com.xkcoding.springboottest 12 | * @description: 启动器 13 | * @author: yangkai.shen 14 | * @date: Created in 2018-12-03 10:32 15 | * @copyright: Copyright (c) 2018 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | @SpringBootApplication(exclude = {org.activiti.spring.boot.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}) 20 | public class SpringBootTestApplication { 21 | 22 | public static void main(String[] args) { 23 | SpringApplication.run(SpringBootTestApplication.class, args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.13 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&d.$apply())})();k=!0;d.$watch(function(){var a,e,d;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)(e=c[a],f.isString(e))?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(m(e[a])?delete c[a]:c[a]=e[a])}); 7 | return c}]).factory("$cookieStore",["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular); 8 | //# sourceMappingURL=angular-cookies.min.js.map -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/popups/select-shape.html: -------------------------------------------------------------------------------- 1 |9 | * 自定义PipeLine 10 | *
11 | * 12 | * @package: com.xkcoding.test.test6 13 | * @description: 自定义PipeLine 14 | * @author: yangkai.shen 15 | * @date: Created in 2018-12-09 23:35 16 | * @copyright: Copyright (c) 2018 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | public class MyPipeline implements Pipeline { 21 | /** 22 | * Process extracted results. 23 | * 24 | * @param resultItems resultItems 25 | * @param task task 26 | */ 27 | @Override 28 | public void process(ResultItems resultItems, Task task) { 29 | String title = resultItems.get("title"); 30 | System.out.println("title = " + title); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/entity/hutool/excel/ExcelModel.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.entity.hutool.excel; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import lombok.experimental.Accessors; 8 | 9 | import java.util.Date; 10 | 11 | /** 12 | *13 | * 测试Hutool的ExcelUtil 14 | *
15 | * 16 | * @package: com.xkcoding.springboottest.entity.hutool.excel 17 | * @description: 测试Hutool的ExcelUtil 18 | * @author: yangkai.shen 19 | * @date: Created in 2018-12-03 16:14 20 | * @copyright: Copyright (c) 2018 21 | * @version: V1.0 22 | * @modified: yangkai.shen 23 | */ 24 | @Data 25 | @NoArgsConstructor 26 | @AllArgsConstructor 27 | @Builder 28 | @Accessors(chain = true) 29 | public class ExcelModel { 30 | private String id; 31 | private String name; 32 | private Date birthday; 33 | private Integer age; 34 | } 35 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/configuration/properties/text-popup.html: -------------------------------------------------------------------------------- 1 |7 | * 测试 JDK 8 函数式接口:{@link Predicate} 8 | *
9 | * 10 | * @author yangkai.shen 11 | * @date Created in 2019-07-29 16:08 12 | */ 13 | public class Test34 { 14 | private static boolean checkNumber(Integer number, Predicate10 | * 测试 Guava Lists.partition 11 | *
12 | * 13 | * @author yangkai.shen 14 | * @date Created in 2019/11/26 16:21 15 | */ 16 | public class Test39 { 17 | private static final Integer TOTAL_NUMBER = 2000; 18 | 19 | private static final Integer PART_NUM = 156; 20 | 21 | public static void main(String[] args) { 22 | List8 | * 测试 emoji 9 | * 文档:https://github.com/vdurmont/emoji-java/blob/master/EMOJIS.md 10 | *
11 | * 12 | * @author yangkai.shen 13 | * @date Created in 2020/3/3 18:54 14 | */ 15 | public class Test47 { 16 | public static void main(String[] args) { 17 | String str = "An :grinning:awesome :smiley:string 😄with a few :wink:emojis!"; 18 | String result = EmojiParser.parseToUnicode(str); 19 | System.out.println(result); 20 | 21 | str = "An 😀awesome 😃string with a few 😉emojis!"; 22 | result = EmojiParser.parseToAliases(str); 23 | System.out.println(result); 24 | 25 | result = EmojiParser.parseToHtmlDecimal(str); 26 | System.out.println(result); 27 | 28 | System.out.println(str + " 是否包含 emoji : " + EmojiManager.containsEmoji(str)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/configuration/properties/feedback-popup.html: -------------------------------------------------------------------------------- 1 |5 | * 测试 stopwatch 6 | *
7 | * 8 | * @author yangkai.shen 9 | * @date Created in 2020/2/13 10:51 10 | */ 11 | public class Test45 { 12 | public static void main(String[] args) { 13 | Stopwatchs.start("task 1"); 14 | try { 15 | Stopwatchs.start("task 1.1"); 16 | Thread.sleep(2000); 17 | Stopwatchs.end(); 18 | 19 | Stopwatchs.start("task 1.2"); 20 | Thread.sleep(2000); 21 | Stopwatchs.end(); 22 | } catch (Exception e) { 23 | e.printStackTrace(); 24 | } finally { 25 | Stopwatchs.end(); 26 | } 27 | 28 | System.out.println(Stopwatchs.getTimingStat()); 29 | final long elapsed = Stopwatchs.getElapsed("task 1"); 30 | System.out.println(elapsed); 31 | 32 | Stopwatchs.release(); 33 | System.out.println(Stopwatchs.getTimingStat()); 34 | 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test31/Test31.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test31; 2 | 3 | import com.github.javaparser.StaticJavaParser; 4 | import com.github.javaparser.ast.CompilationUnit; 5 | import com.github.javaparser.ast.Node; 6 | import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; 7 | 8 | import java.util.Optional; 9 | 10 | /** 11 | *12 | * 测试 java parser 获取注释 13 | *
14 | * 15 | * @package: com.xkcoding.test.test31 16 | * @description: 测试 java parser 获取注释 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-07-11 09:18 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class Test31 { 24 | public static void main(String[] args) { 25 | CompilationUnit compilationUnit = StaticJavaParser.parse("/** 测试注释 */ class A { }"); 26 | Optional12 | * 测试Hutool的JsonArray对象转List 13 | *
14 | * 15 | * @package: com.xkcoding.test.test11 16 | * @description: 测试Hutool的JsonArray对象转List 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-01-10 17:37 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class Test11 { 24 | public static void main(String[] args) { 25 | String jsonArr = "[{\"id\":111,\"name\":\"test1\"},{\"id\":112,\"name\":\"test2\"}]"; 26 | List14 | * 测试iexcel 15 | *
16 | * 17 | * @package: com.xkcoding.springboottest.entity.iexcel 18 | * @description: 测试iexcel 19 | * @author: yangkai.shen 20 | * @date: Created in 2018-12-03 16:14 21 | * @copyright: Copyright (c) 2018 22 | * @version: V1.0 23 | * @modified: yangkai.shen 24 | */ 25 | @Data 26 | @NoArgsConstructor 27 | @AllArgsConstructor 28 | @Builder 29 | @Accessors(chain = true) 30 | public class ExcelModel { 31 | @ExcelField(headName = "序号") 32 | private String id; 33 | @ExcelField(headName = "姓名") 34 | private String name; 35 | @ExcelField(headName = "生日") 36 | private Date birthday; 37 | @ExcelField(headName = "年龄") 38 | private Integer age; 39 | } 40 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test19/Test19.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test19; 2 | 3 | import com.google.common.collect.Lists; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *11 | * 列表字段乘积求和 12 | *
13 | * 14 | * @package: com.xkcoding.test.test19 15 | * @description: 列表字段乘积求和 16 | * @author: yangkai.shen 17 | * @date: Created in 2019-03-13 10:58 18 | * @copyright: Copyright (c) 2019 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | public class Test19 { 23 | public static void main(String[] args) { 24 | List10 | * 测试 hutool 的 SoapClient 11 | *
12 | * 13 | * @package: com.xkcoding.test.test21 14 | * @description: 测试 hutool 的 SoapClient 15 | * @author: yangkai.shen 16 | * @date: Created in 2019-04-09 13:54 17 | * @copyright: Copyright (c) 2019 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | public class Test21 { 22 | public static void main(String[] args) { 23 | SoapClient soapClient = SoapClient.create("http://192.168.40.32:8083/ivrzzyy/webservice/soap"); 24 | soapClient.setMethod(new QName("http://webservice.IVRZzyy.mchz.com/","queryData","web")); 25 | soapClient.setParam("arg0", "12#6123904#",false).setCharset(Charsets.UTF_8); 26 | String msgStr = soapClient.getMsgStr(true); 27 | System.out.println(msgStr); 28 | String send = soapClient.send(true); 29 | System.out.println(send); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test7/Test7.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test7; 2 | 3 | import us.codecraft.webmagic.Spider; 4 | import us.codecraft.webmagic.downloader.PhantomJSDownloader; 5 | import us.codecraft.webmagic.scheduler.BloomFilterDuplicateRemover; 6 | import us.codecraft.webmagic.scheduler.QueueScheduler; 7 | 8 | /** 9 | *10 | * 测试 https://xclient.info 11 | *
12 | * 13 | * @package: com.xkcoding.test.test7 14 | * @description: 测试 https://xclient.info 15 | * @author: yangkai.shen 16 | * @date: Created in 2018-12-10 09:13 17 | * @copyright: Copyright (c) 2018 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | public class Test7 { 22 | public static void main(String[] args) { 23 | Spider.create(new XclientProcessor()) 24 | .addUrl("https://xclient.info/s/istatistica.html") 25 | .setScheduler(new QueueScheduler().setDuplicateRemover(new BloomFilterDuplicateRemover(10000000))) 26 | .setDownloader(new PhantomJSDownloader("/usr/local/bin/phantomjs", "/Users/yangkai.shen/Desktop/crawl.js")) 27 | .run(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test5/Test5.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test5; 2 | 3 | import cn.hutool.db.ds.simple.SimpleDataSource; 4 | import cn.hutool.db.meta.MetaUtil; 5 | import cn.hutool.db.meta.Table; 6 | import cn.hutool.json.JSONUtil; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *12 | * 测试Hutool的MetaUtil 13 | *
14 | * 15 | * @package: com.xkcoding.test.test5 16 | * @description: 测试Hutool的MetaUtil 17 | * @author: yangkai.shen 18 | * @date: Created in 2018-12-04 14:46 19 | * @copyright: Copyright (c) 2018 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class Test5 { 24 | public static void main(String[] args) { 25 | SimpleDataSource dataSource = new SimpleDataSource("jdbc:mysql://127.0.0.1:3306/spring-boot-demo?useInformationSchema=true", "root", "root"); 26 | List14 | * 测试EasyPOI 15 | *
16 | * 17 | * @package: com.xkcoding.springboottest.entity.easypoi 18 | * @description: 测试EasyPOI 19 | * @author: yangkai.shen 20 | * @date: Created in 2018-12-03 16:14 21 | * @copyright: Copyright (c) 2018 22 | * @version: V1.0 23 | * @modified: yangkai.shen 24 | */ 25 | @Data 26 | @NoArgsConstructor 27 | @AllArgsConstructor 28 | @Builder 29 | @Accessors(chain = true) 30 | public class ExcelModel { 31 | @Excel(name = "序号", width = 25) 32 | private String id; 33 | @Excel(name = "姓名", orderNum = "1") 34 | private String name; 35 | @Excel(name = "生日", orderNum = "2", format = "yyyy-MM-dd HH:mm:ss") 36 | private Date birthday; 37 | @Excel(name = "年龄", orderNum = "3") 38 | private Integer age; 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/partials/stencil-item-template.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | {{group.name}} 5 | 6 | 7 | 8 |8 | * 模拟neo4j数据库 9 | *
10 | * 11 | * @package: com.xkcoding.test.test1 12 | * @description: 模拟neo4j数据库 13 | * @author: yangkai.shen 14 | * @date: Created in 2018/11/12 17:58 15 | * @copyright: Copyright (c) 2018 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | public class Neo { 20 | /** 21 | * 模拟neo4j保存数据库 22 | */ 23 | public static final ConcurrentMap11 | * 异步任务线程管理 12 | *
13 | * 14 | * @package: com.xkcoding.test.test1 15 | * @description: 异步任务线程管理 16 | * @author: yangkai.shen 17 | * @date: Created in 2018/10/23 22:10 18 | * @copyright: Copyright (c) 2018 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | public class ThreadTaskManager { 23 | 24 | private final static ThreadTaskManager INSTANCE = new ThreadTaskManager(); 25 | private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(20, new BasicThreadFactory.Builder().namingPattern("Async-Thread-%d") 26 | .build()); 27 | 28 | private ThreadTaskManager() { 29 | } 30 | 31 | public static ThreadTaskManager me() { 32 | return INSTANCE; 33 | } 34 | 35 | public void executeTask(TimerTask task) { 36 | executor.schedule(task, 2000, TimeUnit.MILLISECONDS); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test6/Test6.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test6; 2 | 3 | import us.codecraft.webmagic.Spider; 4 | import us.codecraft.webmagic.pipeline.ConsolePipeline; 5 | import us.codecraft.webmagic.pipeline.FilePipeline; 6 | import us.codecraft.webmagic.pipeline.JsonFilePipeline; 7 | 8 | /** 9 | *10 | * 测试webmagic爬取https://blog.csdn.net/ 11 | *
12 | * 13 | * @package: com.xkcoding.test.test6 14 | * @description: 测试webmagic爬取https://blog.csdn.net/ 15 | * @author: yangkai.shen 16 | * @date: Created in 2018-12-09 23:14 17 | * @copyright: Copyright (c) 2018 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | public class Test6 { 22 | public static void main(String[] args) { 23 | Spider.create(new CsdnProcessor()) 24 | .addUrl("https://blog.csdn.net/") 25 | .addPipeline(new ConsolePipeline()) 26 | .addPipeline(new MyPipeline()) 27 | .addPipeline(new FilePipeline("/Users/yangkai.shen/Desktop/webmagic/file")) 28 | .addPipeline(new JsonFilePipeline("/Users/yangkai.shen/Desktop/webmagic/json")) 29 | .thread(5) 30 | .run(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test18/Test18.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test18; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | /** 7 | *8 | * 编写一个多线程程序,打印当前线程名,每隔300毫秒输出一次,总共输出10次 9 | *
10 | * 11 | * @package: com.xkcoding.test.test18 12 | * @description: 编写一个多线程程序,打印当前线程名,每隔300毫秒输出一次,总共输出10次 13 | * @author: yangkai.shen 14 | * @date: Created in 2019-03-07 14:21 15 | * @copyright: Copyright (c) 2019 16 | * @version: V1.0 17 | * @modified: yangkai.shen 18 | */ 19 | @Data 20 | @AllArgsConstructor 21 | public class Test18 implements Runnable { 22 | 23 | public static void main(String[] args) { 24 | Test18 test18 = new Test18(10, 300); 25 | test18.run(); 26 | } 27 | 28 | private Integer count; 29 | private Integer sleep; 30 | 31 | @Override 32 | public void run() { 33 | int start = 0; 34 | do { 35 | System.out.println(Thread.currentThread().getName()); 36 | start++; 37 | try { 38 | Thread.sleep(sleep); 39 | } catch (InterruptedException e) { 40 | // ignore 41 | } 42 | } while (start < count); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test20/Test20.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test20; 2 | 3 | import cn.hutool.json.JSONArray; 4 | import cn.hutool.json.JSONUtil; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *11 | * 测试 [[1,2,3],[4,5,6]] 字符串转json 12 | *
13 | * 14 | * @package: com.xkcoding.test.test20 15 | * @description: 测试 [[1,2,3],[4,5,6]] 字符串转json 16 | * @author: yangkai.shen 17 | * @date: Created in 2019-03-19 13:39 18 | * @copyright: Copyright (c) 2019 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | public class Test20 { 23 | public static void main(String[] args) { 24 | String json = "[[1,2,3],[4,5,6]]"; 25 | boolean isJsonArray = JSONUtil.isJsonArray(json); 26 | Arr arr = new Arr(); 27 | if (isJsonArray) { 28 | JSONArray jsonArray = new JSONArray(json); 29 | List12 | * 测试EasyExcel 13 | *
14 | * 15 | * @package: com.xkcoding.springboottest.entity.easyexcel 16 | * @description: 测试EasyExcel 17 | * @author: yangkai.shen 18 | * @date: Created in 2018-12-03 16:14 19 | * @copyright: Copyright (c) 2018 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | @EqualsAndHashCode(callSuper = true) 24 | @Data 25 | @NoArgsConstructor 26 | @AllArgsConstructor 27 | @Builder 28 | @Accessors(chain = true) 29 | public class ExcelModel extends BaseRowModel { 30 | @ExcelProperty(value = "序号", index = 0) 31 | private String id; 32 | @ExcelProperty(value = "姓名", index = 1) 33 | private String name; 34 | @ExcelProperty(value = "生日", index = 2, format = "yyyy-MM-dd HH:mm:ss") 35 | private Date birthday; 36 | @ExcelProperty(value = "年龄", index = 3) 37 | private Integer age; 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/json3_3.2.6/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Kit Cambridge. 2 | http://kitcambridge.be/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/es5-shim-15.3.4.5/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2009, 2010 Kristopher Michael Kowal. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.config; 2 | 3 | import com.xkcoding.springboottest.config.convert.factory.IntegerCodeToEnumConverterFactory; 4 | import com.xkcoding.springboottest.config.convert.factory.StringCodeToEnumConverterFactory; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.format.FormatterRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | *11 | * MVC通用配置 12 | *
13 | * 14 | * @package: com.xkcoding.springboottest.config 15 | * @description: MVC通用配置 16 | * @author: yangkai.shen 17 | * @date: Created in 2019-01-30 11:33 18 | * @copyright: Copyright (c) 2019 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | @Configuration 23 | public class WebMvcConfig implements WebMvcConfigurer { 24 | 25 | /** 26 | * 枚举类的转换器工厂 addConverterFactory 27 | */ 28 | @Override 29 | public void addFormatters(FormatterRegistry registry) { 30 | registry.addConverterFactory(new IntegerCodeToEnumConverterFactory()); 31 | registry.addConverterFactory(new StringCodeToEnumConverterFactory()); 32 | } 33 | } -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/controller/enum_test/EnumTestController.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.controller.enum_test; 2 | 3 | import cn.hutool.core.lang.Dict; 4 | import cn.hutool.json.JSONUtil; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | /** 9 | *10 | * 测试参数是枚举类型,自动转换 11 | *
12 | * 13 | * @package: com.xkcoding.springboottest.controller.enum_test 14 | * @description: 测试参数是枚举类型,自动转换 15 | * @author: yangkai.shen 16 | * @date: Created in 2019-01-30 13:56 17 | * @copyright: Copyright (c) 2019 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | @Slf4j 22 | @RestController 23 | @RequestMapping("/enum") 24 | public class EnumTestController { 25 | 26 | @GetMapping("/get") 27 | public Dict testGet(QueryRequest request) { 28 | log.info("【get-request】= {}", JSONUtil.toJsonStr(request)); 29 | return Dict.create().set("get-request", request); 30 | } 31 | 32 | @PostMapping("/post") 33 | public Dict testPost(@RequestBody QueryRequest request) { 34 | log.info("【post-request】= {}", JSONUtil.toJsonStr(request)); 35 | return Dict.create().set("post-request", request); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test33/Test33.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test33; 2 | 3 | import java.util.Date; 4 | import java.util.concurrent.atomic.AtomicReference; 5 | import java.util.function.Consumer; 6 | 7 | /** 8 | *9 | * 测试 JDK 8 函数式接口:{@link Consumer} 10 | *
11 | * 12 | * @author yangkai.shen 13 | * @date Created in 2019-07-29 15:58 14 | */ 15 | public class Test33 { 16 | public static void main(String[] args) { 17 | // Consumer 方法泛型 是传入参数类型 18 | // Consumer 方法原生写法 19 | Consumer11 | * EventBus测试 12 | *
13 | * 14 | * @package: com.xkcoding.springboottest.controller.event 15 | * @description: EventBus测试 16 | * @author: yangkai.shen 17 | * @date: Created in 2018-12-03 10:28 18 | * @copyright: Copyright (c) 2018 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | @RestController 23 | @RequestMapping("/eventbus") 24 | public class EventBusController { 25 | private final EventBusService eventBusService; 26 | 27 | @Autowired 28 | public EventBusController(EventBusService eventBusService) { 29 | this.eventBusService = eventBusService; 30 | } 31 | 32 | @GetMapping("/send") 33 | public String sendMessage() { 34 | // 模拟触发消息 35 | eventBusService.postEvent(); 36 | return "ok"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/editor-config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 'use strict'; 20 | 21 | var KISBPM = KISBPM || {}; 22 | 23 | KISBPM.CONFIG = { 24 | 'showRemovedProperties': false 25 | }; 26 | 27 | KISBPM.HEADER_CONFIG = { 28 | 'showAppTitle': true, 29 | 'showHeaderMenu': true, 30 | 'showMainNavigation': true, 31 | 'showPageHeader': true 32 | }; -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test7/XclientProcessor.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test7; 2 | 3 | import us.codecraft.webmagic.Page; 4 | import us.codecraft.webmagic.Site; 5 | import us.codecraft.webmagic.processor.PageProcessor; 6 | 7 | /** 8 | *9 | * 解析 https://xclient.info 10 | *
11 | * 12 | * @package: com.xkcoding.test.test7 13 | * @description: 解析 https://xclient.info 14 | * @author: yangkai.shen 15 | * @date: Created in 2018-12-10 09:14 16 | * @copyright: Copyright (c) 2018 17 | * @version: V1.0 18 | * @modified: yangkai.shen 19 | */ 20 | public class XclientProcessor implements PageProcessor { 21 | /** 22 | * process the page, extract urls to fetch, extract the data and store 23 | * 24 | * @param page page 25 | */ 26 | @Override 27 | public void process(Page page) { 28 | System.out.println(page.getHtml().xpath("//*[@id=\"body\"]/div[1]/div[2]/a").links().all()); 29 | page.addTargetRequests(page.getHtml().xpath("//*[@id=\"versions\"]/table").links().all()); 30 | } 31 | 32 | /** 33 | * get the site settings 34 | * 35 | * @return site 36 | * @see Site 37 | */ 38 | @Override 39 | public Site getSite() { 40 | return Site.me().setRetryTimes(3).setSleepTime(1000); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * angular-translate - v2.4.2 - 2014-10-21 3 | * http://github.com/angular-translate/angular-translate 4 | * Copyright (c) 2014 ; Licensed MIT 5 | */ 6 | angular.module('pascalprecht.translate').factory('$translateStaticFilesLoader', [ 7 | '$q', 8 | '$http', 9 | function ($q, $http) { 10 | return function (options) { 11 | if (!options || (!angular.isString(options.prefix) || !angular.isString(options.suffix))) { 12 | throw new Error('Couldn\'t load static files, no prefix or suffix specified!'); 13 | } 14 | var deferred = $q.defer(); 15 | $http(angular.extend({ 16 | url: [ 17 | options.prefix, 18 | options.key, 19 | options.suffix 20 | ].join(''), 21 | method: 'GET', 22 | params: '' 23 | }, options.$http)).success(function (data) { 24 | deferred.resolve(data); 25 | }).error(function (data) { 26 | deferred.reject(options.key); 27 | }); 28 | return deferred.promise; 29 | }; 30 | } 31 | ]); -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/config/convert/IntegerToEnumConverter.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.config.convert; 2 | 3 | import cn.hutool.core.util.ObjectUtil; 4 | import com.google.common.collect.Maps; 5 | import com.xkcoding.springboottest.constants.BaseEnum; 6 | import org.springframework.core.convert.converter.Converter; 7 | 8 | import java.util.Map; 9 | 10 | /** 11 | *12 | * 枚举编码 -> 枚举 转化器 13 | *
14 | * 15 | * @package: com.xkcoding.springboottest.config.convert 16 | * @description: 枚举编码 -> 枚举 转化器 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-01-30 11:21 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class IntegerToEnumConverter12 | * 枚举编码 -> 枚举 转化器 13 | *
14 | * 15 | * @package: com.xkcoding.springboottest.config.convert 16 | * @description: 枚举编码 -> 枚举 转化器 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-01-30 11:21 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class StringToEnumConverter10 | * 测试hutool JsonArray JsonObj 11 | *
12 | * 13 | * @package: com.xkcoding.test.test28 14 | * @description: 测试hutool JsonArray JsonObj 15 | * @author: yangkai.shen 16 | * @date: Created in 2019-06-19 16:08 17 | * @copyright: Copyright (c) 2019 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | public class Test28 { 22 | public static void main(String[] args) { 23 | String data = "[{\"YEAR_CNAME\":\"test2\",\"ACTIVE_FLAG\":\"2\",\"INSERT_TIME\":\"2019-05-27T15:16:37\",\"UPDATE_TIME\":\"2019-05-27T15:16:37\",\"YEAR_CODE\":64},{\"YEAR_CNAME\":\"test2\",\"ACTIVE_FLAG\":\"2\",\"INSERT_TIME\":\"2019-05-27T15:16:37\",\"UPDATE_TIME\":\"2019-05-27T15:16:37\",\"YEAR_CODE\":64}]"; 24 | 25 | if (JSONUtil.isJsonArray(data)) { 26 | 27 | JSONArray jsonArray = JSONUtil.parseArray(data); 28 | 29 | for (Object jsonObj : jsonArray) { 30 | JSONArray singleDataArr = JSONUtil.parseArray(Collections.singletonList(jsonObj)); 31 | System.out.println("JSONUtil.toJsonStr(singleDataArr) = " + JSONUtil.toJsonStr(singleDataArr)); 32 | } 33 | 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/es5-shim-15.3.4.5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es5-shim", 3 | "version": "2.1.0", 4 | "description": "ES5 as implementable on previous engines", 5 | "homepage": "http://github.com/kriskowal/es5-shim/", 6 | "contributors": [ 7 | "Kris Kowal12 | * 编码 -> 性别 转换器 13 | *
14 | * 15 | * @package: com.xkcoding.springboottest.config.convert 16 | * @description: 编码 -> 性别 转换器 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-01-30 11:14 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class IntegerCodeToGenderEnumConverter implements Converter12 | * 编码 -> 性别 转换器 13 | *
14 | * 15 | * @package: com.xkcoding.springboottest.config.convert 16 | * @description: 编码 -> 性别 转换器 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-01-30 11:14 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class StringCodeToGenderEnumConverter implements Converter16 | * EventBus 配置 17 | *
18 | * 19 | * @package: com.xkcoding.springboottest.config.event 20 | * @description: EventBus 配置 21 | * @author: yangkai.shen 22 | * @date: Created in 2018-12-03 09:15 23 | * @copyright: Copyright (c) 2018 24 | * @version: V1.0 25 | * @modified: yangkai.shen 26 | */ 27 | @Configuration 28 | public class EventBusConfig { 29 | 30 | @Bean 31 | public EventBus executorService() { 32 | BlockingDeque7 | * 內存相关信息 8 | *
9 | * 10 | * @package: com.xkcoding.test.test8.server 11 | * @description: 內存相关信息 12 | * @author: yangkai.shen 13 | * @date: Created in 2018-12-13 17:03 14 | * @copyright: Copyright (c) 2018 15 | * @version: V1.0 16 | * @modified: yangkai.shen 17 | */ 18 | public class Mem { 19 | /** 20 | * 内存总量 21 | */ 22 | private double total; 23 | 24 | /** 25 | * 已用内存 26 | */ 27 | private double used; 28 | 29 | /** 30 | * 剩余内存 31 | */ 32 | private double free; 33 | 34 | public double getTotal() { 35 | return NumberUtil.div(total, (1024 * 1024 * 1024), 2); 36 | } 37 | 38 | public void setTotal(long total) { 39 | this.total = total; 40 | } 41 | 42 | public double getUsed() { 43 | return NumberUtil.div(used, (1024 * 1024 * 1024), 2); 44 | } 45 | 46 | public void setUsed(long used) { 47 | this.used = used; 48 | } 49 | 50 | public double getFree() { 51 | return NumberUtil.div(free, (1024 * 1024 * 1024), 2); 52 | } 53 | 54 | public void setFree(long free) { 55 | this.free = free; 56 | } 57 | 58 | public double getUsage() { 59 | return NumberUtil.mul(NumberUtil.div(used, total, 4), 100); 60 | } 61 | } -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/libs/es5-shim-15.3.4.5/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | 2 | - kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License 3 | - tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal 4 | Project) 5 | - dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA 6 | - fschaefer Florian Schäfer Copyright (C) 2010 MIT License 7 | - Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License 8 | - kitcambridge Kit Cambridge Copyright (C) 2011 MIT License 9 | - kossnocorp Sasha Koss XXX TODO License or CLA 10 | - bryanforbes Bryan Forbes XXX TODO License or CLA 11 | - killdream Quildreen Motta Copyright (C) 2011 MIT Licence 12 | - michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD 13 | License 14 | - sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License 15 | - bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain) 16 | - iwyg XXX TODO License or CLA 17 | - DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License 18 | - xavierm02 Montillet Xavier Copyright (C) 2011 MIT License 19 | - Raynos Jake Verbaten Copyright (C) 2011 MIT Licence 20 | - samsonjs Sami Samhuri Copyright (C) 2010 MIT License 21 | - rwldrn Rick Waldron Copyright (C) 2011 MIT License 22 | - lexer Alexey Zakharov XXX TODO License or CLA 23 | - 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.) 24 | Copyright (C) 2009 MIT License 25 | - Steven Levithan Copyright (C) 2012 MIT License 26 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/resources/static/editor-app/configuration/url-config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Activiti Modeler component part of the Activiti project 3 | * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | var KISBPM = KISBPM || {}; 20 | 21 | KISBPM.URL = { 22 | 23 | getModel: function (modelId) { 24 | return ACTIVITI.CONFIG.contextRoot + '/model/' + modelId + '/json'; 25 | }, 26 | 27 | getStencilSet: function () { 28 | return ACTIVITI.CONFIG.contextRoot + '/editor/stencilset?version=' + Date.now(); 29 | }, 30 | 31 | putModel: function (modelId) { 32 | return ACTIVITI.CONFIG.contextRoot + '/model/' + modelId + '/save'; 33 | } 34 | }; -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test49/Test49.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test49; 2 | 3 | import cn.hutool.core.io.FileUtil; 4 | import cn.hutool.core.util.ArrayUtil; 5 | import cn.hutool.core.util.StrUtil; 6 | 7 | import java.io.File; 8 | 9 | /** 10 | *11 | * 测试文件迁移 12 | *
13 | * 14 | * @author 一珩(沈扬凯 yk.shen@tuya.com) 15 | * @date 2021-01-18 15:19 16 | */ 17 | public class Test49 { 18 | public static void main(String[] args) { 19 | String src = "/Users/yangkai.shen/Codes/xkcoding/spring-boot-demo"; 20 | String desc = "/Users/yangkai.shen/Codes/xkcoding/wiki/docs/spring-boot-demo"; 21 | 22 | File file = FileUtil.file(src); 23 | File[] allFiles = file.listFiles(); 24 | if (ArrayUtil.isEmpty(allFiles)) { 25 | System.out.println("no sub file"); 26 | return; 27 | } 28 | for (File subFile : allFiles) { 29 | if (FileUtil.isDirectory(subFile)) { 30 | String newFileName = subFile.getName() + ".md"; 31 | String readmePath = FileUtil.listFileNames(subFile.getAbsolutePath()).stream().filter("README.md"::equals).findFirst() 32 | .map(x -> StrUtil.concat(true, subFile.getAbsolutePath(), StrUtil.SLASH, x)).orElse(StrUtil.EMPTY); 33 | if (StrUtil.isNotBlank(readmePath)) { 34 | FileUtil.copy(readmePath, desc + StrUtil.SLASH + newFileName, false); 35 | } 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-test/src/main/java/com/xkcoding/springboottest/service/event/EventBusService.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.springboottest.service.event; 2 | 3 | import com.google.common.eventbus.EventBus; 4 | import com.xkcoding.springboottest.config.event.EventListener; 5 | import com.xkcoding.springboottest.entity.event.TestEvent; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.beans.factory.InitializingBean; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | /** 12 | *13 | * EventBus测试 14 | *
15 | * 16 | * @package: com.xkcoding.springboottest.service.event 17 | * @description: EventBus测试 18 | * @author: yangkai.shen 19 | * @date: Created in 2018-12-03 10:18 20 | * @copyright: Copyright (c) 2018 21 | * @version: V1.0 22 | * @modified: yangkai.shen 23 | */ 24 | @Service 25 | @Slf4j 26 | public class EventBusService implements InitializingBean { 27 | private final EventBus eventBus; 28 | 29 | private final EventListener eventListener; 30 | 31 | @Autowired 32 | public EventBusService(EventBus eventBus, EventListener eventListener) { 33 | this.eventBus = eventBus; 34 | this.eventListener = eventListener; 35 | } 36 | 37 | public void postEvent() { 38 | eventBus.post(new TestEvent(1L)); 39 | log.info("event emit...."); 40 | } 41 | 42 | @Override 43 | public void afterPropertiesSet() { 44 | eventBus.register(eventListener); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /scaffold-demo-test/src/main/java/com/xkcoding/demo/service/CustomLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.demo.service; 2 | 3 | import com.xkcoding.scaffold.common.api.R; 4 | import com.xkcoding.scaffold.log.model.LogApi; 5 | import com.xkcoding.scaffold.log.model.LogCustom; 6 | import com.xkcoding.scaffold.log.model.LogError; 7 | import com.xkcoding.scaffold.log.service.impl.DefaultScaffoldLogServiceImpl; 8 | 9 | /** 10 | *11 | * 日志实现 12 | *
13 | * 14 | * @package: com.xkcoding.demo.service 15 | * @description: 日志实现 16 | * @author: yangkai.shen 17 | * @date: Created in 2019-03-13 14:07 18 | * @copyright: Copyright (c) 2019 19 | * @version: V1.0 20 | * @modified: yangkai.shen 21 | */ 22 | public class CustomLogServiceImpl extends DefaultScaffoldLogServiceImpl { 23 | /** 24 | * 保存操作日志 25 | * 26 | * @param logApi 操作日志实体 27 | * @return 是否保存成功 28 | */ 29 | @Override 30 | public R13 | * 编码 -> 枚举 转化器工厂类 14 | *
15 | * 16 | * @package: com.xkcoding.springboottest.config.convert.factory 17 | * @description: 编码 -> 枚举 转化器工厂类 18 | * @author: yangkai.shen 19 | * @date: Created in 2019-01-30 11:09 20 | * @copyright: Copyright (c) 2019 21 | * @version: V1.0 22 | * @modified: yangkai.shen 23 | */ 24 | public class StringCodeToEnumConverterFactory implements ConverterFactory13 | * 编码 -> 枚举 转化器工厂类 14 | *
15 | * 16 | * @package: com.xkcoding.springboottest.config.convert.factory 17 | * @description: 编码 -> 枚举 转化器工厂类 18 | * @author: yangkai.shen 19 | * @date: Created in 2019-01-30 11:09 20 | * @copyright: Copyright (c) 2019 21 | * @version: V1.0 22 | * @modified: yangkai.shen 23 | */ 24 | public class IntegerCodeToEnumConverterFactory implements ConverterFactory11 | * 解析监听器, 12 | * 每解析一行会回调invoke()方法, 13 | * 整个excel解析结束会执行doAfterAllAnalysed()方法 14 | *
15 | * 16 | * @package: com.xkcoding.springboottest.controller.easyexcel 17 | * @description: 解析监听器,每解析一行会回调invoke()方法,整个excel解析结束会执行doAfterAllAnalysed()方法 18 | * @author: yangkai.shen 19 | * @date: Created in 2018-12-04 10:58 20 | * @copyright: Copyright (c) 2018 21 | * @version: V1.0 22 | * @modified: yangkai.shen 23 | */ 24 | @Slf4j 25 | public class ExcelListener extends AnalysisEventListener12 | * 测试 Disruptor 单生产者/单消费者模型 13 | *
14 | * 15 | * @package: com.xkcoding.test.test13 16 | * @description: 测试 Disruptor 17 | * @author: yangkai.shen 18 | * @date: Created in 2019-01-24 16:00 19 | * @copyright: Copyright (c) 2019 20 | * @version: V1.0 21 | * @modified: yangkai.shen 22 | */ 23 | public class Test13 { 24 | 25 | public static void main(String[] args) { 26 | OrderEventFactory eventFactory = new OrderEventFactory(); 27 | int ringBufferSize = 1024 * 1024; 28 | 29 | ThreadFactory threadFactory = r -> { 30 | Thread t = new Thread(r); 31 | t.setName("disruptor-" + t.getId()); 32 | return t; 33 | }; 34 | 35 | Disruptor10 | * 自定义CSDN爬取器 11 | *
12 | * 13 | * @package: com.xkcoding.test.test6 14 | * @description: 自定义CSDN爬取器 15 | * @author: yangkai.shen 16 | * @date: Created in 2018-12-09 23:17 17 | * @copyright: Copyright (c) 2018 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | @Slf4j 22 | public class CsdnProcessor implements PageProcessor { 23 | @Override 24 | public void process(Page page) { 25 | // 打印页面内容 26 | // System.out.println(page.getHtml().toString()); 27 | 28 | // 获取当前页面所有URL 29 | // System.out.println(page.getHtml().links().all()); 30 | 31 | // 根据正则表达式获取当前页指定URL 32 | // System.out.println(page.getHtml().links().regex("https://blog.csdn.net/[a-z 0-9 -]+/article/details/[0-9]{8}").all()); 33 | 34 | // 添加目标地址 35 | page.addTargetRequests(page.getHtml() 36 | .links() 37 | .regex("https://blog.csdn.net/[a-z 0-9 -]+/article/details/[0-9]{8}") 38 | .all()); 39 | // 添加自定义变量到page对象 40 | page.putField("title", page.getHtml() 41 | .xpath("//*[@id=\"mainBox\"]/main/div[1]/div[1]/div/div[1]/h1") 42 | .toString()); 43 | 44 | } 45 | 46 | @Override 47 | public Site getSite() { 48 | return Site.me().setSleepTime(100).setRetryTimes(3); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test13/case1/OrderEventProducer.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test13.case1; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | import cn.hutool.core.util.IdUtil; 5 | import cn.hutool.core.util.RandomUtil; 6 | import com.lmax.disruptor.RingBuffer; 7 | 8 | /** 9 | *10 | * 订单事件生产者 11 | *
12 | * 13 | * @package: com.xkcoding.test.test13 14 | * @description: 订单事件生产者 15 | * @author: yangkai.shen 16 | * @date: Created in 2019-01-29 15:21 17 | * @copyright: Copyright (c) 2019 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | public class OrderEventProducer { 22 | private final RingBuffer14 | * 测试hutool的BeanUtil的copyProperties 15 | *
16 | * 17 | * @package: com.xkcoding.test.test3 18 | * @description: 测试hutool的BeanUtil的copyProperties 19 | * @author: yangkai.shen 20 | * @date: Created in 2018/11/21 11:28 21 | * @copyright: Copyright (c) 2018 22 | * @version: V1.0 23 | * @modified: yangkai.shen 24 | */ 25 | public class Test3 { 26 | public static void main(String[] args) { 27 | Date1 date1 = new Date1(); 28 | date1.setCreateTime(new DateTime()); 29 | System.out.println("date1 = " + date1); 30 | Long1 long1 = new Long1(); 31 | BeanUtil.copyProperties(date1, long1); 32 | System.out.println("long1 = " + long1); 33 | Date2 date2 = new Date2(); 34 | Map10 | * Id 工具类 11 | *
12 | * 13 | * @package: com.xkcoding.test.test1 14 | * @description: Id 工具类 15 | * @author: yangkai.shen 16 | * @date: Created in 2018/11/12 16:23 17 | * @copyright: Copyright (c) 2018 18 | * @version: V1.0 19 | * @modified: yangkai.shen 20 | */ 21 | public class IdUtil { 22 | enum Type { 23 | /** 24 | * DB 25 | */ 26 | DB, 27 | /** 28 | * TABLE 29 | */ 30 | TABLE, 31 | /** 32 | * VIEW 33 | */ 34 | VIEW, 35 | /** 36 | * COLUMN 37 | */ 38 | COLUMN 39 | } 40 | 41 | /** 42 | * 获取id 43 | * 44 | * @param type 类型 45 | * @param obj 对象 46 | * @return id 47 | */ 48 | public static String getId(Type type, Object obj) { 49 | Map14 | * 测试 parallelStream 是否会阻塞主线程 15 | *
16 | * 17 | * @author yangkai.shen 18 | * @date Created in 2019/12/29 16:31 19 | */ 20 | @Slf4j 21 | public class Test43 { 22 | public static void main(String[] args) { 23 | normalTest(); 24 | parallelTest(); 25 | } 26 | 27 | private static void normalTest() { 28 | final ArrayList11 | * 切分 JDBC URL 12 | *
13 | * 14 | * @author yangkai.shen 15 | * @date Created in 2019-08-02 17:13 16 | */ 17 | @Slf4j 18 | public class Test36 { 19 | public static void main(String[] args) { 20 | String jdbcUrl = "jdbc:mysql://192.168.239.4:3306/dmcp-master?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&remarks=true&useInformationSchema=true"; 21 | 22 | String protocol = StrUtil.subBefore(jdbcUrl, StrUtil.COLON + StrUtil.SLASH + StrUtil.SLASH, true); 23 | log.info("【protocol】= {}", protocol); 24 | 25 | String hostAndPort = StrUtil.subBetween(jdbcUrl, StrUtil.COLON + StrUtil.SLASH + StrUtil.SLASH, StrUtil.SLASH); 26 | log.info("【hostAndPort】= {}", hostAndPort); 27 | 28 | String host = StrUtil.subBefore(hostAndPort, StrUtil.COLON, true); 29 | log.info("【host】= {}", host); 30 | 31 | String port = StrUtil.subAfter(hostAndPort, StrUtil.COLON, true); 32 | log.info("【port】= {}", port); 33 | 34 | String dbName = StrUtil.subBetween(jdbcUrl, hostAndPort + StrUtil.SLASH, "?"); 35 | log.info("【dbName】= {}", dbName); 36 | 37 | String paramStr = StrUtil.subAfter(jdbcUrl, "?", true); 38 | Map13 | * 测试 批量修改文件名 14 | *
15 | * 16 | * @package: com.xkcoding.test.test9 17 | * @description: 测试 批量修改文件名 18 | * @author: yangkai.shen 19 | * @date: Created in 2018-12-13 17:22 20 | * @copyright: Copyright (c) 2018 21 | * @version: V1.0 22 | * @modified: yangkai.shen 23 | */ 24 | public class Test9 { 25 | public static void main(String[] args) { 26 | String root = "/Users/yangkai.shen/Movies/微服务项目课件"; 27 | String prefix = "学成在线-"; 28 | 29 | System.out.println("重命名开始"); 30 | File[] ls = FileUtil.ls(root); 31 | List5 | * 系统相关信息 6 | *
7 | * 8 | * @package: com.xkcoding.test.test8.server 9 | * @description: 系统相关信息 10 | * @author: yangkai.shen 11 | * @date: Created in 2018-12-13 17:03 12 | * @copyright: Copyright (c) 2018 13 | * @version: V1.0 14 | * @modified: yangkai.shen 15 | */ 16 | public class Sys { 17 | /** 18 | * 服务器名称 19 | */ 20 | private String computerName; 21 | 22 | /** 23 | * 服务器Ip 24 | */ 25 | private String computerIp; 26 | 27 | /** 28 | * 项目路径 29 | */ 30 | private String userDir; 31 | 32 | /** 33 | * 操作系统 34 | */ 35 | private String osName; 36 | 37 | /** 38 | * 系统架构 39 | */ 40 | private String osArch; 41 | 42 | public String getComputerName() { 43 | return computerName; 44 | } 45 | 46 | public void setComputerName(String computerName) { 47 | this.computerName = computerName; 48 | } 49 | 50 | public String getComputerIp() { 51 | return computerIp; 52 | } 53 | 54 | public void setComputerIp(String computerIp) { 55 | this.computerIp = computerIp; 56 | } 57 | 58 | public String getUserDir() { 59 | return userDir; 60 | } 61 | 62 | public void setUserDir(String userDir) { 63 | this.userDir = userDir; 64 | } 65 | 66 | public String getOsName() { 67 | return osName; 68 | } 69 | 70 | public void setOsName(String osName) { 71 | this.osName = osName; 72 | } 73 | 74 | public String getOsArch() { 75 | return osArch; 76 | } 77 | 78 | public void setOsArch(String osArch) { 79 | this.osArch = osArch; 80 | } 81 | } -------------------------------------------------------------------------------- /common-test/src/main/java/com/xkcoding/test/test29/Test29.java: -------------------------------------------------------------------------------- 1 | package com.xkcoding.test.test29; 2 | 3 | import cn.hutool.core.util.IdUtil; 4 | import cn.hutool.core.util.RandomUtil; 5 | import cn.hutool.poi.excel.ExcelUtil; 6 | import cn.hutool.poi.excel.ExcelWriter; 7 | 8 | import java.util.ArrayList; 9 | import java.util.HashMap; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | /** 14 | *15 | * 测试 Excel 的 VLOOKUP 函数,模拟假数据 16 | *
17 | * 18 | * @package: com.xkcoding.test.test29 19 | * @description: 测试 Excel 的 VLOOKUP 函数,模拟假数据 20 | * @author: yangkai.shen 21 | * @date: Created in 2019-06-25 09:39 22 | * @copyright: Copyright (c) 2019 23 | * @version: V1.0 24 | * @modified: yangkai.shen 25 | */ 26 | public class Test29 { 27 | /** 28 | * IF(VLOOKUP(A2,测试!$A$2:$A$674,1,FALSE)=A2,"存在") 29 | */ 30 | public static void main(String[] args) { 31 | List