├── .babelrc ├── docs ├── .vuepress │ ├── config │ │ └── baiduCode.js │ ├── public │ │ ├── favicon.ico │ │ └── img │ │ │ ├── bg.gif │ │ │ ├── more.png │ │ │ ├── other.png │ │ │ ├── favicon.ico │ │ │ └── dunwu-logo.png │ └── plugins │ │ └── love-me │ │ └── index.js ├── Spring环境配置.docx ├── @pages │ ├── tagsPage.md │ ├── archivesPage.md │ └── categoriesPage.md ├── .markdownlint.json └── 01.Java │ └── 13.框架 │ └── 01.Spring │ └── 01.Spring核心 │ └── 24.SpringEL.md ├── codes ├── core │ ├── ioc │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── META-INF │ │ │ │ ├── user-config.properties │ │ │ │ ├── services │ │ │ │ │ └── example.spring.core.bean.life.UserFactory │ │ │ │ ├── spring-life.xml │ │ │ │ └── bean │ │ │ │ │ ├── BeanLifeCycle.xml │ │ │ │ │ └── BeanAlias.xml │ │ │ └── application.properties │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── core │ │ │ ├── bean │ │ │ ├── java │ │ │ │ ├── Job.java │ │ │ │ ├── Police.java │ │ │ │ └── Teacher.java │ │ │ ├── annotation │ │ │ │ ├── Performer.java │ │ │ │ ├── instrument │ │ │ │ │ ├── Instrument.java │ │ │ │ │ ├── Violin.java │ │ │ │ │ ├── Piano.java │ │ │ │ │ └── Guitar.java │ │ │ │ ├── autowire │ │ │ │ │ ├── Performer.java │ │ │ │ │ ├── instrument │ │ │ │ │ │ ├── Instrument.java │ │ │ │ │ │ ├── Piano.java │ │ │ │ │ │ ├── Guitar.java │ │ │ │ │ │ └── Violin.java │ │ │ │ │ └── Poetry.java │ │ │ │ ├── life │ │ │ │ │ ├── Auditorium.java │ │ │ │ │ └── App.java │ │ │ │ ├── Super.java │ │ │ │ └── factory │ │ │ │ │ ├── BeanFactory.java │ │ │ │ │ └── App.java │ │ │ ├── entity │ │ │ │ ├── job │ │ │ │ │ ├── Instrument.java │ │ │ │ │ ├── Performer.java │ │ │ │ │ ├── Piano.java │ │ │ │ │ ├── Guitar.java │ │ │ │ │ ├── Violin.java │ │ │ │ │ ├── Poetry.java │ │ │ │ │ └── Musician.java │ │ │ │ ├── fruit │ │ │ │ │ ├── Fruit.java │ │ │ │ │ ├── Apple.java │ │ │ │ │ ├── Banana.java │ │ │ │ │ └── Orange.java │ │ │ │ └── person │ │ │ │ │ └── City.java │ │ │ ├── action │ │ │ │ ├── TestA.java │ │ │ │ ├── TestB.java │ │ │ │ ├── TestD.java │ │ │ │ └── TestC.java │ │ │ └── life │ │ │ │ └── UserFactory.java │ │ │ ├── SpringIocApplication.java │ │ │ └── ioc │ │ │ └── Person.java │ ├── resource │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ ├── dev.properties │ │ │ └── prod.properties │ ├── profile │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application-dev.properties │ │ │ ├── application-prod.properties │ │ │ ├── application-test.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── core │ │ │ └── profile │ │ │ └── MessageService.java │ ├── property │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── prop │ │ │ ├── validator.properties │ │ │ ├── custom.properties │ │ │ └── random.properties │ │ │ ├── application.properties │ │ │ └── logback.xml │ ├── async │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ ├── aop │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── core │ │ │ │ └── aop │ │ │ │ └── entity │ │ │ │ ├── Performer.java │ │ │ │ └── Instrumentalist.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ ├── actuator │ │ ├── README.md │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── core │ │ │ │ └── actuator │ │ │ │ └── ActuatorApplication.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ ├── bean │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── core │ │ │ │ └── bean │ │ │ │ ├── InfoDto.java │ │ │ │ ├── UserDto.java │ │ │ │ ├── User.java │ │ │ │ └── Company.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── banner │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── core │ │ │ │ └── banner │ │ │ │ └── BannerApplication.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── validation │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── core │ │ │ └── validation │ │ │ ├── annotation │ │ │ ├── AddCheck.java │ │ │ ├── EditCheck.java │ │ │ ├── Valid.java │ │ │ └── ValidRule.java │ │ │ └── ValidatorRule.java │ ├── data-binding │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── core │ │ │ └── binding │ │ │ └── TestBean.java │ └── conversion │ │ └── src │ │ └── main │ │ └── resources │ │ └── logback.xml ├── web │ ├── multipart │ │ ├── src │ │ │ ├── test │ │ │ │ └── resources │ │ │ │ │ └── testupload.txt │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── logback.xml │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── web │ │ │ │ └── multipart │ │ │ │ ├── StorageException.java │ │ │ │ ├── StorageFileNotFoundException.java │ │ │ │ └── StorageService.java │ │ └── README.md │ ├── view │ │ ├── easyui │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── static │ │ │ │ │ ├── plugin │ │ │ │ │ │ └── themes │ │ │ │ │ │ │ └── default │ │ │ │ │ │ │ └── numberbox.css │ │ │ │ │ └── lib │ │ │ │ │ │ └── easyui │ │ │ │ │ │ └── themes │ │ │ │ │ │ ├── bootstrap │ │ │ │ │ │ ├── numberbox.css │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ ├── blank.gif │ │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ │ ├── combo_arrow.png │ │ │ │ │ │ │ ├── menu_arrows.png │ │ │ │ │ │ │ ├── panel_tools.png │ │ │ │ │ │ │ ├── tabs_icons.png │ │ │ │ │ │ │ ├── tree_icons.png │ │ │ │ │ │ │ ├── datebox_arrow.png │ │ │ │ │ │ │ ├── layout_arrows.png │ │ │ │ │ │ │ ├── linkbutton_bg.png │ │ │ │ │ │ │ ├── slider_handle.png │ │ │ │ │ │ │ ├── tagbox_icons.png │ │ │ │ │ │ │ ├── accordion_arrows.png │ │ │ │ │ │ │ ├── calendar_arrows.png │ │ │ │ │ │ │ ├── datagrid_icons.png │ │ │ │ │ │ │ ├── messager_icons.png │ │ │ │ │ │ │ ├── pagination_icons.png │ │ │ │ │ │ │ ├── passwordbox_open.png │ │ │ │ │ │ │ ├── searchbox_button.png │ │ │ │ │ │ │ ├── spinner_arrows.png │ │ │ │ │ │ │ ├── passwordbox_close.png │ │ │ │ │ │ │ └── validatebox_warning.png │ │ │ │ │ │ ├── passwordbox.css │ │ │ │ │ │ ├── validatebox.css │ │ │ │ │ │ ├── splitbutton.css │ │ │ │ │ │ └── filebox.css │ │ │ │ │ │ └── icons │ │ │ │ │ │ ├── no.png │ │ │ │ │ │ ├── ok.png │ │ │ │ │ │ ├── back.png │ │ │ │ │ │ ├── cut.png │ │ │ │ │ │ ├── help.png │ │ │ │ │ │ ├── lock.png │ │ │ │ │ │ ├── man.png │ │ │ │ │ │ ├── more.png │ │ │ │ │ │ ├── redo.png │ │ │ │ │ │ ├── sum.png │ │ │ │ │ │ ├── tip.png │ │ │ │ │ │ ├── undo.png │ │ │ │ │ │ ├── blank.gif │ │ │ │ │ │ ├── cancel.png │ │ │ │ │ │ ├── clear.png │ │ │ │ │ │ ├── filter.png │ │ │ │ │ │ ├── pencil.png │ │ │ │ │ │ ├── print.png │ │ │ │ │ │ ├── reload.png │ │ │ │ │ │ ├── search.png │ │ │ │ │ │ ├── edit_add.png │ │ │ │ │ │ ├── filesave.png │ │ │ │ │ │ ├── mini_add.png │ │ │ │ │ │ ├── mini_edit.png │ │ │ │ │ │ ├── edit_remove.png │ │ │ │ │ │ ├── large_chart.png │ │ │ │ │ │ ├── large_shapes.png │ │ │ │ │ │ ├── mini_refresh.png │ │ │ │ │ │ ├── large_clipart.png │ │ │ │ │ │ ├── large_picture.png │ │ │ │ │ │ └── large_smartart.png │ │ │ │ └── sql │ │ │ │ │ └── data.sql │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── web │ │ │ │ └── IndexController.java │ │ ├── react │ │ │ ├── frontend │ │ │ │ ├── src │ │ │ │ │ ├── views │ │ │ │ │ │ └── pages │ │ │ │ │ │ │ ├── user │ │ │ │ │ │ │ └── User.less │ │ │ │ │ │ │ └── login │ │ │ │ │ │ │ ├── bg.jpg │ │ │ │ │ │ │ └── login-logo.png │ │ │ │ │ ├── components │ │ │ │ │ │ ├── layout │ │ │ │ │ │ │ ├── Content │ │ │ │ │ │ │ │ └── Content.less │ │ │ │ │ │ │ ├── Breadcrumb │ │ │ │ │ │ │ │ └── Breadcrumb.less │ │ │ │ │ │ │ ├── Footer │ │ │ │ │ │ │ │ └── index.less │ │ │ │ │ │ │ └── Header │ │ │ │ │ │ │ │ └── Header.less │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── webapi │ │ │ │ │ │ ├── mock │ │ │ │ │ │ │ └── user.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── webapi.js │ │ │ │ │ ├── containers │ │ │ │ │ │ ├── Core │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── CoreContainer.less │ │ │ │ │ │ └── Root │ │ │ │ │ │ │ └── RootContainer.jsx │ │ │ │ │ ├── utils │ │ │ │ │ │ └── index.jsx │ │ │ │ │ └── redux │ │ │ │ │ │ ├── constants │ │ │ │ │ │ └── menuActionType.js │ │ │ │ │ │ ├── reducers │ │ │ │ │ │ └── index.js │ │ │ │ │ │ ├── actions │ │ │ │ │ │ └── menu.js │ │ │ │ │ │ └── store │ │ │ │ │ │ └── configureStore.js │ │ │ │ ├── public │ │ │ │ │ └── favicon.ico │ │ │ │ ├── scripts │ │ │ │ │ └── build.sh │ │ │ │ ├── .gitignore │ │ │ │ └── config │ │ │ │ │ └── app.config.js │ │ │ └── backend │ │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── web │ │ │ │ └── WebReactApplication.java │ │ └── bootstrap │ │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── static │ │ │ │ └── favicon.ico │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── MessageRepository.java │ ├── sse │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── sse │ │ │ └── WebSseApplication.java │ ├── basic │ │ ├── helloworld │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── webapp │ │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ │ └── WEB-INF │ │ │ │ └── views │ │ │ │ └── jsp │ │ │ │ ├── index.jsp │ │ │ │ ├── error │ │ │ │ ├── 403.jsp │ │ │ │ └── 404.jsp │ │ │ │ ├── taglibs.jsp │ │ │ │ ├── hello.jsp │ │ │ │ ├── log.jsp │ │ │ │ └── welcome.jsp │ │ └── mvc │ │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ ├── resources │ │ │ │ ├── messages │ │ │ │ │ ├── info.png │ │ │ │ │ ├── error.png │ │ │ │ │ ├── success.png │ │ │ │ │ └── warning.png │ │ │ │ └── jqueryui │ │ │ │ │ └── 1.8 │ │ │ │ │ └── themes │ │ │ │ │ └── base │ │ │ │ │ ├── images │ │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ │ ├── jquery.ui.all.css │ │ │ │ │ └── jquery.ui.base.css │ │ │ └── WEB-INF │ │ │ │ └── views │ │ │ │ ├── views │ │ │ │ ├── html.jsp │ │ │ │ ├── viewName.jsp │ │ │ │ └── dataBinding.jsp │ │ │ │ └── redirect │ │ │ │ └── redirectResults.jsp │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── mvc │ │ │ ├── exceptions │ │ │ ├── BusinessException.java │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── form │ │ │ └── InquiryType.java │ │ │ ├── simple │ │ │ └── SimpleController.java │ │ │ ├── data │ │ │ └── custom │ │ │ │ └── RequestAttribute.java │ │ │ └── convert │ │ │ └── MaskFormat.java │ ├── form │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── welcome.html │ │ │ │ └── results.html │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── form │ │ │ ├── entity │ │ │ └── Greeting.java │ │ │ └── WebFormApplication.java │ ├── helloworld │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ │ └── index.html │ │ │ ├── templates │ │ │ │ └── greeting.html │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── helloworld │ │ │ ├── HelloController.java │ │ │ └── WebHelloWorldApplication.java │ ├── https │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── keystore.p12 │ │ │ ├── application.properties │ │ │ ├── static │ │ │ │ └── index.html │ │ │ ├── templates │ │ │ │ └── greeting.html │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── https │ │ │ └── entity │ │ │ ├── CityInfo.java │ │ │ └── Weather.java │ ├── connections │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── sample.jks │ │ │ ├── application.properties │ │ │ ├── static │ │ │ │ └── index.html │ │ │ ├── templates │ │ │ │ └── greeting.html │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── connections │ │ │ └── entity │ │ │ ├── CityInfo.java │ │ │ └── Weather.java │ ├── websocket │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── web │ │ │ │ └── websocket │ │ │ │ ├── client │ │ │ │ ├── GreetingService.java │ │ │ │ └── SimpleGreetingService.java │ │ │ │ ├── echo │ │ │ │ ├── EchoService.java │ │ │ │ └── DefaultEchoService.java │ │ │ │ └── snake │ │ │ │ └── Direction.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── README.md │ ├── fastjson │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── fastjson │ │ │ ├── SpringBootWebFastjsonApplication.java │ │ │ └── InfoDto.java │ └── client │ │ └── src │ │ └── main │ │ ├── java │ │ └── example │ │ │ └── spring │ │ │ └── web │ │ │ └── client │ │ │ └── entity │ │ │ ├── CityInfo.java │ │ │ └── Weather.java │ │ └── resources │ │ └── logback.xml ├── integration │ ├── distributed │ │ ├── spring-boot-zookeeper │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── spring-boot-dubbo │ │ │ ├── README.md │ │ │ ├── spring-boot-dubbo-autoconfig-consumer │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ ├── spring-boot-dubbo-api │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── dubbo │ │ │ │ └── api │ │ │ │ ├── InfoService.java │ │ │ │ └── InfoDto.java │ │ │ └── spring-boot-dubbo-zookeeper-consumer │ │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ ├── spring-boot-docker │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── docker-entrypoint.sh │ ├── template │ │ ├── spring-boot-tmpl-jsp │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── resources │ │ │ │ │ ├── static │ │ │ │ │ │ └── test.txt │ │ │ │ │ └── application.properties │ │ │ │ │ ├── webapp │ │ │ │ │ └── WEB-INF │ │ │ │ │ │ └── jsp │ │ │ │ │ │ └── error.jsp │ │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── springboot │ │ │ │ │ ├── web │ │ │ │ │ ├── MyException.java │ │ │ │ │ ├── MyRestResponse.java │ │ │ │ │ └── MessageAdvice.java │ │ │ │ │ └── SpringBootWebJspApplication.java │ │ │ └── README.md │ │ ├── spring-boot-tmpl-freemark │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ ├── templates │ │ │ │ ├── sql │ │ │ │ │ ├── sql_clear.ftl │ │ │ │ │ ├── sql_select.ftl │ │ │ │ │ ├── sql_delete.ftl │ │ │ │ │ ├── drop_table.ftl │ │ │ │ │ ├── sql_create.ftl │ │ │ │ │ └── create_table.ftl │ │ │ │ └── web │ │ │ │ │ └── exception.ftl │ │ │ │ └── application.properties │ │ ├── spring-boot-tmpl-thymeleaf │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── templates │ │ │ │ │ └── error.html │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── exception │ │ │ │ └── MyException.java │ │ │ │ └── SpringBootTmplThymeleafApplication.java │ │ └── spring-boot-tmpl-velocity │ │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── velocity.properties │ │ │ ├── layout │ │ │ ├── default.vm │ │ │ ├── layout.vm │ │ │ └── layout2.vm │ │ │ └── templates │ │ │ └── velocity │ │ │ └── default │ │ │ ├── header.vm │ │ │ └── tools.vm │ ├── spring-boot-logging │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application-log4j.properties │ │ │ ├── application-log4j2.properties │ │ │ ├── application-logback.properties │ │ │ └── application.properties │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── logging │ │ │ └── web │ │ │ └── HelloController.java │ ├── spring-boot-mail │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ ├── application-163.properties │ │ │ │ └── application-qq.properties │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── mail │ │ │ │ └── MailApplication.java │ │ │ └── test │ │ │ └── resources │ │ │ ├── moon.png │ │ │ └── icon-man.png │ ├── spring-integration-scheduler │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ └── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── spring │ │ │ └── scheduler │ │ │ └── DemoTask.java │ ├── spring-integration-swagger │ │ ├── swagger-ui.png │ │ └── README.md │ ├── mq │ │ ├── spring-boot-mq-redis │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ ├── spring-boot-mq-rabbitmq │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── RabbitConfiguration.java │ │ ├── spring-boot-mq-activemq │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── spring-boot-mq-kafka │ │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── SpringBootMsgKafkaApplication.java │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── KafkaTestBean.java │ ├── spring-boot-statemachine │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ └── statemachine │ │ │ ├── Events.java │ │ │ └── States.java │ ├── spring-integration-libs │ │ ├── src │ │ │ ├── test │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── spring │ │ │ │ │ └── libs │ │ │ │ │ └── dozer │ │ │ │ │ └── vo │ │ │ │ │ ├── Status.java │ │ │ │ │ ├── StatusPrime.java │ │ │ │ │ ├── User.java │ │ │ │ │ ├── Info.java │ │ │ │ │ ├── UserGroup.java │ │ │ │ │ ├── UserPrime.java │ │ │ │ │ ├── UserGroupPrime.java │ │ │ │ │ ├── Dest.java │ │ │ │ │ └── Source.java │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── spring │ │ │ │ └── libs │ │ │ │ └── lombok │ │ │ │ └── Person.java │ │ └── support │ │ │ └── logstash.conf │ ├── spring-integration-rmi │ │ ├── spring-integration-rmi-client │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── spring │ │ │ │ └── rmi │ │ │ │ └── service │ │ │ │ └── MessageProvider.java │ │ └── spring-integration-rmi-server │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── spring │ │ │ └── rmi │ │ │ └── service │ │ │ ├── MessageProvider.java │ │ │ └── MessageProviderImpl.java │ ├── spring-boot-test-junit5 │ │ └── src │ │ │ ├── test │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ ├── DisabledClassDemo.java │ │ │ │ └── DisabledTestsDemo.java │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── springboot │ │ │ ├── HelloService.java │ │ │ └── TestJunit5Application.java │ ├── spring-integration-rpc │ │ ├── spring-integration-rpc-api │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── spring │ │ │ │ └── dubbo │ │ │ │ └── api │ │ │ │ └── HelloProvider.java │ │ ├── spring-integration-rpc-consumer │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── log4j.properties │ │ └── spring-integration-rpc-provider │ │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── log4j.properties │ ├── README.md │ └── spring-boot-scheduling-quartz │ │ └── src │ │ └── main │ │ └── resources │ │ └── application.properties ├── security │ ├── spring-security-shiro │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── properties │ │ │ │ └── application.properties │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── index.jsp │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── spring │ │ │ └── security │ │ │ └── shiro │ │ │ ├── dao │ │ │ └── PermissionDao.java │ │ │ └── service │ │ │ └── PermissionService.java │ ├── README.md │ ├── spring-boot-security-session │ │ ├── README.md │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── security │ │ │ │ ├── filter │ │ │ │ └── DunwuSecurityException.java │ │ │ │ └── mapper │ │ │ │ └── AccountMapper.java │ │ │ └── resources │ │ │ └── sql │ │ │ └── data.sql │ ├── spring-boot-security-ldap │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ ├── spring-boot-security-checkcode │ │ ├── README.md │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── springboot │ │ │ │ └── security │ │ │ │ ├── filter │ │ │ │ └── DunwuSecurityException.java │ │ │ │ └── mapper │ │ │ │ └── AccountMapper.java │ │ │ └── resources │ │ │ └── sql │ │ │ └── data.sql │ └── spring-boot-security-authentication │ │ └── README.md ├── data │ ├── cache │ │ ├── j2cache │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ ├── application.properties │ │ │ │ │ ├── META-INF │ │ │ │ │ │ ├── spring-configuration-metadata.json │ │ │ │ │ │ └── spring.factories │ │ │ │ │ └── logback.xml │ │ │ │ └── java │ │ │ │ │ └── example │ │ │ │ │ └── spring │ │ │ │ │ └── data │ │ │ │ │ └── cache │ │ │ │ │ └── J2cacheApplication.java │ │ │ │ └── test │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── cache │ │ │ │ └── TestBean.java │ │ ├── basics │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ ├── sql │ │ │ │ └── data.sql │ │ │ │ └── logback.xml │ │ └── jetcache │ │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── sql │ │ │ └── data.sql │ │ │ └── logback.xml │ ├── jdbc │ │ ├── xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ ├── properties │ │ │ │ ├── h2.properties │ │ │ │ └── mysql.properties │ │ │ │ └── sql │ │ │ │ └── data.sql │ │ ├── basics │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── sql │ │ │ │ │ └── data.sql │ │ │ │ └── logback.xml │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── jdbc │ │ │ │ └── UserDaoTxService.java │ │ ├── druid │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ ├── sql │ │ │ │ └── data.sql │ │ │ │ └── logback.xml │ │ └── multi-datasource │ │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── sql │ │ │ └── data.sql │ │ │ └── logback.xml │ ├── nosql │ │ ├── hbase │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ ├── basics │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ ├── properties │ │ │ │ ├── redis.properties │ │ │ │ └── elasticsearch.properties │ │ │ │ └── logback.xml │ │ ├── redis │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── example │ │ │ │ │ │ └── spring │ │ │ │ │ │ └── data │ │ │ │ │ │ └── nosql │ │ │ │ │ │ └── redis │ │ │ │ │ │ ├── quickstart │ │ │ │ │ │ ├── Location.java │ │ │ │ │ │ └── UserService.java │ │ │ │ │ │ └── reactive │ │ │ │ │ │ └── Coffee.java │ │ │ │ └── resources │ │ │ │ │ ├── application-single.properties │ │ │ │ │ ├── application-sentinel.properties │ │ │ │ │ └── logback.xml │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── nosql │ │ │ │ └── redis │ │ │ │ └── cluster │ │ │ │ └── RedisClusterApplication.java │ │ ├── mongodb │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── logback.xml │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── nosql │ │ │ │ └── mongodb │ │ │ │ ├── entity │ │ │ │ ├── CustomerDto.java │ │ │ │ └── Address.java │ │ │ │ └── repository │ │ │ │ └── RoleRepository.java │ │ └── elasticsearch │ │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── data │ │ │ └── nosql │ │ │ └── elasticsearch │ │ │ ├── service │ │ │ └── CustomersInterface.java │ │ │ └── DataElasticsearchApplication.java │ ├── orm │ │ ├── mybatis-mapper │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── mapper │ │ │ │ │ ├── CityMapper.xml │ │ │ │ │ └── CountryMapper.xml │ │ │ │ └── logback.xml │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── orm │ │ │ │ └── mybatis │ │ │ │ ├── mapper │ │ │ │ ├── CityMapper.java │ │ │ │ ├── UserInfoMapper.java │ │ │ │ └── CountryMapper.java │ │ │ │ └── util │ │ │ │ └── MyMapper.java │ │ ├── mybatis │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── example │ │ │ │ │ └── spring │ │ │ │ │ └── data │ │ │ │ │ └── orm │ │ │ │ │ └── mybatis │ │ │ │ │ ├── dao │ │ │ │ │ └── UserDAO.java │ │ │ │ │ └── mapper │ │ │ │ │ ├── UserMapper.java │ │ │ │ │ ├── OrderMapper.java │ │ │ │ │ └── ProductMapper.java │ │ │ │ └── resources │ │ │ │ ├── sql │ │ │ │ └── data.sql │ │ │ │ └── properties │ │ │ │ └── db.properties │ │ ├── mybatis-multi-datasource │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── orm │ │ │ │ └── mybatis │ │ │ │ └── mapper │ │ │ │ ├── Db1UserMapper.java │ │ │ │ └── Db2UserMapper.java │ │ ├── mybatis-plus │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ ├── sql │ │ │ │ │ └── data-h2.sql │ │ │ │ └── logback.xml │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── data │ │ │ │ └── orm │ │ │ │ └── mybatis │ │ │ │ └── mapper │ │ │ │ ├── User2Mapper.java │ │ │ │ └── UserMapper.java │ │ └── jpa │ │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── sql │ │ │ └── data.sql │ │ │ └── logback.xml │ └── middleware │ │ ├── sharding │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── sql │ │ │ │ └── clear.sql │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── data │ │ │ └── middleware │ │ │ └── sharding │ │ │ └── mapper │ │ │ └── UserMapper.java │ │ └── flyway │ │ └── src │ │ └── main │ │ └── resources │ │ ├── sql │ │ └── V2__Add_user.sql │ │ ├── logback.xml │ │ └── application.properties └── distributed │ ├── trace │ ├── opentelemetry │ │ ├── http │ │ │ ├── client │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── resources │ │ │ │ │ └── application.properties │ │ │ └── server │ │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── trace │ │ │ │ └── opentelemetry │ │ │ │ └── OpenTelemetryPropagationServerApplication.java │ │ └── async │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── trace │ │ │ └── opentelemetry │ │ │ └── DemoService.java │ └── sleuth │ │ ├── sleuth-sample │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ │ ├── sleuth-web │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ │ ├── sleuth-websocket │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── trace │ │ │ └── sleuth │ │ │ └── entity │ │ │ ├── HelloMessage.java │ │ │ └── Greeting.java │ │ ├── sleuth-opentracing │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── trace │ │ │ └── sleuth │ │ │ └── SleuthOpenTracingApplication.java │ │ ├── sleuth-feign │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── trace │ │ │ └── sleuth │ │ │ ├── SampleFeignClient.java │ │ │ └── SleuthFeignApplication.java │ │ ├── sleuth-mq-rabbitmq │ │ ├── producer │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── spring │ │ │ │ └── trace │ │ │ │ └── sleuth │ │ │ │ └── rmq │ │ │ │ └── MySource.java │ │ └── consumer │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── trace │ │ │ └── sleuth │ │ │ └── rmq │ │ │ └── MySink.java │ │ └── sleuth-mq-kafka │ │ ├── producer │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── example │ │ │ └── spring │ │ │ └── trace │ │ │ └── sleuth │ │ │ └── kafka │ │ │ └── MySource.java │ │ └── consumer │ │ └── src │ │ └── main │ │ └── java │ │ └── example │ │ └── spring │ │ └── trace │ │ └── sleuth │ │ └── kafka │ │ └── MySink.java │ └── ratelimit │ └── sentinel │ ├── consumer │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── example │ │ └── spring │ │ └── ratelimit │ │ └── sentinel │ │ └── dubbo │ │ └── DubboConsumerService.java │ ├── provider │ └── src │ │ └── main │ │ └── resources │ │ └── application.properties │ └── api │ └── src │ └── main │ └── java │ └── example │ └── spring │ └── ratelimit │ └── sentinel │ └── dubbo │ └── DubboProviderService.java ├── settings └── README.md ├── prettier.config.js └── utils └── config.yml /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "compact": false 3 | } 4 | -------------------------------------------------------------------------------- /docs/.vuepress/config/baiduCode.js: -------------------------------------------------------------------------------- 1 | module.exports = '' 2 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/resources/META-INF/user-config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /codes/web/multipart/src/test/resources/testupload.txt: -------------------------------------------------------------------------------- 1 | Spring Framework -------------------------------------------------------------------------------- /codes/core/resource/src/main/resources/META-INF/dev.properties: -------------------------------------------------------------------------------- 1 | env = 开发环境 2 | -------------------------------------------------------------------------------- /codes/core/resource/src/main/resources/META-INF/prod.properties: -------------------------------------------------------------------------------- 1 | env = 生产环境 2 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/plugin/themes/default/numberbox.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings/README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | > 本目录下存放本项目运行时可能需要用到的一些环境配置。(使用本项目时可以参考我的配置) 4 | -------------------------------------------------------------------------------- /codes/integration/distributed/spring-boot-zookeeper/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /codes/security/spring-security-shiro/src/main/resources/properties/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/numberbox.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/Spring环境配置.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/Spring环境配置.docx -------------------------------------------------------------------------------- /codes/integration/spring-boot-docker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | -------------------------------------------------------------------------------- /codes/web/sse/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.async.request-timeout = 30000 2 | -------------------------------------------------------------------------------- /docs/@pages/tagsPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | tagsPage: true 3 | title: 标签 4 | permalink: /tags/ 5 | article: false 6 | --- -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | j2cache.config-location = j2cache.properties 2 | -------------------------------------------------------------------------------- /codes/distributed/trace/opentelemetry/http/client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8081 2 | -------------------------------------------------------------------------------- /codes/distributed/trace/opentelemetry/http/server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/resources/static/test.txt: -------------------------------------------------------------------------------- 1 | Example - Spring Boot + Jsp 2 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/views/pages/user/User.less: -------------------------------------------------------------------------------- 1 | .user-view-row { 2 | padding-bottom: 15px; 3 | } 4 | -------------------------------------------------------------------------------- /codes/core/profile/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | dunwu.message = The app is running on profile dev. 2 | -------------------------------------------------------------------------------- /codes/core/profile/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | dunwu.message = The app is running on profile prod. 2 | -------------------------------------------------------------------------------- /codes/core/profile/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | dunwu.message = The app is running on profile test. 2 | -------------------------------------------------------------------------------- /codes/core/property/src/main/resources/prop/validator.properties: -------------------------------------------------------------------------------- 1 | validator.host = 127.0.0.1 2 | validator.port = 8080 3 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | j2cache.config-location = j2cache-test.properties 2 | -------------------------------------------------------------------------------- /codes/security/spring-security-shiro/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/web/form/src/main/resources/templates/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 欢迎访问! 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/img/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/.vuepress/public/img/bg.gif -------------------------------------------------------------------------------- /docs/@pages/archivesPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | archivesPage: true 3 | title: 归档 4 | permalink: /archives/ 5 | article: false 6 | --- -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application-log4j.properties: -------------------------------------------------------------------------------- 1 | logging.config = classpath:log4j.xml 2 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application-log4j2.properties: -------------------------------------------------------------------------------- 1 | logging.config = classpath:log4j2.xml 2 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | debug = true 2 | spring.profiles.active = qq 3 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_clear.ftl: -------------------------------------------------------------------------------- 1 | DELETE FROM ${tableName} 2 | -------------------------------------------------------------------------------- /docs/.vuepress/public/img/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/.vuepress/public/img/more.png -------------------------------------------------------------------------------- /docs/.vuepress/public/img/other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/.vuepress/public/img/other.png -------------------------------------------------------------------------------- /docs/@pages/categoriesPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | categoriesPage: true 3 | title: 分类 4 | permalink: /categories/ 5 | article: false 6 | --- -------------------------------------------------------------------------------- /codes/core/property/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active = prop 2 | #spring.profiles.active = yaml 3 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application-logback.properties: -------------------------------------------------------------------------------- 1 | logging.config = classpath:logback.xml 2 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-scheduler/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_select.ftl: -------------------------------------------------------------------------------- 1 | SELECT * FROM ${tableName} 2 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache = false 2 | -------------------------------------------------------------------------------- /codes/web/multipart/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: Uploading 2 | 3 | > 源自:https://spring.io/guides/gs/uploading-files/ 4 | -------------------------------------------------------------------------------- /docs/.vuepress/public/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/.vuepress/public/img/favicon.ico -------------------------------------------------------------------------------- /codes/core/property/src/main/resources/prop/custom.properties: -------------------------------------------------------------------------------- 1 | custom.topic1 = Java 2 | custom.topic2 = [${custom.topic1}] Spring Boot 3 | -------------------------------------------------------------------------------- /codes/web/helloworld/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss 3 | -------------------------------------------------------------------------------- /docs/.vuepress/public/img/dunwu-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/docs/.vuepress/public/img/dunwu-logo.png -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.profiles.active = logback 3 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/resources/META-INF/services/example.spring.core.bean.life.UserFactory: -------------------------------------------------------------------------------- 1 | example.spring.core.bean.life.DefaultUserFactory 2 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_delete.ftl: -------------------------------------------------------------------------------- 1 | DELETE FROM ${tableName} WHERE NAME = ${name} 2 | -------------------------------------------------------------------------------- /codes/web/https/src/main/resources/keystore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/https/src/main/resources/keystore.p12 -------------------------------------------------------------------------------- /codes/web/view/react/backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 9527 2 | spring.jackson.default-property-inclusion = non_null 3 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/react/frontend/public/favicon.ico -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/components/layout/Content/Content.less: -------------------------------------------------------------------------------- 1 | .ant-layout-content { 2 | background: #fff; 3 | padding: 24px; 4 | } 5 | -------------------------------------------------------------------------------- /codes/core/async/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.file.path = spring-boot-asyn.log 2 | logging.pattern.dateformat = yyyy-MM-dd HH:mm:ss 3 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/webapi/mock/user.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | code: 0, msg: ['成功'], data: {uid: '1', role: 'ADMIN', name: 'admin'} 3 | }; 4 | -------------------------------------------------------------------------------- /codes/web/connections/src/main/resources/sample.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/connections/src/main/resources/sample.jks -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-sample/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name = sleuth-sample 2 | spring.sleuth.web.enabled = true 3 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/drop_table.ftl: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `${table.database}`.`${table.tableName}`; 2 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/webapi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webapi", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./webapi.js" 6 | } 7 | -------------------------------------------------------------------------------- /codes/data/jdbc/xml/src/main/resources/properties/h2.properties: -------------------------------------------------------------------------------- 1 | jdbc.url = jdbc:h2:mem:test 2 | jdbc.driver = org.h2.Driver 3 | jdbc.username = sa 4 | jdbc.password = 5 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/views/pages/login/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/react/frontend/src/views/pages/login/bg.jpg -------------------------------------------------------------------------------- /codes/integration/spring-integration-swagger/swagger-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/integration/spring-integration-swagger/swagger-ui.png -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/sql_create.ftl: -------------------------------------------------------------------------------- 1 | INSERT INTO ${tableName}(${key1}, ${key2}) VALUES(${value1}, ${value2}) 2 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/java/Job.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.java; 2 | 3 | public interface Job { 4 | 5 | String work(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/test/resources/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/integration/spring-boot-mail/src/test/resources/moon.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/messages/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/messages/info.png -------------------------------------------------------------------------------- /codes/web/view/bootstrap/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/bootstrap/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /codes/core/ioc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = ${random.int[1000,65536]} 2 | server.tomcat.max-threads = 20 3 | management.endpoints.web.exposure.include = * 4 | -------------------------------------------------------------------------------- /codes/integration/distributed/spring-boot-dubbo/README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot + Dubbo 2 | 3 | > 搬迁 **[ dubbo-spring-boot-project](https://github.com/apache/dubbo-spring-boot-project)** 示例 4 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/messages/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/messages/error.png -------------------------------------------------------------------------------- /codes/data/nosql/hbase/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | dunwu.data.hbase.enabled = true 2 | dunwu.data.hbase.zookeeper.quorum = localhost 3 | dunwu.data.hbase.zookeeper.port = 2181 4 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/test/resources/icon-man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/integration/spring-boot-mail/src/test/resources/icon-man.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/messages/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/messages/success.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/messages/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/messages/warning.png -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/containers/Core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CoreContainer", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./CoreContainer.jsx" 6 | } 7 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/views/pages/login/login-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/react/frontend/src/views/pages/login/login-logo.png -------------------------------------------------------------------------------- /codes/core/aop/src/main/java/example/spring/core/aop/entity/Performer.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.aop.entity; 2 | 3 | public interface Performer { 4 | 5 | String perform(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-docker/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #-e:若指令传回值不等于0,则立即退出shell。 4 | #-u:当执行时使用到未定义过的变量,则显示错误信息。 5 | #-x:执行指令后,会先显示该指令及所下的参数。 6 | set -eux; 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /codes/core/actuator/README.md: -------------------------------------------------------------------------------- 1 | # Spring Actuator 示例 2 | 3 | 执行 `io.github.dunwu.springboot.actuator.SpringBootActuatorApplication ` 类 `main` 方法。 4 | 5 | 访问 http://localhost:18080/actuator 可以查看监控信息。 6 | -------------------------------------------------------------------------------- /codes/integration/mq/spring-boot-mq-redis/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.redis.host = 127.0.0.1 2 | spring.redis.port = 6379 3 | spring.redis.password = 4 | spring.redis.database = 0 5 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix = /WEB-INF/jsp/ 2 | spring.mvc.view.suffix = .jsp 3 | application.message = Hello World 4 | -------------------------------------------------------------------------------- /codes/core/profile/src/main/java/example/spring/core/profile/MessageService.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.profile; 2 | 3 | public interface MessageService { 4 | 5 | String getMessage(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-web/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name = sleuth-web 2 | spring.zipkin.base-url = http://127.0.0.1:9411 3 | spring.sleuth.web.enabled = true 4 | -------------------------------------------------------------------------------- /codes/web/multipart/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.servlet.multipart.enabled = true 2 | spring.servlet.multipart.max-file-size = 128KB 3 | spring.servlet.multipart.max-request-size = 128KB 4 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/no.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/ok.png -------------------------------------------------------------------------------- /codes/data/nosql/basics/src/main/resources/properties/redis.properties: -------------------------------------------------------------------------------- 1 | # Redis settings 2 | redis.host = localhost 3 | redis.port = 6379 4 | redis.pass = root 5 | redis.maxIdle = 300 6 | redis.testOnBorrow = true 7 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=UTF-8" %> 2 | <%@ include file="/WEB-INF/views/jsp/taglibs.jsp" %> 3 | 4 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/back.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/cut.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/help.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/lock.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/man.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/more.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/redo.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/sum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/sum.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/tip.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/undo.png -------------------------------------------------------------------------------- /codes/integration/spring-boot-statemachine/src/main/java/io/github/dunwu/springboot/statemachine/Events.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.statemachine; 2 | 3 | public enum Events { 4 | E1, 5 | E2 6 | } 7 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/webapp/WEB-INF/jsp/error.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Error

5 | Something went wrong: ${status} ${error} 6 | 7 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/blank.gif -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/cancel.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/clear.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/filter.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/pencil.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/print.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/reload.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/search.png -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/utils/index.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 工具类总入口 3 | * @desc 工具类总入口。 4 | *

原则上工具类都要在此注册,然后提供给外部模块

5 | * @author Zhang Peng 6 | */ 7 | 8 | export {default as authHOC} from './authHOC' 9 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/Performer.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation; 2 | 3 | public interface Performer { 4 | 5 | String perform() throws Exception; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/instrument/Instrument.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.instrument; 2 | 3 | public interface Instrument { 4 | 5 | void play(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/integration/distributed/spring-boot-dubbo/spring-boot-dubbo-autoconfig-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Spring boot application 2 | spring.application.name = spring-boot-dubbo-autoconfig-consumer 3 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/edit_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/edit_add.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/filesave.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/mini_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/mini_add.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/mini_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/mini_edit.png -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/components/layout/Breadcrumb/Breadcrumb.less: -------------------------------------------------------------------------------- 1 | .ant-layout-breadcrumb { 2 | z-index: 200; 3 | line-height: 64px; 4 | 5 | .ant-breadcrumb-link { 6 | font-size: 16px; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/webapi/webapi.js: -------------------------------------------------------------------------------- 1 | if (process.env.NODE_ENV === 'development') { 2 | module.exports = require('./mock').default 3 | } else { 4 | module.exports = require('../utils/http').default 5 | } 6 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/main/resources/META-INF/spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": [ 3 | { 4 | "name": "j2cache.config-location", 5 | "type": "java.lang.String" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /codes/integration/mq/spring-boot-mq-rabbitmq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.rabbitmq.host = 127.0.0.1 2 | spring.rabbitmq.port = 5672 3 | spring.rabbitmq.username = guest 4 | spring.rabbitmq.password = guest 5 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-statemachine/src/main/java/io/github/dunwu/springboot/statemachine/States.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.statemachine; 2 | 3 | public enum States { 4 | SI, 5 | S1, 6 | S2 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/edit_remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/edit_remove.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_chart.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_shapes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_shapes.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/mini_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/mini_refresh.png -------------------------------------------------------------------------------- /codes/web/websocket/src/main/java/example/spring/web/websocket/client/GreetingService.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.websocket.client; 2 | 3 | public interface GreetingService { 4 | 5 | String getGreeting(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/websocket/src/main/java/example/spring/web/websocket/echo/EchoService.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.websocket.echo; 2 | 3 | public interface EchoService { 4 | 5 | String getMessage(String message); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_clipart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_clipart.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_picture.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_smartart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/icons/large_smartart.png -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/autowire/Performer.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.autowire; 2 | 3 | public interface Performer { 4 | 5 | void perform() throws Exception; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/security/README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | > Spring 安全 4 | 5 | ## 示例 6 | 7 | - **spring-tutorial-security-shiro**:spring 集成 shiro 实现安全框架的范例。 8 | 9 | spring 自身的安全框架 spring-security 相比 shiro 较为重型化,并且 shiro 可以满足大部分的应用,所以这里选用 shiro。 10 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/java/example/spring/web/mvc/exceptions/BusinessException.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.mvc.exceptions; 2 | 3 | @SuppressWarnings("serial") 4 | public class BusinessException extends Exception { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/blank.gif -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/autowire/instrument/Instrument.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.autowire.instrument; 2 | 3 | public interface Instrument { 4 | 5 | void play(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Instrument.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | /** 4 | * 乐器 5 | */ 6 | public interface Instrument { 7 | 8 | String play(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/Status.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public enum Status { 4 | 5 | PROCESSING, 6 | SUCCESS, 7 | ERROR 8 | } 9 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: Session 2 | 3 | > 通过 Redis 管理 Session 4 | 5 | ## 引用和引申 6 | 7 | https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-redis.html 8 | -------------------------------------------------------------------------------- /codes/web/view/bootstrap/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Allow Thymeleaf templates to be reloaded at dev time 2 | spring.thymeleaf.cache = false 3 | server.tomcat.accesslog.enabled = true 4 | server.tomcat.basedir = target/tomcat 5 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/loading.gif -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/combo_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/combo_arrow.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/menu_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/menu_arrows.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/panel_tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/panel_tools.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tabs_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tabs_icons.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tree_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tree_icons.png -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/StatusPrime.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public enum StatusPrime { 4 | 5 | PROCESSING, 6 | SUCCESS, 7 | ERROR 8 | } 9 | -------------------------------------------------------------------------------- /codes/security/spring-security-shiro/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | Title 5 | 6 | 7 |

欢迎访问

8 | 9 | 10 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datebox_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datebox_arrow.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/layout_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/layout_arrows.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/linkbutton_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/linkbutton_bg.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/slider_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/slider_handle.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tagbox_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/tagbox_icons.png -------------------------------------------------------------------------------- /codes/web/websocket/src/main/java/example/spring/web/websocket/snake/Direction.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.websocket.snake; 2 | 3 | public enum Direction { 4 | 5 | NONE, 6 | NORTH, 7 | SOUTH, 8 | EAST, 9 | WEST 10 | } 11 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/fruit/Fruit.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.fruit; 2 | 3 | public abstract class Fruit { 4 | 5 | public String getName() { 6 | return null; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Performer.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | /** 4 | * 表演接口 5 | */ 6 | public interface Performer { 7 | 8 | void perform() throws Exception; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-websocket/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name = sleuth-websocket 2 | spring.zipkin.base-url = http://127.0.0.1:9411 3 | spring.sleuth.web.enabled = true 4 | spring.sleuth.tracer.mode = AUTO 5 | -------------------------------------------------------------------------------- /codes/web/https/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8443 2 | server.ssl.key-store = classpath:keystore.p12 3 | server.ssl.key-store-password = 123456 4 | server.ssl.key-alias = tomcat 5 | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss 6 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/accordion_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/accordion_arrows.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/calendar_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/calendar_arrows.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datagrid_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/datagrid_icons.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/messager_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/messager_icons.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/pagination_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/pagination_icons.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_open.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/searchbox_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/searchbox_button.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/spinner_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/spinner_arrows.png -------------------------------------------------------------------------------- /codes/data/nosql/basics/src/main/resources/properties/elasticsearch.properties: -------------------------------------------------------------------------------- 1 | #elasticsearch.clusterHosts = 10.101.130.94:12498,10.101.130.96:12498,10.101.130.98:12498 2 | elasticsearch.clusterHosts = 10.101.129.201:11464,10.101.129.202:11464,10.101.129.203:11464 3 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-ldap/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.ldap.urls = ldap://172.22.6.12:10389 2 | spring.ldap.base = ou=users,dc=dunwu,dc=github,dc=io 3 | spring.ldap.username = uid=admin,ou=system 4 | spring.ldap.password = secret 5 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/passwordbox_close.png -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-opentracing/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name = sleuth-opentracing 2 | spring.zipkin.base-url = http://127.0.0.1:9411 3 | spring.sleuth.web.enabled = true 4 | spring.sleuth.opentracing.enabled = true 5 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /codes/web/view/bootstrap/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/validatebox_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/images/validatebox_warning.png -------------------------------------------------------------------------------- /codes/data/jdbc/xml/src/main/resources/properties/mysql.properties: -------------------------------------------------------------------------------- 1 | jdbc.url = jdbc:mysql://127.0.0.1:3306/spring_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8 2 | jdbc.driver = com.mysql.cj.jdbc.Driver 3 | jdbc.username = root 4 | jdbc.password = root 5 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-feign/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8081 2 | spring.application.name = sleuth-feign 3 | spring.zipkin.base-url = http://127.0.0.1:9411 4 | spring.sleuth.web.enabled = true 5 | spring.sleuth.feign.enabled = true 6 | -------------------------------------------------------------------------------- /codes/web/README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | > Spring MVC, WebSocket, SockJS, STOMP messaging, Spring WebFlux, WebClient, WebSocket. 4 | 5 | ## 示例 6 | 7 | - **spring-tutorial-web-mvc** 展示 spring mvc 的特性。 8 | - **spring-tutorial-web-websocket** 展示 spring 如何支持 HTML5 重要新特性 websocket。 9 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://prettier.io/docs/en/options.html 3 | * @see https://prettier.io/docs/en/configuration.html 4 | */ 5 | module.exports = { 6 | tabWidth: 2, 7 | semi: false, 8 | singleQuote: true, 9 | trailingComma: 'none' 10 | } 11 | -------------------------------------------------------------------------------- /codes/core/bean/src/main/java/example/spring/core/bean/InfoDto.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | @Data 7 | @ToString 8 | public class InfoDto { 9 | 10 | private String content; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-velocity/src/main/resources/velocity.properties: -------------------------------------------------------------------------------- 1 | resource.loader = file 2 | file.resource.loader.path = D:/01_Workspace/Project/zp/java/javaee-tutorial/codes/oss/src/main/resources 3 | input.encoding = utf-8 4 | output.encoding = utf-8 5 | -------------------------------------------------------------------------------- /codes/web/form/src/main/java/example/spring/web/form/entity/Greeting.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.form.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Greeting { 7 | 8 | private long id; 9 | 10 | private String content; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/fruit/Apple.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.fruit; 2 | 3 | public class Apple extends Fruit { 4 | 5 | @Override 6 | public String getName() { 7 | return "苹果"; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/fruit/Banana.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.fruit; 2 | 3 | public class Banana extends Fruit { 4 | 5 | @Override 6 | public String getName() { 7 | return "香蕉"; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/fruit/Orange.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.fruit; 2 | 3 | public class Orange extends Fruit { 4 | 5 | @Override 6 | public String getName() { 7 | return "橘子"; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/integration/mq/spring-boot-mq-activemq/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.activemq.broker-url = tcp://localhost:61616 2 | spring.activemq.user = admin 3 | spring.activemq.password = admin 4 | spring.activemq.in-memory = true 5 | spring.activemq.pool.enabled = false 6 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/spring-tutorial/HEAD/codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /codes/web/connections/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8443 2 | server.ssl.key-store = classpath:sample.jks 3 | server.ssl.key-store-password = secret 4 | server.ssl.key-password = password 5 | http.port = 8080 6 | spring.jackson.date-format = yyyy-MM-dd HH:mm:ss 7 | -------------------------------------------------------------------------------- /codes/integration/distributed/spring-boot-dubbo/spring-boot-dubbo-api/src/main/java/io/github/dunwu/springboot/dubbo/api/InfoService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.dubbo.api; 2 | 3 | /** 4 | * @author peng.zhang 5 | * @date 2020/12/7 6 | */ 7 | public interface InfoService { 8 | } 9 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-rmi/spring-integration-rmi-client/src/main/java/io/github/dunwu/spring/rmi/service/MessageProvider.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.rmi.service; 2 | 3 | public interface MessageProvider { 4 | 5 | public String getMessage(String name); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-rmi/spring-integration-rmi-server/src/main/java/io/github/dunwu/spring/rmi/service/MessageProvider.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.rmi.service; 2 | 3 | public interface MessageProvider { 4 | 5 | public String getMessage(String name); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/redux/constants/menuActionType.js: -------------------------------------------------------------------------------- 1 | export const REFRESH_MENU = 'REFRESH_MENU'; 2 | export const REFRESH_NAVPATH = 'REFRESH_NAVPATH'; 3 | export const REFRESH_MENU_SUCCESS = 'REFRESH_MENU_SUCCESS'; 4 | export const REFRESH_MENU_FAILED = 'REFRESH_MENU_FAILED'; 5 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/main/java/example/spring/data/nosql/redis/quickstart/Location.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.redis.quickstart; 2 | 3 | public enum Location { 4 | Nanjing, 5 | Beijing, 6 | Shanghai, 7 | Hangzhou, 8 | Guangzhou, 9 | Shenzhen 10 | } 11 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/README.md: -------------------------------------------------------------------------------- 1 | # SpringBootTutorial :: Web :: JSP :: Tomcat 2 | 3 | 构建运行 4 | 5 | ```bash 6 | mvn clean package 7 | java -jar target/spring-boot-web-jsp-tomcat*.war 8 | ``` 9 | 10 | 检验 11 | 12 | ``` 13 | curl -i -I http://localhost:8080/ 14 | ``` 15 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/components/layout/Footer/index.less: -------------------------------------------------------------------------------- 1 | .ant-layout-footer { 2 | height: 64px; 3 | line-height: 32px; 4 | text-align: center; 5 | font-size: 14px; 6 | color: #999; 7 | background: #fff; 8 | border-top: 1px solid #e9e9e9; 9 | width: 100%; 10 | } 11 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/test/java/example/spring/data/nosql/redis/cluster/RedisClusterApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.redis.cluster; 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication; 4 | 5 | @SpringBootApplication 6 | public class RedisClusterApplication { } 7 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/sql/create_table.ftl: -------------------------------------------------------------------------------- 1 | CREATE TABLE `${table.database}`.`${table.tableName}` ( 2 | <#list table.columns as item> 3 | `${item.columnName}` ${item.columnType}<#if item?index != table.columns?size - 1>, 4 | 5 | ); 6 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/passwordbox.css: -------------------------------------------------------------------------------- 1 | .passwordbox-open { 2 | background: url('images/passwordbox_open.png') no-repeat center center; 3 | } 4 | 5 | .passwordbox-close { 6 | background: url('images/passwordbox_close.png') no-repeat center center; 7 | } 8 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Piano.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | public class Piano implements Instrument { 4 | 5 | public Piano() { } 6 | 7 | @Override 8 | public String play() { 9 | return "演奏钢琴"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/resources/mapper/CityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/web/MyException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | public class MyException extends RuntimeException { 4 | 5 | public MyException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Guitar.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | public class Guitar implements Instrument { 4 | 5 | public Guitar() { } 6 | 7 | @Override 8 | public String play() { 9 | return "演奏吉他"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Violin.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | public class Violin implements Instrument { 4 | 5 | public Violin() { } 6 | 7 | @Override 8 | public String play() { 9 | return "演奏小提琴"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/resources/mapper/CountryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/person/City.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.person; 2 | 3 | /** 4 | * 城市枚举 5 | * 6 | * @author Mercy 7 | */ 8 | public enum City { 9 | 10 | BEIJING, 11 | HANGZHOU, 12 | SHANGHAI 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/nosql/mongodb/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | debug = true 2 | spring.data.mongodb.host = localhost 3 | spring.data.mongodb.port = 27017 4 | spring.data.mongodb.database = spring-tutorial 5 | #spring.data.mongodb.username = 6 | #spring.data.mongodb.password = 7 | #spring.main.allow-circular-references = true 8 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-websocket/src/main/java/example/spring/trace/sleuth/entity/HelloMessage.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth.entity; 2 | 3 | public class HelloMessage { 4 | 5 | private String name; 6 | 7 | public String getName() { 8 | return this.name; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-thymeleaf/src/main/java/io/github/dunwu/springboot/exception/MyException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.exception; 2 | 3 | public class MyException extends Exception { 4 | 5 | public MyException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -s /app/ck-puck-front/node_modules/ node_modules 4 | nvm use 8.1.0 5 | npm set registry http://192.168.51.44 6 | npm install 7 | npm run build 8 | rm -rf /app/ck-puck-front/dist 9 | mkdir -p /app/ck-puck-front/dist 10 | cp -Rf ./dist /app/ck-puck-front/ 11 | -------------------------------------------------------------------------------- /codes/data/middleware/sharding/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | #spring.profiles.active = master-slave 3 | #spring.profiles.active = sharding-databases 4 | #spring.profiles.active = sharding-databases-tables 5 | #spring.profiles.active = sharding-master-slave 6 | spring.profiles.active = sharding-tables 7 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Zhang Peng on 2017/7/6. 3 | */ 4 | import { combineReducers } from 'redux' 5 | import auth from './auth' 6 | import menu from './menu' 7 | 8 | const rootReducer = combineReducers({ 9 | auth, 10 | menu 11 | }) 12 | export default rootReducer 13 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis/src/main/java/example/spring/data/orm/mybatis/dao/UserDAO.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.dao; 2 | 3 | import example.spring.data.orm.mybatis.mapper.UserMapper; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2017/4/13. 8 | */ 9 | public interface UserDAO extends UserMapper { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/web/websocket/src/main/java/example/spring/web/websocket/client/SimpleGreetingService.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.websocket.client; 2 | 3 | public class SimpleGreetingService implements GreetingService { 4 | 5 | @Override 6 | public String getGreeting() { 7 | return "Hello world!"; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration = \ 2 | example.spring.data.cache.config.J2CacheAutoConfiguration,\ 3 | example.spring.data.cache.config.J2CacheSpringCacheAutoConfiguration,\ 4 | example.spring.data.cache.config.J2CacheSpringRedisAutoConfiguration 5 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/main/resources/application-single.properties: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 连接 Redis 单节点配置示例 3 | ############################################################# 4 | spring.redis.database = 0 5 | spring.redis.host = localhost 6 | spring.redis.port = 6379 7 | spring.redis.password = 8 | 9 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-velocity/src/main/resources/layout/default.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | $!pageTitle 4 | 5 | 6 | 7 |
默认布局页面,当前 Layout URL : $!layout_key
8 |

9 | 10 | $body_content 11 | 12 |

13 |

返回首页
14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Poetry.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 诗歌 7 | */ 8 | @Data 9 | public class Poetry { 10 | 11 | String name; 12 | 13 | public Poetry(String name) { 14 | this.name = name; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/java/Police.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.java; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component("police") 6 | public class Police implements Job { 7 | 8 | @Override 9 | public String work() { 10 | return "抓罪犯"; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/https/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

Get your greeting here

9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/web/view/bootstrap/src/main/java/example/spring/web/MessageRepository.java: -------------------------------------------------------------------------------- 1 | package example.spring.web; 2 | 3 | public interface MessageRepository { 4 | 5 | void deleteMessage(Long id); 6 | 7 | Iterable findAll(); 8 | 9 | Message findMessage(Long id); 10 | 11 | Message save(Message message); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/containers/Core/CoreContainer.less: -------------------------------------------------------------------------------- 1 | #root, div[data-reactroot] { 2 | height: 100%; 3 | } 4 | 5 | .ant-layout-has-sider { 6 | height: 100%; 7 | 8 | .ant-layout-container { 9 | padding-top: 30px; 10 | padding-bottom: 30px; 11 | padding-left: 50px; 12 | padding-right: 50px; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/java/Teacher.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.java; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component("teacher") 6 | public class Teacher implements Job { 7 | 8 | @Override 9 | public String work() { 10 | return "教课"; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/connections/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

Get your greeting here

9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/web/helloworld/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

Get your greeting here

9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/data/middleware/sharding/src/main/java/example/spring/data/middleware/sharding/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.middleware.sharding.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import example.spring.data.middleware.sharding.entity.User; 5 | 6 | public interface UserMapper extends BaseMapper { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /codes/distributed/ratelimit/sentinel/consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8082 2 | # 当前服务名 3 | dubbo.application.name = spring-distributed-ratelimit-sentinel-consumer 4 | # 注册中心地址 5 | dubbo.registry.address = zookeeper://${zookeeper.address:127.0.0.1}:2181 6 | # 通信规则(通信协议和接口) 7 | dubbo.protocol.name = dubbo 8 | dubbo.protocol.port = -1 9 | -------------------------------------------------------------------------------- /codes/distributed/ratelimit/sentinel/provider/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8081 2 | # 当前服务名 3 | dubbo.application.name = spring-distributed-ratelimit-sentinel-provider 4 | # 注册中心地址 5 | dubbo.registry.address = zookeeper://${zookeeper.address:127.0.0.1}:2181 6 | # 通信规则(通信协议和接口) 7 | dubbo.protocol.name = dubbo 8 | dubbo.protocol.port = -1 9 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/test/java/io/github/dunwu/springboot/DisabledClassDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.junit.jupiter.api.Disabled; 4 | import org.junit.jupiter.api.Test; 5 | 6 | @Disabled 7 | class DisabledClassDemo { 8 | 9 | @Test 10 | void testWillBeSkipped() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/autowire/instrument/Piano.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.autowire.instrument; 2 | 3 | public class Piano implements Instrument { 4 | 5 | public Piano() { 6 | } 7 | 8 | @Override 9 | public void play() { 10 | System.out.println("弹奏钢琴"); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/java/example/spring/web/mvc/form/InquiryType.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.mvc.form; 2 | 3 | /** 4 | * 调查类型 5 | */ 6 | public enum InquiryType { 7 | 8 | /** 9 | * 注释 10 | */ 11 | comment, 12 | /** 13 | * 反馈 14 | */ 15 | feedback, 16 | /** 17 | * 建议 18 | */ 19 | suggestion; 20 | } 21 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/autowire/instrument/Guitar.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.autowire.instrument; 2 | 3 | public class Guitar implements Instrument { 4 | 5 | public Guitar() { 6 | } 7 | 8 | @Override 9 | public void play() { 10 | System.out.println("弹奏吉他"); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/autowire/instrument/Violin.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.autowire.instrument; 2 | 3 | public class Violin implements Instrument { 4 | 5 | public Violin() { 6 | } 7 | 8 | @Override 9 | public void play() { 10 | System.out.println("弹奏小提琴"); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/nosql/mongodb/src/main/java/example/spring/data/nosql/mongodb/entity/CustomerDto.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.mongodb.entity; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * A sample DTO only containing the firstName. 7 | * 8 | * @author Oliver Gierke 9 | */ 10 | @Value 11 | public class CustomerDto { 12 | 13 | String firstName; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DML 脚本 3 | -- ------------------------------------------- 4 | 5 | INSERT INTO `user` (`name`, `age`, `address`, `email`) 6 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 7 | INSERT INTO `user` (`name`, `age`, `address`, `email`) 8 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 9 | -------------------------------------------------------------------------------- /codes/web/https/src/main/resources/templates/greeting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /utils/config.yml: -------------------------------------------------------------------------------- 1 | # 批量添加和修改、删除front matter配置文件 2 | 3 | # 需要批量处理的路径,docs文件夹内的文件夹 (数组,映射路径:path[0]/path[1]/path[2] ... ) 4 | path: 5 | - docs # 第一个成员必须是docs 6 | 7 | # 要删除的字段 (数组) 8 | delete: 9 | # - tags 10 | 11 | # 要添加、修改front matter的数据 (front matter中没有的数据则添加,已有的数据则覆盖) 12 | data: 13 | # author: 14 | # name: xugaoyi 15 | # link: https://github.com/xugaoyi 16 | -------------------------------------------------------------------------------- /codes/data/jdbc/xml/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DML 脚本 3 | -- ------------------------------------------- 4 | 5 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 6 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 7 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 8 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 9 | -------------------------------------------------------------------------------- /codes/distributed/ratelimit/sentinel/api/src/main/java/example/spring/ratelimit/sentinel/dubbo/DubboProviderService.java: -------------------------------------------------------------------------------- 1 | package example.spring.ratelimit.sentinel.dubbo; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @date 2024-02-05 6 | */ 7 | public interface DubboProviderService { 8 | 9 | String provide(String name); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/web/connections/src/main/resources/templates/greeting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/web/helloworld/src/main/resources/templates/greeting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/validatebox.css: -------------------------------------------------------------------------------- 1 | .inputbox { 2 | display: inline-block; 3 | vertical-align: middle; 4 | overflow: hidden; 5 | white-space: nowrap; 6 | margin: 0; 7 | padding: 0; 8 | } 9 | 10 | .validatebox-invalid { 11 | border-color: #FFA8A8; 12 | background-color: #FFF3F3; 13 | color: #000000; 14 | } 15 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-rmi/spring-integration-rmi-server/src/main/java/io/github/dunwu/spring/rmi/service/MessageProviderImpl.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.rmi.service; 2 | 3 | public class MessageProviderImpl implements MessageProvider { 4 | 5 | @Override 6 | public String getMessage(String name) { 7 | return "Hello, " + name; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # project 2 | node_modules 3 | 4 | # build 5 | dist/ 6 | coverage 7 | 8 | # IDE files 9 | .idea/ 10 | *.iml 11 | .ipr 12 | .iws 13 | 14 | # temp and sys 15 | *~ 16 | ~* 17 | *.diff 18 | *.patch 19 | *.bak 20 | .DS_Store 21 | Thumbs.db 22 | *.log 23 | 24 | # other 25 | .project 26 | .*proj 27 | .svn/ 28 | *.swp 29 | *.swo 30 | *.pyc 31 | *.pyo 32 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/action/TestA.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.action; 2 | 3 | import lombok.Getter; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class TestA { 9 | 10 | @Autowired 11 | @Getter 12 | private TestB testB; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/action/TestB.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.action; 2 | 3 | import lombok.Getter; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class TestB { 9 | 10 | @Autowired 11 | @Getter 12 | private TestA testA; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-velocity/src/main/resources/templates/velocity/default/header.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Velocity 邮件模板 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/config/app.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file app 的全局配置 3 | * @author Zhang Peng 4 | */ 5 | 6 | module.exports = { 7 | 8 | /** 9 | * 打印日志开关 10 | */ 11 | log: true, 12 | 13 | http: { 14 | 15 | /** 16 | * 请求超时时间 17 | */ 18 | timeout: 5000, 19 | 20 | /** 21 | * 服务器的host 22 | */ 23 | baseURL: '/api' 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/User.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public class User { 4 | 5 | private Status status; 6 | 7 | public Status getStatus() { 8 | return status; 9 | } 10 | 11 | public void setStatus(Status status) { 12 | this.status = status; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/components/layout/Header/Header.less: -------------------------------------------------------------------------------- 1 | .ant-layout-header { 2 | top: 0; 3 | right: 0; 4 | //height: 64px; 5 | //padding: 25px; 6 | z-index: 150; 7 | background: #fff; 8 | box-shadow: 0 0 1px 0 rgba(0, 0, 0, .3), 0 0 6px 2px rgba(0, 0, 0, .15); 9 | } 10 | 11 | .header-icon { 12 | margin: 0 15px; 13 | 14 | i { 15 | font-size: 20px; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /codes/core/bean/src/main/java/example/spring/core/bean/UserDto.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2018-11-02 9 | */ 10 | @Data 11 | @ToString 12 | public class UserDto { 13 | 14 | private long id; 15 | 16 | private String name; 17 | 18 | private InfoDto infoDTO; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/main/java/example/spring/data/nosql/redis/reactive/Coffee.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.redis.reactive; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class Coffee { 11 | 12 | private String id; 13 | private String name; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-mq-rabbitmq/producer/src/main/java/example/spring/trace/sleuth/rmq/MySource.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth.rmq; 2 | 3 | import org.springframework.cloud.stream.annotation.Output; 4 | import org.springframework.messaging.MessageChannel; 5 | 6 | public interface MySource { 7 | 8 | @Output("rmq-output1") 9 | MessageChannel rmqOutput1(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/README.md: -------------------------------------------------------------------------------- 1 | # spring-boot-security-checkcode 2 | 3 | 示例使用说明: 4 | 5 | 1. 执行 maven 构建 6 | 2. 执行 `io.github.dunwu.springboot.security.SecurityCheckCodeApplication#main` 7 | 3. 在浏览器中访问 localhost:8080,可以看到登录页面 8 | ![](https://raw.githubusercontent.com/dunwu/images/master/snap/20221008183704.png) 9 | 4. 使用以下账户可以完成登录: 10 | - admin/123456 11 | - user1/123456 12 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/java/example/spring/data/orm/mybatis/mapper/CityMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import example.spring.data.orm.mybatis.model.City; 4 | import example.spring.data.orm.mybatis.util.MyMapper; 5 | 6 | /** 7 | * @author liuzh_3nofxnp 8 | * @since 2016-01-22 22:17 9 | */ 10 | public interface CityMapper extends MyMapper { 11 | } 12 | -------------------------------------------------------------------------------- /codes/distributed/ratelimit/sentinel/consumer/src/main/java/example/spring/ratelimit/sentinel/dubbo/DubboConsumerService.java: -------------------------------------------------------------------------------- 1 | package example.spring.ratelimit.sentinel.dubbo; 2 | 3 | /** 4 | * Dubbo 限流、熔断示例 5 | * 6 | * @author Zhang Peng 7 | * @date 2024-02-05 8 | */ 9 | public interface DubboConsumerService { 10 | 11 | String consume(String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-mq-kafka/producer/src/main/java/example/spring/trace/sleuth/kafka/MySource.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth.kafka; 2 | 3 | import org.springframework.cloud.stream.annotation.Output; 4 | import org.springframework.messaging.MessageChannel; 5 | 6 | public interface MySource { 7 | 8 | @Output("kafka-output1") 9 | MessageChannel kafkaOutput1(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/Info.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public class Info { 4 | 5 | private String content; 6 | 7 | public String getContent() { 8 | return content; 9 | } 10 | 11 | public void setContent(String content) { 12 | this.content = content; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-rpc/spring-integration-rpc-api/src/main/java/io/github/dunwu/spring/dubbo/api/HelloProvider.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.dubbo.api; 2 | 3 | /** 4 | * @author Zhang Peng 5 | */ 6 | public interface HelloProvider { 7 | 8 | /** 9 | * 定义接口 10 | * 11 | * @param name 12 | * @return 13 | */ 14 | String sayHello(String name); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 2 | spring.datasource.username = root 3 | spring.datasource.password = root 4 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 5 | application.message = Hello, Freemarker 6 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-velocity/src/main/resources/layout/layout.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | $!pageTitle 4 | 5 | 6 | 7 |

Layout 页面,当前 Layout URL : $!layout_key
8 |

9 | 10 | $body_content 11 | 12 |

13 |

返回首页
14 |

15 |

$!linkLabel
16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/web/multipart/src/main/java/example/spring/web/multipart/StorageException.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.multipart; 2 | 3 | public class StorageException extends RuntimeException { 4 | 5 | public StorageException(String message) { 6 | super(message); 7 | } 8 | 9 | public StorageException(String message, Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-websocket/src/main/java/example/spring/trace/sleuth/entity/Greeting.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth.entity; 2 | 3 | public class Greeting { 4 | 5 | private String content; 6 | 7 | public Greeting(String content) { 8 | this.content = content; 9 | } 10 | 11 | public String getContent() { 12 | return this.content; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/distributed/spring-boot-dubbo/spring-boot-dubbo-zookeeper-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name = spring-boot-dubbo-zookeeper-consumer 2 | demo.service.version = 1.0.0 3 | embedded.zookeeper.port = 2181 4 | dubbo.registry.address = zookeeper://127.0.0.1:${embedded.zookeeper.port} 5 | dubbo.registry.file = ${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache 6 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-velocity/src/main/resources/layout/layout2.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | $!pageTitle 4 | 5 | 6 | 7 |
Layout2 页面,当前 Layout URL : $!layout_key
8 |

9 | 10 | $body_content 11 | 12 |

13 |

返回首页
14 |

15 |

$!linkLabel
16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 1.8.13 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Theming 9 | */ 10 | @import "jquery.ui.base.css"; 11 | @import "jquery.ui.theme.css"; 12 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/instrument/Violin.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.instrument; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class Violin implements Instrument { 7 | 8 | public Violin() { 9 | } 10 | 11 | @Override 12 | public void play() { 13 | System.out.println("弹奏小提琴"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/data/nosql/elasticsearch/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.elasticsearch.uris = http://localhost:9200 2 | spring.elasticsearch.socket-timeout = 10s 3 | #spring.elasticsearch.username=user 4 | #spring.elasticsearch.password=secret 5 | spring.data.elasticsearch.repositories.enabled = true 6 | spring.elasticsearch.restclient.sniffer.interval = 10m 7 | spring.elasticsearch.restclient.sniffer.delay-after-failure = 30s 8 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/java/example/spring/data/orm/mybatis/mapper/UserInfoMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import example.spring.data.orm.mybatis.model.UserInfo; 4 | import example.spring.data.orm.mybatis.util.MyMapper; 5 | 6 | /** 7 | * @author liuzh_3nofxnp 8 | * @since 2016-01-22 22:17 9 | */ 10 | public interface UserInfoMapper extends MyMapper { 11 | } 12 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/test/java/io/github/dunwu/springboot/DisabledTestsDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.junit.jupiter.api.Disabled; 4 | import org.junit.jupiter.api.Test; 5 | 6 | class DisabledTestsDemo { 7 | 8 | @Test 9 | void testWillBeExecuted() { 10 | } 11 | 12 | @Disabled 13 | @Test 14 | void testWillBeSkipped() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/web/MyRestResponse.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | public class MyRestResponse { 4 | 5 | private String message; 6 | 7 | public MyRestResponse(String message) { 8 | this.message = message; 9 | } 10 | 11 | public String getMessage() { 12 | return this.message; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/instrument/Piano.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.instrument; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service("piano") 6 | public class Piano implements Instrument { 7 | 8 | public Piano() { 9 | } 10 | 11 | @Override 12 | public void play() { 13 | System.out.println("弹奏钢琴"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/life/UserFactory.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.life; 2 | 3 | import example.spring.core.bean.entity.person.User; 4 | 5 | /** 6 | * {@link User} 工厂类 7 | * 8 | * @author Mercy 9 | */ 10 | public interface UserFactory { 11 | 12 | default User createUser() { 13 | return User.createUser(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/data/nosql/elasticsearch/src/main/java/example/spring/data/nosql/elasticsearch/service/CustomersInterface.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.elasticsearch.service; 2 | 3 | import example.spring.data.nosql.elasticsearch.model.Person; 4 | 5 | import java.util.List; 6 | 7 | public interface CustomersInterface { 8 | 9 | List searchCity(Integer pageNumber, Integer pageSize, String searchContent); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-multi-datasource/src/main/java/example/spring/data/orm/mybatis/mapper/Db1UserMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import com.baomidou.dynamic.datasource.annotation.DS; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import example.spring.data.orm.mybatis.entity.User; 6 | 7 | @DS("db1") 8 | public interface Db1UserMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-multi-datasource/src/main/java/example/spring/data/orm/mybatis/mapper/Db2UserMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import com.baomidou.dynamic.datasource.annotation.DS; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import example.spring.data.orm.mybatis.entity.User; 6 | 7 | @DS("db2") 8 | public interface Db2UserMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-authentication/README.md: -------------------------------------------------------------------------------- 1 | # spring-boot-security-authentication 2 | 3 | 示例使用说明: 4 | 5 | 1. 执行 maven 构建 6 | 2. 执行 `io.github.dunwu.springboot.security.SecurityAuthApplication#main` 7 | 3. 在浏览器中访问 localhost:8080,可以看到登录页面 8 | ![](https://raw.githubusercontent.com/dunwu/images/master/snap/20221008182928.png) 9 | 4. 使用以下账户可以完成登录: 10 | - admin/admin 11 | - user1/123456 12 | - user2/qweasd 13 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/java/example/spring/web/IndexController.java: -------------------------------------------------------------------------------- 1 | package example.spring.web; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class IndexController { 8 | 9 | @RequestMapping(value = { "", "/", "index" }) 10 | public String index() { 11 | return "index"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/instrument/Guitar.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.instrument; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service("guitar") 6 | public class Guitar implements Instrument { 7 | 8 | public Guitar() { 9 | } 10 | 11 | @Override 12 | public void play() { 13 | System.out.println("弹奏吉他"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/main/java/io/github/dunwu/spring/libs/lombok/Person.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.lombok; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | /** 7 | * @author Zhang Peng 8 | */ 9 | @Data 10 | @ToString(exclude = "age") 11 | public class Person { 12 | 13 | private String name; 14 | 15 | private Integer age; 16 | 17 | private String sex; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/splitbutton.css: -------------------------------------------------------------------------------- 1 | .s-btn:hover .m-btn-line, 2 | .s-btn-active .m-btn-line, 3 | .s-btn-plain-active .m-btn-line { 4 | display: inline-block; 5 | } 6 | 7 | .l-btn:hover .s-btn-downarrow, 8 | .s-btn-active .s-btn-downarrow, 9 | .s-btn-plain-active .s-btn-downarrow { 10 | border-style: solid; 11 | border-color: #BBBBBB; 12 | border-width: 0 0 0 1px; 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/aop/src/main/java/example/spring/core/aop/entity/Instrumentalist.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.aop.entity; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public class Instrumentalist implements Performer { 7 | 8 | @Override 9 | public String perform() { 10 | String action = "play a song"; 11 | System.out.println(action); 12 | return action; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/main/java/io/github/dunwu/springboot/HelloService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2019-12-13 8 | */ 9 | @Service 10 | public class HelloService { 11 | 12 | public String hello() { 13 | return "Hello World"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/UserGroup.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | import java.util.Set; 4 | 5 | public class UserGroup { 6 | 7 | private Set users; 8 | 9 | public Set getUsers() { 10 | return users; 11 | } 12 | 13 | public void setUsers(Set aUsers) { 14 | users = aUsers; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-rpc/spring-integration-rpc-consumer/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | ###set log levels### 2 | log4j.rootLogger = info, stdout 3 | ###输出到控制台### 4 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.Target = System.out 6 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 7 | log4j.appender.stdout.layout.ConversionPattern = [%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n 8 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-rpc/spring-integration-rpc-provider/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | ###set log levels### 2 | log4j.rootLogger = info, stdout 3 | ###输出到控制台### 4 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.Target = System.out 6 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout 7 | log4j.appender.stdout.layout.ConversionPattern = [%d{dd/MM/yy hh:mm:ss:sss z}] %t %5p %c{2}: %m%n 8 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/life/Auditorium.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.life; 2 | 3 | public class Auditorium { 4 | 5 | public void work() { 6 | System.out.println("工作"); 7 | } 8 | 9 | public void turnOnLight() { 10 | System.out.println("开灯"); 11 | } 12 | 13 | public void turnOffLight() { 14 | System.out.println("关灯"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/core/property/src/main/resources/prop/random.properties: -------------------------------------------------------------------------------- 1 | # 随机属性 2 | # @see @see org.springframework.boot.env.RandomValuePropertySource 3 | # 属性 key 可以使用 '-' '_' 分隔,或驼峰命名、全部大写 4 | dunwu.random.secret = ${random.value} 5 | dunwu.random.number = ${random.int} 6 | dunwu.random.bigNumber = ${random.long} 7 | dunwu.random.uuid = ${random.uuid} 8 | dunwu.random.less-than-ten-num = ${random.int(10)} 9 | dunwu.random.in_range-num = ${random.int[1024,65536]} 10 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-mq-rabbitmq/consumer/src/main/java/example/spring/trace/sleuth/rmq/MySink.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth.rmq; 2 | 3 | import org.springframework.cloud.stream.annotation.Input; 4 | import org.springframework.messaging.SubscribableChannel; 5 | 6 | public interface MySink { 7 | 8 | String RMQ_INPUT1 = "rmq-input1"; 9 | 10 | @Input(RMQ_INPUT1) 11 | SubscribableChannel rmqInput1(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/support/logstash.conf: -------------------------------------------------------------------------------- 1 | # 这个配置文件用于 ELK 的 logstash 配置 2 | 3 | input { 4 | # stdin { } 5 | tcp { 6 | # host:port就是上面appender中的 destination, 7 | # 这里其实把logstash作为服务,开启9250端口接收logback发出的消息 8 | host => "127.0.0.1" port => 9250 mode => "server" tags => ["tags"] codec => json_lines 9 | } 10 | } 11 | output { 12 | elasticsearch { hosts => ["localhost:9200"] } 13 | stdout { codec => rubydebug } 14 | } 15 | -------------------------------------------------------------------------------- /codes/web/form/src/main/java/example/spring/web/form/WebFormApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.form; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebFormApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebFormApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/banner/src/main/java/example/spring/core/banner/BannerApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.banner; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BannerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BannerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/SpringIocApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.core; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringIocApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringIocApplication.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/autowire/Poetry.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.autowire; 2 | 3 | public class Poetry { 4 | 5 | String name; 6 | 7 | public Poetry(String name) { 8 | this.name = name; 9 | } 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | 15 | public void setName(String name) { 16 | this.name = name; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-plus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:p6spy:h2:mem:test 2 | spring.datasource.driver-class-name = com.p6spy.engine.spy.P6SpyDriver 3 | spring.datasource.username = sa 4 | spring.datasource.password = 5 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 6 | spring.sql.init.mode = always 7 | spring.sql.init.schema-locations = classpath:sql/schema-h2.sql 8 | spring.sql.init.data-locations = classpath:sql/data-h2.sql 9 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/UserPrime.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public class UserPrime { 4 | 5 | private StatusPrime statusPrime; 6 | 7 | public StatusPrime getStatusPrime() { 8 | return statusPrime; 9 | } 10 | 11 | public void setStatusPrime(StatusPrime statusPrime) { 12 | this.statusPrime = statusPrime; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-thymeleaf/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Thymeleaf 模板引擎 6 | 7 | 8 |

Thymeleaf 模板引擎

9 |

Exception:

10 |
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/error/403.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | 5 | 6 | 7 | 403 - 用户权限不足 8 | 9 | 10 | 11 |

403 - 用户权限不足.

12 |

">返回首页

13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/web/multipart/src/main/java/example/spring/web/multipart/StorageFileNotFoundException.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.multipart; 2 | 3 | public class StorageFileNotFoundException extends StorageException { 4 | 5 | public StorageFileNotFoundException(String message) { 6 | super(message); 7 | } 8 | 9 | public StorageFileNotFoundException(String message, Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/validation/src/main/java/example/spring/core/validation/annotation/AddCheck.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.validation.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ ElementType.FIELD, ElementType.PARAMETER }) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface AddCheck { 11 | } 12 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-mq-kafka/consumer/src/main/java/example/spring/trace/sleuth/kafka/MySink.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth.kafka; 2 | 3 | import org.springframework.cloud.stream.annotation.Input; 4 | import org.springframework.messaging.SubscribableChannel; 5 | 6 | public interface MySink { 7 | 8 | String KAFKA_INPUT1 = "kafka-input1"; 9 | 10 | @Input(KAFKA_INPUT1) 11 | SubscribableChannel kafkaInput1(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/WEB-INF/views/views/html.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | 4 | 5 | My HTML View 6 | " rel="stylesheet" type="text/css" /> 7 | 8 | 9 |
10 |

foo: "${foo}"

11 |

fruit: "${fruit}"

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/web/view/react/backend/src/main/java/example/spring/web/WebReactApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.web; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebReactApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebReactApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/core/data-binding/src/main/java/example/spring/core/binding/TestBean.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.binding; 2 | 3 | public class TestBean { 4 | 5 | private int num; 6 | 7 | public int getNum() { 8 | return num; 9 | } 10 | 11 | public void setNum(int num) { 12 | this.num = num; 13 | } 14 | 15 | @Override 16 | public String toString() { 17 | return "TestBean{" + "num=" + num + '}'; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/core/validation/src/main/java/example/spring/core/validation/annotation/EditCheck.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.validation.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ ElementType.FIELD, ElementType.PARAMETER }) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface EditCheck { 11 | } 12 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/java/example/spring/data/orm/mybatis/util/MyMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.util; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import tk.mybatis.mapper.common.MySqlMapper; 5 | 6 | /** 7 | * 继承自己的MyMapper 8 | * 9 | * @author liuzh 10 | * @since 2015-09-06 21:53 11 | */ 12 | public interface MyMapper extends Mapper, MySqlMapper { 13 | //TODO 14 | //FIXME 特别注意,该接口不能被扫描到,否则会出错 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/application-163.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host = smtp.163.com 2 | spring.mail.username = xxxxxx 3 | spring.mail.password = xxxxxx 4 | spring.mail.properties.mail.smtp.auth = true 5 | spring.mail.properties.mail.smtp.starttls.enable = true 6 | spring.mail.properties.mail.smtp.starttls.required = true 7 | spring.mail.default-encoding = UTF-8 8 | mail.domain = 163.com 9 | mail.from = ${spring.mail.username}@${mail.domain} 10 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/resources/application-qq.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host = smtp.qq.com 2 | spring.mail.username = xxxxxx 3 | spring.mail.password = xxxxxx 4 | spring.mail.properties.mail.smtp.auth = true 5 | spring.mail.properties.mail.smtp.starttls.enable = true 6 | spring.mail.properties.mail.smtp.starttls.required = true 7 | spring.mail.default-encoding = UTF-8 8 | mail.domain = qq.com 9 | mail.from = ${spring.mail.username}@${mail.domain} 10 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/WEB-INF/views/views/viewName.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | 4 | 5 | My HTML View 6 | " rel="stylesheet" type="text/css" /> 7 | 8 | 9 |
10 |

foo: "${foo}"

11 |

fruit: "${fruit}"

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/core/actuator/src/main/java/example/spring/core/actuator/ActuatorApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.actuator; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ActuatorApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ActuatorApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/middleware/sharding/src/main/resources/sql/clear.sql: -------------------------------------------------------------------------------- 1 | DROP DATABASE IF EXISTS master_databases; 2 | DROP DATABASE IF EXISTS slave_databases_0; 3 | DROP DATABASE IF EXISTS slave_databases_1; 4 | 5 | DROP DATABASE IF EXISTS sharding_databases_0; 6 | DROP DATABASE IF EXISTS sharding_databases_1; 7 | 8 | DROP DATABASE IF EXISTS sharding_databases_tables_0; 9 | DROP DATABASE IF EXISTS sharding_databases_tables_1; 10 | 11 | DROP DATABASE IF EXISTS sharding_tables; 12 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/UserGroupPrime.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | import java.util.List; 4 | 5 | public class UserGroupPrime { 6 | 7 | private List users; 8 | 9 | public List getUsers() { 10 | return users; 11 | } 12 | 13 | public void setUsers(List aUsers) { 14 | users = aUsers; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-swagger/README.md: -------------------------------------------------------------------------------- 1 | # spring-tutorial-integration-api 2 | 3 | > 本项目展示如何使用 spring mvc + swagger-ui 动态生成 API 平台。 4 | 5 | **运行方法** 6 | 7 | ```bash 8 | $ cd spring-tutorial/codes/integration/api 9 | $ mvn jetty:run -Dmaven.test.skip=true 10 | ``` 11 | 12 | 运行后访问:http://localhost:8089/spring-tutorial-integration-api/ 13 | 14 | 进入首页后,点击访问API文档,进入 API 文档页面。 15 | 16 | **效果图** 17 | 18 | 怎么样,还不错吧! 19 | 20 | ![swagger-ui.png](swagger-ui.png) 21 | -------------------------------------------------------------------------------- /codes/core/validation/src/main/java/example/spring/core/validation/ValidatorRule.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.validation; 2 | 3 | import org.springframework.validation.Errors; 4 | 5 | import java.lang.annotation.Annotation; 6 | import java.lang.reflect.Field; 7 | 8 | public interface ValidatorRule { 9 | 10 | boolean support(Annotation annotation); 11 | 12 | void valid(Annotation annotation, Object object, Field field, Errors errors) throws Exception; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/test/java/example/spring/data/cache/TestBean.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.cache; 2 | 3 | import java.io.Serializable; 4 | 5 | public class TestBean implements Serializable { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | private Integer num; 10 | 11 | public Integer getNum() { 12 | return num; 13 | } 14 | 15 | public void setNum(Integer num) { 16 | this.num = num; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/java/example/spring/data/orm/mybatis/mapper/CountryMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import example.spring.data.orm.mybatis.model.Country; 4 | import example.spring.data.orm.mybatis.util.MyMapper; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | public interface CountryMapper extends MyMapper { 8 | 9 | @Select("select * from country limit 1") 10 | Country findOne(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-plus/src/main/java/example/spring/data/orm/mybatis/mapper/User2Mapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import example.spring.data.orm.mybatis.entity.User2; 5 | 6 | /** 7 | *

8 | * MP 支持不需要 UserMapper.xml 测试注解条件 9 | *

10 | * 11 | * @author hubin 12 | * @since 2021-08-19 13 | */ 14 | public interface User2Mapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/integration/distributed/spring-boot-dubbo/spring-boot-dubbo-api/src/main/java/io/github/dunwu/springboot/dubbo/api/InfoDto.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.dubbo.api; 2 | 3 | /** 4 | * @author peng.zhang 5 | * @date 2020/12/7 6 | */ 7 | public class InfoDto { 8 | 9 | private Integer id; 10 | 11 | public Integer getId() { 12 | return id; 13 | } 14 | 15 | public void setId(Integer id) { 16 | this.id = id; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/taglibs.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 4 | <%@ taglib prefix="layout" uri="/WEB-INF/views/jsp/tlds/layout.tld" %> 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/core/actuator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.security.user.name = root 3 | spring.security.user.password = root 4 | # 端点信息接口使用的端口,为了和主系统接口使用的端口进行分离 5 | management.server.port = 18080 6 | management.health.diskspace.enabled = true 7 | # 端点健康情况,默认值"never",设置为"always"可以显示硬盘使用情况和线程情况 8 | management.endpoint.health.show-details = always 9 | # 设置端点暴露的哪些内容,默认["health","info"],设置"*"代表暴露所有可访问的端点 10 | management.endpoints.web.exposure.include = * 11 | -------------------------------------------------------------------------------- /codes/core/aop/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | author.name = Zhang Peng 2 | throw.exception = false 3 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_tutorial?serverTimezone=UTC 4 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 5 | spring.datasource.username = root 6 | spring.datasource.password = root 7 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 8 | spring.sql.init.mode = always 9 | spring.sql.init.schema-locations = classpath:sql/schema.sql 10 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/action/TestD.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.action; 2 | 3 | import lombok.Getter; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class TestD { 9 | 10 | @Getter 11 | private final TestC testC; 12 | 13 | @Autowired 14 | public TestD(TestC testC) { 15 | this.testC = testC; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-mail/src/main/java/io/github/dunwu/springboot/mail/MailApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.mail; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MailApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MailApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-plus/src/main/java/example/spring/data/orm/mybatis/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import example.spring.data.orm.mybatis.entity.User; 5 | 6 | /** 7 | *

8 | * MP 支持不需要 UserMapper.xml 这个模块演示内置 CRUD 咱们就不要 XML 部分了 9 | *

10 | * 11 | * @author hubin 12 | * @since 2018-08-11 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/data/cache/basics/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/cache/jetcache/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO user (name, age, address, email) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-logging/src/main/java/io/github/dunwu/springboot/logging/web/HelloController.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.logging.web; 2 | 3 | import org.springframework.web.bind.annotation.*; 4 | 5 | @RestController 6 | public class HelloController { 7 | 8 | @ResponseBody 9 | @RequestMapping(value = { "/", "/hello" }, method = RequestMethod.GET) 10 | public String hello(@RequestParam String name) { 11 | return "Hello " + name; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-test-junit5/src/main/java/io/github/dunwu/springboot/TestJunit5Application.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TestJunit5Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TestJunit5Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/helloworld/src/main/java/example/spring/web/helloworld/HelloController.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.helloworld; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @Slf4j 8 | @RestController 9 | public class HelloController { 10 | 11 | @RequestMapping("hello") 12 | public String index() { 13 | return "Hello World"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/containers/Root/RootContainer.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Root 容器模块是 antd-admin 的根组件 3 | * @author Zhang Peng 4 | * @see http://gaearon.github.io/react-hot-loader/getstarted/ 5 | */ 6 | if (process.env.NODE_ENV === 'development') { 7 | module.exports = require('./RootContainer.dev'); 8 | console.log('[development] Root.dev started.') 9 | } else { 10 | module.exports = require('./RootContainer.prod'); 11 | console.log('[production] Root.prod started.') 12 | } 13 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/hello.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=UTF-8" %> 2 | <%@ include file="/WEB-INF/views/jsp/taglibs.jsp" %> 3 | 4 | 5 |

HelloWorld 示例

6 |
7 | 8 |

${message}

9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/.vuepress/plugins/love-me/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const LoveMyPlugin = (options = {}) => ({ 3 | define() { 4 | const COLOR = 5 | options.color || 6 | 'rgb(' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ')' 7 | const EXCLUDECLASS = options.excludeClassName || '' 8 | return { COLOR, EXCLUDECLASS } 9 | }, 10 | enhanceAppFiles: [path.resolve(__dirname, 'love-me.js')] 11 | }) 12 | module.exports = LoveMyPlugin 13 | -------------------------------------------------------------------------------- /codes/core/validation/src/main/java/example/spring/core/validation/annotation/Valid.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.validation.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Documented 10 | @Target(ElementType.ANNOTATION_TYPE) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface Valid { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis/src/main/java/example/spring/data/orm/mybatis/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import example.spring.data.orm.mybatis.entity.User; 4 | 5 | import java.util.List; 6 | 7 | public interface UserMapper { 8 | 9 | int deleteByPrimaryKey(Long id); 10 | 11 | int insert(User record); 12 | 13 | User selectByPrimaryKey(Long id); 14 | 15 | List selectAll(); 16 | 17 | int updateByPrimaryKey(User record); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/web/fastjson/src/main/java/example/spring/web/fastjson/SpringBootWebFastjsonApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.fastjson; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebFastjsonApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebFastjsonApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/https/src/main/java/example/spring/web/https/entity/CityInfo.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.https.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class CityInfo { 11 | 12 | private String city; 13 | 14 | private String citykey; 15 | 16 | private String parent; 17 | 18 | private String updateTime; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /docs/.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD002": false, 4 | "MD004": { "style": "dash" }, 5 | "ul-indent": { "indent": 2 }, 6 | "MD013": { "line_length": 600 }, 7 | "MD024": false, 8 | "MD025": false, 9 | "MD026": false, 10 | "MD029": { "style": "ordered" }, 11 | "MD033": false, 12 | "MD034": false, 13 | "MD036": false, 14 | "fenced-code-language": false, 15 | "no-hard-tabs": false, 16 | "whitespace": false, 17 | "emphasis-style": { "style": "consistent" } 18 | } 19 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/Super.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 超级 10 | * 11 | * @author Mercy 12 | */ 13 | @Target(ElementType.TYPE) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface Super { 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/client/src/main/java/example/spring/web/client/entity/CityInfo.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.client.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class CityInfo { 11 | 12 | private String city; 13 | 14 | private String citykey; 15 | 16 | private String parent; 17 | 18 | private String updateTime; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/web/form/src/main/resources/templates/results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Handling Form Submission 5 | 6 | 7 | 8 |

Result

9 |

10 |

11 | Submit another message 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO `user` (`name`, `age`, `address`, `email`) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO `user` (`name`, `age`, `address`, `email`) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/core/bean/src/main/java/example/spring/core/bean/User.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import lombok.ToString; 7 | 8 | /** 9 | * @author Zhang Peng 10 | * @since 2018-11-02 11 | */ 12 | @Data 13 | @ToString 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class User { 17 | 18 | private Long id; 19 | 20 | private String name; 21 | 22 | private String info; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/data/jdbc/basics/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/jdbc/druid/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/orm/jpa/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis/src/main/java/example/spring/data/orm/mybatis/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import example.spring.data.orm.mybatis.entity.Order; 4 | 5 | import java.util.List; 6 | 7 | public interface OrderMapper { 8 | 9 | int deleteByPrimaryKey(Integer id); 10 | 11 | int insert(Order record); 12 | 13 | Order selectByPrimaryKey(Integer id); 14 | 15 | List selectAll(); 16 | 17 | int updateByPrimaryKey(Order record); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/integration/mq/spring-boot-mq-kafka/src/main/java/io/github/dunwu/springboot/SpringBootMsgKafkaApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMsgKafkaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMsgKafkaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/SpringBootWebJspApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebJspApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebJspApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/log.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=UTF-8" %> 2 | <%@ include file="/WEB-INF/views/jsp/taglibs.jsp" %> 3 | 4 | 5 |

日志示例

6 | 7 | 8 |

进入本页面后,后台应用会自动打印日志。

9 |

打印信息:${message}

10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/components/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 本项目二次封装的 UI 组件入口 3 | * @author Zhang Peng 4 | */ 5 | 6 | /****************************** 布局组件 ******************************/ 7 | export {default as Header} from './layout/Header/Header' 8 | export {default as Sidebar} from './layout/Sidebar/Sidebar' 9 | export {default as Content} from './layout/Content/Content' 10 | export {default as Footer} from './layout/Footer/Footer' 11 | export {default as Breadcrumb} from './layout/Breadcrumb/Breadcrumb' 12 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/main/java/example/spring/data/nosql/redis/quickstart/UserService.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.redis.quickstart; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 用户服务 7 | * 8 | * @author Zhang Peng 9 | * @since 2019-10-14 10 | */ 11 | public interface UserService { 12 | 13 | void batchSetUsers(Map users); 14 | 15 | long count(); 16 | 17 | User getUser(Long id); 18 | 19 | void setUser(User user); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/java/io/github/dunwu/springboot/security/filter/DunwuSecurityException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.filter; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | 5 | public class DunwuSecurityException extends AuthenticationException { 6 | 7 | private static final long serialVersionUID = 5022575393500654458L; 8 | 9 | public DunwuSecurityException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | --------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | --------------------------------------------- 4 | 5 | INSERT INTO `account` (`username`, `password`, `email`) 6 | VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com'); 7 | 8 | INSERT INTO `account` (`username`, `password`, `email`) 9 | VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com'); 10 | -------------------------------------------------------------------------------- /codes/data/jdbc/multi-datasource/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO `t_user` (`name`, `age`, `address`, `email`) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/data/middleware/flyway/src/main/resources/sql/V2__Add_user.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | INSERT INTO `user` (`name`, `age`, `address`, `email`) 8 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 9 | INSERT INTO `user` (`name`, `age`, `address`, `email`) 10 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 11 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-opentracing/src/main/java/example/spring/trace/sleuth/SleuthOpenTracingApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SleuthOpenTracingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SleuthOpenTracingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/java/io/github/dunwu/springboot/security/filter/DunwuSecurityException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.filter; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | 5 | public class DunwuSecurityException extends AuthenticationException { 6 | 7 | private static final long serialVersionUID = 5022575393500654458L; 8 | 9 | public DunwuSecurityException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | --------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | --------------------------------------------- 4 | 5 | INSERT INTO `account` (`username`, `password`, `email`) 6 | VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com'); 7 | 8 | INSERT INTO `account` (`username`, `password`, `email`) 9 | VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com'); 10 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/error/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | <%response.setStatus(200);%> 5 | 6 | 7 | 8 | 9 | 404 - 页面不存在 10 | 11 | 12 | 13 |

404 - 页面不存在.

14 |

">返回首页

15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/java/example/spring/web/mvc/simple/SimpleController.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.mvc.simple; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | @Controller 8 | public class SimpleController { 9 | 10 | @RequestMapping("/simple") 11 | public @ResponseBody 12 | String simple() { 13 | return "Hello world!"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/connections/src/main/java/example/spring/web/connections/entity/CityInfo.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.connections.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class CityInfo { 11 | 12 | private String city; 13 | 14 | private String citykey; 15 | 16 | private String parent; 17 | 18 | private String updateTime; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis/src/main/java/example/spring/data/orm/mybatis/mapper/ProductMapper.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.orm.mybatis.mapper; 2 | 3 | import example.spring.data.orm.mybatis.entity.Product; 4 | 5 | import java.util.List; 6 | 7 | public interface ProductMapper { 8 | 9 | int deleteByPrimaryKey(Integer id); 10 | 11 | int insert(Product record); 12 | 13 | Product selectByPrimaryKey(Integer id); 14 | 15 | List selectAll(); 16 | 17 | int updateByPrimaryKey(Product record); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-freemark/src/main/resources/templates/web/exception.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

HTTP Request Status: ${status}

7 |
8 |

导航:

9 | 15 |
16 |

${info}

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/WEB-INF/views/views/dataBinding.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | 4 | 5 | Data Binding with URI Template Variables 6 | " rel="stylesheet" type="text/css" /> 7 | 8 | 9 |
10 |

javaBean.foo: ${javaBean.foo}

11 |

javaBean.fruit: ${javaBean.fruit}

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/web/helloworld/src/main/java/example/spring/web/helloworld/WebHelloWorldApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.helloworld; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @Slf4j 8 | @SpringBootApplication 9 | public class WebHelloWorldApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(WebHelloWorldApplication.class); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/web/sse/src/main/java/example/spring/web/sse/WebSseApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.sse; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.web.bind.annotation.CrossOrigin; 6 | 7 | @CrossOrigin 8 | @SpringBootApplication 9 | public class WebSseApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(WebSseApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/mq/spring-boot-mq-kafka/src/test/java/io/github/dunwu/springboot/KafkaTestBean.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | import lombok.experimental.Accessors; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * @author Zhang Peng 11 | * @since 2019-11-20 12 | */ 13 | @Data 14 | @ToString 15 | @Accessors(chain = true) 16 | public class KafkaTestBean { 17 | 18 | Date timestamp; 19 | 20 | T data; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-session/src/main/java/io/github/dunwu/springboot/security/mapper/AccountMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.domain.Account; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author Zhang Peng 12 | * @since 2019-09-17 13 | */ 14 | public interface AccountMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/java/example/spring/web/mvc/data/custom/RequestAttribute.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.mvc.data.custom; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target(ElementType.PARAMETER) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Documented 12 | public @interface RequestAttribute { 13 | 14 | String value(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/web/view/easyui/src/main/resources/static/lib/easyui/themes/bootstrap/filebox.css: -------------------------------------------------------------------------------- 1 | .filebox .textbox-value { 2 | vertical-align: top; 3 | position: absolute; 4 | top: 0; 5 | left: -5000px; 6 | } 7 | 8 | .filebox-label { 9 | display: inline-block; 10 | position: absolute; 11 | width: 100%; 12 | height: 100%; 13 | cursor: pointer; 14 | left: 0; 15 | top: 0; 16 | z-index: 10; 17 | background: url('images/blank.gif') no-repeat; 18 | } 19 | 20 | .l-btn-disabled .filebox-label { 21 | cursor: default; 22 | } 23 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/redux/actions/menu.js: -------------------------------------------------------------------------------- 1 | const webapi = require('../../webapi') 2 | import { REFRESH_MENU, REFRESH_NAVPATH } from '../constants/menuActionType' 3 | 4 | export const refreshNavPath = (path, key) => { 5 | return { 6 | type: REFRESH_NAVPATH, 7 | payload: { 8 | data: path, 9 | key: key 10 | } 11 | } 12 | } 13 | 14 | export const refreshMenu = () => { 15 | return { 16 | type: REFRESH_MENU, 17 | payload: { 18 | promise: webapi.get('/menu') 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/action/TestC.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.action; 2 | 3 | import lombok.Getter; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.annotation.Lazy; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class TestC { 10 | 11 | @Getter 12 | private final TestD testD; 13 | 14 | @Autowired 15 | public TestC(@Lazy TestD testD) { 16 | this.testD = testD; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/security/spring-boot-security-checkcode/src/main/java/io/github/dunwu/springboot/security/mapper/AccountMapper.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.security.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import io.github.dunwu.springboot.security.domain.Account; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author Zhang Peng 12 | * @since 2019-09-17 13 | */ 14 | public interface AccountMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/security/spring-security-shiro/src/main/java/io/github/dunwu/spring/security/shiro/dao/PermissionDao.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.security.shiro.dao; 2 | 3 | import io.github.dunwu.spring.security.shiro.entity.Permission; 4 | 5 | /** 6 | *

7 | * User: Zhang Kaitao 8 | *

9 | * Date: 14-1-28 10 | *

11 | * Version: 1.0 12 | */ 13 | public interface PermissionDao { 14 | 15 | public Permission createPermission(Permission permission); 16 | 17 | public void deletePermission(Long permissionId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-feign/src/main/java/example/spring/trace/sleuth/SampleFeignClient.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth; 2 | 3 | import org.springframework.cloud.openfeign.FeignClient; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | 7 | @FeignClient(name = "sleuth-web", url = "http://127.0.0.1:8080") 8 | public interface SampleFeignClient { 9 | 10 | @GetMapping("/hello") 11 | String hello(@RequestParam String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-thymeleaf/src/main/java/io/github/dunwu/springboot/SpringBootTmplThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootTmplThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootTmplThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/resources/jqueryui/1.8/themes/base/jquery.ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("jquery.ui.core.css"); 2 | @import url("jquery.ui.resizable.css"); 3 | @import url("jquery.ui.selectable.css"); 4 | @import url("jquery.ui.accordion.css"); 5 | @import url("jquery.ui.autocomplete.css"); 6 | @import url("jquery.ui.button.css"); 7 | @import url("jquery.ui.dialog.css"); 8 | @import url("jquery.ui.slider.css"); 9 | @import url("jquery.ui.tabs.css"); 10 | @import url("jquery.ui.datepicker.css"); 11 | @import url("jquery.ui.progressbar.css"); -------------------------------------------------------------------------------- /codes/web/websocket/src/main/java/example/spring/web/websocket/echo/DefaultEchoService.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.websocket.echo; 2 | 3 | public class DefaultEchoService implements EchoService { 4 | 5 | private final String echoFormat; 6 | 7 | public DefaultEchoService(String echoFormat) { 8 | this.echoFormat = (echoFormat != null) ? echoFormat : "%s"; 9 | } 10 | 11 | @Override 12 | public String getMessage(String message) { 13 | return String.format(this.echoFormat, message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /docs/01.Java/13.框架/01.Spring/01.Spring核心/24.SpringEL.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Spring EL 表达式 3 | date: 2023-01-12 20:26:46 4 | order: 24 5 | categories: 6 | - Java 7 | - 框架 8 | - Spring 9 | - Spring核心 10 | tags: 11 | - Java 12 | - 框架 13 | - Spring 14 | permalink: /pages/1f743f/ 15 | --- 16 | 17 | # Spring EL 表达式 18 | 19 | ## 参考资料 20 | 21 | - [Spring 官方文档之 Core Technologies](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans) 22 | - [《小马哥讲 Spring 核心编程思想》](https://time.geekbang.org/course/intro/265) -------------------------------------------------------------------------------- /codes/core/bean/src/main/java/example/spring/core/bean/Company.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Lombok 示例 9 | * 10 | * @author Zhang Peng 11 | * @see http://jnb.ociweb.com/jnb/jnbJan2010.html 12 | */ 13 | @Data(staticConstructor = "of") 14 | public class Company { 15 | 16 | private final Person founder; 17 | 18 | protected List employees; 19 | 20 | private String name; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/entity/job/Musician.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.entity.job; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 音乐家 7 | */ 8 | @Data 9 | public class Musician implements Performer { 10 | 11 | private String name; 12 | 13 | private String song; 14 | 15 | private Instrument instrument; 16 | 17 | public Musician() { } 18 | 19 | @Override 20 | public void perform() { 21 | System.out.printf("%s%s:%s%n", name, instrument.play(), song); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/distributed/trace/opentelemetry/async/src/main/java/example/spring/trace/opentelemetry/DemoService.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.opentelemetry; 2 | 3 | import org.springframework.scheduling.annotation.Async; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class DemoService { 8 | 9 | @Async 10 | public void async() { 11 | System.out.println("DemoService.async begin. thread: " + Thread.currentThread().getId()); 12 | System.out.println("DemoService.async end. "); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | > Remoting, JMS, JCA, JMX, Email, Tasks, Scheduling, Cache. 4 | 5 | ## 示例 6 | 7 | - **spring-tutorial-integration-api** 本项目展示如何使用 spring mvc + swagger-ui 动态生成 API 平台。 8 | - **spring-tutorial-integration-3party** spring 集成第三方库。 9 | - **spring-tutorial-integration-cache** spring 集成 ehcache 实现缓存方案。 10 | - **spring-tutorial-integration-rmi** spring 的远程调用范例。分为 server 端和 client 端。 11 | - **spring-tutorial-integration-rpc** spring 集成 dubbo 实现远程服务化调用。 12 | - **spring-tutorial-integration-scheduler** spring 的调度任务范例。 13 | -------------------------------------------------------------------------------- /codes/web/basic/helloworld/src/main/webapp/WEB-INF/views/jsp/welcome.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html; charset=UTF-8" %> 2 | <%@ include file="/WEB-INF/views/jsp/taglibs.jsp" %> 3 | 4 | 5 |

Welcome

6 | 7 | 8 |

Welcome to use spring-tutorial.

9 |

Current time is: ${time}

10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/web/view/react/frontend/src/redux/store/configureStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Redux 创建Store入口,区分开发、生产环境 3 | * @author Zhang Peng 4 | * @see https://github.com/gaearon/redux-devtools/blob/master/docs/Walkthrough.md 5 | */ 6 | // Use DefinePlugin (Webpack) or loose-envify (Browserify) 7 | // together with Uglify to strip the dev branch in prod build. 8 | if (process.env.NODE_ENV === 'development') { 9 | module.exports = require('./configureStore.dev').default 10 | } else { 11 | module.exports = require('./configureStore.prod').default 12 | } 13 | -------------------------------------------------------------------------------- /codes/data/nosql/mongodb/src/main/java/example/spring/data/nosql/mongodb/entity/Address.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.mongodb.entity; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | import org.springframework.data.geo.Point; 6 | 7 | /** 8 | * A domain object to capture addresses. 9 | * 10 | * @author Oliver Gierke 11 | */ 12 | @Getter 13 | @RequiredArgsConstructor 14 | public class Address { 15 | 16 | private final Point location; 17 | private String street; 18 | private String zipCode; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /codes/security/spring-security-shiro/src/main/java/io/github/dunwu/spring/security/shiro/service/PermissionService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.security.shiro.service; 2 | 3 | import io.github.dunwu.spring.security.shiro.entity.Permission; 4 | 5 | /** 6 | *

7 | * User: Zhang Kaitao 8 | *

9 | * Date: 14-1-28 10 | *

11 | * Version: 1.0 12 | */ 13 | public interface PermissionService { 14 | 15 | public Permission createPermission(Permission permission); 16 | 17 | public void deletePermission(Long permissionId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/main/resources/application-sentinel.properties: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 连接 Redis 哨兵集群配置示例 3 | ############################################################# 4 | spring.redis.timeout = 3000ms 5 | spring.redis.database = 15 6 | spring.redis.cluster.max-redirects = 2 7 | # redis sentinel 连接配置方式 8 | spring.redis.sentinel.master = redis-master 9 | spring.redis.sentinel.nodes[0] = 127.0.0.1:7000 10 | spring.redis.sentinel.nodes[1] = 127.0.0.1:7001 11 | spring.redis.sentinel.nodes[2] = 127.0.0.1:7002 12 | -------------------------------------------------------------------------------- /codes/integration/mq/spring-boot-mq-rabbitmq/src/main/java/io/github/dunwu/springboot/RabbitConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot; 2 | 3 | import org.springframework.amqp.core.Queue; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class RabbitConfiguration { 9 | 10 | private final static String QUEUE_NAME = "test"; 11 | 12 | @Bean 13 | public Queue queue() { 14 | return new Queue(QUEUE_NAME); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-scheduler/src/main/java/io/github/dunwu/spring/scheduler/DemoTask.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.scheduler; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * 一个调度任务例子 8 | * 9 | * @author Zhang Peng 10 | * @since 2016年8月31日 11 | */ 12 | public class DemoTask implements Runnable { 13 | 14 | final Logger logger = LoggerFactory.getLogger(this.getClass()); 15 | 16 | @Override 17 | public void run() { 18 | logger.info("call DemoTask.run"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/distributed/trace/opentelemetry/http/server/src/main/java/example/trace/opentelemetry/OpenTelemetryPropagationServerApplication.java: -------------------------------------------------------------------------------- 1 | package example.trace.opentelemetry; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class OpenTelemetryPropagationServerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(OpenTelemetryPropagationServerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/Dest.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public class Dest { 4 | 5 | private long id; 6 | 7 | private Info info; 8 | 9 | public long getId() { 10 | return id; 11 | } 12 | 13 | public void setId(long id) { 14 | this.id = id; 15 | } 16 | 17 | public Info getInfo() { 18 | return info; 19 | } 20 | 21 | public void setInfo(Info info) { 22 | this.info = info; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/factory/BeanFactory.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.factory; 2 | 3 | public class BeanFactory { 4 | 5 | private BeanFactory() { } 6 | 7 | public static BeanFactory getInstance() { 8 | return StageSingletonHolder.instance; 9 | } 10 | 11 | public void work() { 12 | System.out.println("工作"); 13 | } 14 | 15 | private static class StageSingletonHolder { 16 | 17 | static BeanFactory instance = new BeanFactory(); 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/resources/META-INF/spring-life.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/java/example/spring/web/mvc/convert/MaskFormat.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.mvc.convert; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Documented 12 | public @interface MaskFormat { 13 | 14 | String value(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/factory/App.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.factory; 2 | 3 | import org.springframework.context.support.ClassPathXmlApplicationContext; 4 | 5 | public class App { 6 | 7 | public static void main(String[] args) { 8 | ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/META-INF/spring-inject.xml"); 9 | BeanFactory beanFactory = ((BeanFactory) ctx.getBean("beanFactory")); 10 | beanFactory.work(); 11 | ctx.close(); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/resources/META-INF/bean/BeanLifeCycle.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /codes/data/jdbc/basics/src/main/java/example/spring/data/jdbc/UserDaoTxService.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.jdbc; 2 | 3 | /** 4 | * 事务服务 5 | * 6 | * @author Zhang Peng 7 | * @since 2023-01-22 8 | */ 9 | public interface UserDaoTxService { 10 | 11 | /** 12 | * 无事务示例 13 | */ 14 | void noTransaction(User entity); 15 | 16 | /** 17 | * 声明式事务示例 18 | */ 19 | void withTransaction(User entity); 20 | 21 | /** 22 | * 编程式事务示例 23 | */ 24 | void withTransaction2(User entity); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /codes/data/nosql/elasticsearch/src/main/java/example/spring/data/nosql/elasticsearch/DataElasticsearchApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.elasticsearch; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @Slf4j 8 | @SpringBootApplication 9 | public class DataElasticsearchApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(DataElasticsearchApplication.class); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-plus/src/main/resources/sql/data-h2.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM `t_user`; 2 | INSERT INTO `t_user` (`id`, `name`, `age`, `email`) 3 | VALUES (1, 'Jone', 18, 'test1@baomidou.com'), 4 | (2, 'Jack', 20, 'test2@baomidou.com'), 5 | (3, 'Tom', 28, 'test3@baomidou.com'), 6 | (4, 'Sandy', 21, 'test4@baomidou.com'), 7 | (5, 'Billie', 24, 'test5@baomidou.com'); 8 | 9 | DELETE FROM `t_user2`; 10 | INSERT INTO `t_user2` (`id`, `name`, `age`) 11 | VALUES (1, 'Jone', 18), 12 | (2, 'Jack', 20), 13 | (3, 'Tom', 28), 14 | (4, 'Sandy', 21), 15 | (5, 'Billie', 24); 16 | -------------------------------------------------------------------------------- /codes/integration/spring-integration-libs/src/test/java/io/github/dunwu/spring/libs/dozer/vo/Source.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.spring.libs.dozer.vo; 2 | 3 | public class Source { 4 | 5 | private long id; 6 | 7 | private String info; 8 | 9 | public long getId() { 10 | return id; 11 | } 12 | 13 | public void setId(long id) { 14 | this.id = id; 15 | } 16 | 17 | public String getInfo() { 18 | return info; 19 | } 20 | 21 | public void setInfo(String info) { 22 | this.info = info; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /codes/web/fastjson/src/main/java/example/spring/web/fastjson/InfoDto.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.fastjson; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * 信息实体 11 | * 12 | * @author Zhang Peng 13 | * @date 2023-02-24 14 | */ 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class InfoDto { 19 | 20 | private String appName; 21 | private String version; 22 | private Date date; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/ioc/Person.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.ioc; 2 | 3 | import java.beans.ConstructorProperties; 4 | 5 | public class Person { 6 | 7 | private final String name; 8 | private final int age; 9 | 10 | @ConstructorProperties({ "name", "age" }) 11 | public Person(String name, int age) { 12 | this.name = name; 13 | this.age = age; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public int getAge() { 21 | return age; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/core/validation/src/main/java/example/spring/core/validation/annotation/ValidRule.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.validation.annotation; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.Documented; 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @Component 12 | @Documented 13 | @Target(ElementType.TYPE) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface ValidRule { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-velocity/src/main/resources/templates/velocity/default/tools.vm: -------------------------------------------------------------------------------- 1 |

\${esc.javascript("http://www.alibaba-inc.com")} : ${esc.javascript("http://www.alibaba-inc.com")}
2 |

3 |

\${esc.xml("http://www.alibaba-inc.com")} : ${esc.xml("http://www.alibaba-inc.com")}
4 |

5 |

\${esc.html("http://www.alibaba-inc.com")} : ${esc.html("http://www.alibaba-inc.com")}
6 |

7 |

\${convert.toDouble("1")} : ${convert.toDouble("1")}
8 | 9 | ${echo.echo("Hello,World")} 10 | ${echo2.echo("Hello,World")} 11 | -------------------------------------------------------------------------------- /codes/web/client/src/main/java/example/spring/web/client/entity/Weather.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.client.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Weather { 11 | 12 | private String message; 13 | 14 | private int status; 15 | 16 | private String date; 17 | 18 | private String time; 19 | 20 | private CityInfo cityInfo; 21 | 22 | private WeatherData data; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/web/https/src/main/java/example/spring/web/https/entity/Weather.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.https.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Weather { 11 | 12 | private String message; 13 | 14 | private int status; 15 | 16 | private String date; 17 | 18 | private String time; 19 | 20 | private CityInfo cityInfo; 21 | 22 | private WeatherData data; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/java/example/spring/core/bean/annotation/life/App.java: -------------------------------------------------------------------------------- 1 | package example.spring.core.bean.annotation.life; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | 8 | public static void main(String[] args) { 9 | ApplicationContext ctx = new ClassPathXmlApplicationContext("/META-INF/spring-life.xml"); 10 | Auditorium auditorium = ((Auditorium) ctx.getBean("auditorium")); 11 | auditorium.work(); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/main/java/example/spring/data/cache/J2cacheApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.cache; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 启动类 8 | * @author Zhang Peng 9 | * @since 2019-10-14 10 | */ 11 | @SpringBootApplication 12 | public class J2cacheApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(J2cacheApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /codes/core/aop/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/async/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/bean/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/form/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/https/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/sse/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/actuator/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/banner/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/conversion/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/property/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/jdbc/druid/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/orm/jpa/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/distributed/trace/sleuth/sleuth-feign/src/main/java/example/spring/trace/sleuth/SleuthFeignApplication.java: -------------------------------------------------------------------------------- 1 | package example.spring.trace.sleuth; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.openfeign.EnableFeignClients; 6 | 7 | @EnableFeignClients 8 | @SpringBootApplication 9 | public class SleuthFeignApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SleuthFeignApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/integration/template/spring-boot-tmpl-jsp/src/main/java/io/github/dunwu/springboot/web/MessageAdvice.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.springboot.web; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.ControllerAdvice; 5 | import org.springframework.web.bind.annotation.ModelAttribute; 6 | 7 | @ControllerAdvice 8 | public class MessageAdvice { 9 | 10 | @ModelAttribute("message") 11 | public String message(@Value("${application.message:Hello World}") String message) { 12 | return message; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/webapp/WEB-INF/views/redirect/redirectResults.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> 3 | <%@ page session="false" %> 4 | 5 | 6 | Redirect Results 7 | " rel="stylesheet" type="text/css" /> 8 | 9 | 10 |
11 |

Path variable 'account': ${account}

12 |

Query param 'date': ${param.date}

13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/client/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/connections/src/main/java/example/spring/web/connections/entity/Weather.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.connections.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class Weather { 11 | 12 | private String message; 13 | 14 | private int status; 15 | 16 | private String date; 17 | 18 | private String time; 19 | 20 | private CityInfo cityInfo; 21 | 22 | private WeatherData data; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/web/connections/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/helloworld/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/multipart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/web/websocket/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/core/profile/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/cache/basics/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/cache/j2cache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/cache/jetcache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/nosql/mongodb/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/nosql/redis/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/integration/spring-boot-scheduling-quartz/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_tutorial?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # quartz settings 6 | #spring.quartz.auto-startup = true 7 | spring.quartz.startup-delay = 60 8 | spring.quartz.job-store-type = jdbc 9 | spring.quartz.jdbc.initialize-schema = always 10 | spring.quartz.jdbc.schema = classpath:sql/schema.sql 11 | -------------------------------------------------------------------------------- /codes/web/multipart/src/main/java/example/spring/web/multipart/StorageService.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.multipart; 2 | 3 | import org.springframework.core.io.Resource; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.nio.file.Path; 7 | import java.util.stream.Stream; 8 | 9 | public interface StorageService { 10 | 11 | void deleteAll(); 12 | 13 | void init(); 14 | 15 | Path load(String filename); 16 | 17 | Stream loadAll(); 18 | 19 | Resource loadAsResource(String filename); 20 | 21 | void store(MultipartFile file); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/data/jdbc/basics/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/middleware/flyway/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/middleware/sharding/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/nosql/elasticsearch/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/nosql/mongodb/src/main/java/example/spring/data/nosql/mongodb/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package example.spring.data.nosql.mongodb.repository; 2 | 3 | import example.spring.data.nosql.mongodb.entity.Role; 4 | import org.springframework.data.repository.PagingAndSortingRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * 角色信息 MongoDB Repository 9 | * 10 | * @author Zhang Peng 11 | * @date 2023-01-29 12 | */ 13 | @Repository 14 | public interface RoleRepository extends PagingAndSortingRepository { 15 | } 16 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-mapper/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis-plus/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/orm/mybatis/src/main/resources/properties/db.properties: -------------------------------------------------------------------------------- 1 | # data source 2 | jdbc.driver = com.mysql.cj.jdbc.Driver 3 | jdbc.url = jdbc:mysql://127.0.0.1:3306/spring_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 4 | jdbc.username = root 5 | jdbc.password = root 6 | #定义初始连接数 7 | initialSize = 0 8 | #定义最大连接数 9 | maxActive = 20 10 | #定义最大空闲 11 | maxIdle = 20 12 | #定义最小空闲 13 | minIdle = 1 14 | #定义最长等待时间 15 | maxWait = 60000 16 | # mybatis plugin settings 17 | mapper.plugin = tk.mybatis.mapper.generator.MapperPlugin 18 | mapper.Mapper = tk.mybatis.mapper.common.Mapper 19 | -------------------------------------------------------------------------------- /codes/web/basic/mvc/src/main/java/example/spring/web/mvc/exceptions/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package example.spring.web.mvc.exceptions; 2 | 3 | import org.springframework.web.bind.annotation.ControllerAdvice; 4 | import org.springframework.web.bind.annotation.ExceptionHandler; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | @ControllerAdvice 8 | public class GlobalExceptionHandler { 9 | 10 | @ExceptionHandler 11 | public @ResponseBody 12 | String handleBusinessException(BusinessException ex) { 13 | return "Handled BusinessException"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/core/ioc/src/main/resources/META-INF/bean/BeanAlias.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/data/jdbc/multi-datasource/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/data/middleware/flyway/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # 启用或禁用 flyway 6 | spring.flyway.enabled = true 7 | # 设置 SQL 脚本的目录,多个路径使用逗号分隔, 比如取值为 classpath:db/migration,filesystem:/sql-migrations 8 | spring.flyway.locations = classpath:sql 9 | # 开发环境最好开启 outOfOrder, 生产环境关闭 outOfOrder 10 | spring.flyway.outOfOrder = true 11 | -------------------------------------------------------------------------------- /codes/data/nosql/basics/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - 6 | %boldBlue(%m%n) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | --------------------------------------------------------------------------------