├── spring-boot-manage-books
├── sql
│ └── final_sql.sql
├── 文档
│ └── 需求.pdf
├── src
│ └── main
│ │ ├── resources
│ │ ├── static
│ │ │ └── lib
│ │ │ │ ├── images
│ │ │ │ ├── qc.jpg
│ │ │ │ ├── qc1.jpg
│ │ │ │ ├── qc2.jpg
│ │ │ │ ├── avatar.jpg
│ │ │ │ ├── managebooks_intro1.png
│ │ │ │ ├── managebooks_intro2.png
│ │ │ │ ├── managebooks_intro3.png
│ │ │ │ ├── managebooks_intro4.png
│ │ │ │ ├── managebooks_intro5.png
│ │ │ │ ├── managebooks_intro6.png
│ │ │ │ └── managebooks_intro7.png
│ │ │ │ └── css
│ │ │ │ └── signin.css
│ │ ├── Mapper
│ │ │ ├── mail.xml
│ │ │ └── user.xml
│ │ ├── application.yml
│ │ └── templates
│ │ │ └── login.html
│ │ └── java
│ │ └── com
│ │ └── gaohanghang
│ │ └── springbootmanagebooks
│ │ ├── entity
│ │ ├── ProcessResult.java
│ │ ├── MailDetail.java
│ │ ├── Reservation.java
│ │ ├── ReservationDetail.java
│ │ ├── Book.java
│ │ ├── BorrowDetail.java
│ │ ├── Borrow.java
│ │ ├── ReservationResult.java
│ │ ├── User.java
│ │ └── BookList.java
│ │ ├── exception
│ │ ├── AddBooklistException.java
│ │ └── ReservationException.java
│ │ ├── service
│ │ ├── UserService.java
│ │ ├── MailService.java
│ │ ├── UserServiceImpl.java
│ │ └── BookService.java
│ │ └── dao
│ │ ├── MailMapper.java
│ │ ├── UserMapper.java
│ │ └── BookMapper.java
└── README.md
├── spring-boot-file
└── src
│ └── main
│ └── resources
│ ├── application.yml
│ ├── settings.properties
│ └── static
│ └── index.html
├── springboot_logstash
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── application.properties
│ │ │ ├── logstash
│ │ │ │ └── springboot.conf
│ │ │ └── logback-spring.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── dalaoyang
│ │ │ └── SpringbootLogstashApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── dalaoyang
│ │ └── SpringbootLogstashApplicationTests.java
└── .gitignore
├── financial-system
├── README.md
├── 文档
│ └── 数据库设计
│ │ ├── 产品表.png
│ │ └── 订单表.png
└── sql
│ ├── seller.sql
│ └── manager.sql
├── spring-boot-mail
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── application.yml
│ │ │ ├── static
│ │ │ │ └── common.js
│ │ │ └── spring-context-dubbo.xml
│ │ ├── webapp
│ │ │ ├── index.jsp
│ │ │ └── WEB-INF
│ │ │ │ └── web.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── gaohanghang
│ │ │ └── mail
│ │ │ ├── common
│ │ │ ├── task
│ │ │ │ └── SendMail.java
│ │ │ ├── Dynamicquery
│ │ │ │ └── NativeQueryResultEntity.java
│ │ │ ├── util
│ │ │ │ ├── Constants.java
│ │ │ │ └── CommonUtil.java
│ │ │ ├── interceptor
│ │ │ │ └── MyAdapter.java
│ │ │ ├── api
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── model
│ │ │ │ └── Result.java
│ │ │ └── queue
│ │ │ │ └── MailQueue.java
│ │ │ ├── repository
│ │ │ └── MailRepository.java
│ │ │ ├── web
│ │ │ ├── IndexController.java
│ │ │ └── mailController.java
│ │ │ ├── entity
│ │ │ └── OaEmail.java
│ │ │ └── service
│ │ │ └── IMailService.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── gaohanghang
│ │ └── mail
│ │ └── countDownLatch
│ │ ├── Main.java
│ │ └── verifier
│ │ ├── CacheHealthChecker.java
│ │ ├── DatabaseHealthChecker.java
│ │ ├── NetworkHealthChecker.java
│ │ └── BaseHealthChecker.java
└── README.md
├── spring-boot-miaosha
├── README.md
└── src
│ └── main
│ ├── resources
│ └── templates
│ │ └── hello.html
│ └── java
│ └── com
│ └── imooc
│ └── miaosha
│ ├── domain
│ └── User.java
│ ├── dao
│ └── UserDao.java
│ ├── service
│ └── UserService.java
│ ├── result
│ └── Result.java
│ └── controller
│ └── SampleController.java
├── spring-boot-course-manage-system
└── README.md
├── spring-boot-mongodb
├── README.md
└── src
│ └── main
│ └── java
│ └── com
│ └── gaohanghang
│ └── springbootmongodb
│ └── dao
│ └── DemoDao.java
├── spring-boot2_1_study
├── README.md
└── src
│ └── main
│ └── resources
│ └── banner.txt
├── issues-dashboard
└── README.md
├── spring-boot-google-jib
├── README.md
└── src
│ └── main
│ └── java
│ └── com
│ └── gaohanghang
│ └── springbootgooglejib
│ └── controller
│ └── WebController.java
├── spring-boot-online-executor
├── doc
│ └── pic
│ │ ├── 项目展示.gif
│ │ ├── getTask执行流程.jpg
│ │ ├── Java程序编译和运行的过程.jpg
│ │ ├── 在线执行Java代码实现流程.jpg
│ │ └── 客户端程序编译和运行的过程.jpg
└── src
│ ├── main
│ └── java
│ │ └── com
│ │ └── gaohanghang
│ │ └── springbootonlineexecutor
│ │ ├── compile
│ │ └── StringSourceCompiler.java
│ │ └── execute
│ │ └── HotSwapClassLoader.java
│ └── test
│ └── java
│ └── com
│ └── gaohanghang
│ └── springbootonlineexecutor
│ ├── OnlineExecutor
│ └── OnlineExecutorApplicationTests.java
│ └── execute
│ └── ByteUtilsTest.java
├── kafka-example-imooc
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── imooc
│ │ │ └── kafka
│ │ │ ├── common
│ │ │ ├── ErrorCode.java
│ │ │ ├── Response.java
│ │ │ └── MessageEntity.java
│ │ │ ├── ExampleApplication.java
│ │ │ ├── consumer
│ │ │ └── SimpleConsumer.java
│ │ │ └── producer
│ │ │ └── SimpleProducer.java
│ └── resources
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── imooc
│ └── kafka
│ └── ExampleApplicationTests.java
├── jdbc-easy-meal-card-system
├── target
│ ├── test-classes
│ │ └── Test.class
│ └── classes
│ │ ├── dao
│ │ └── CardDao.class
│ │ ├── entity
│ │ └── Card.class
│ │ ├── utils
│ │ └── JdbcUtil.class
│ │ ├── service
│ │ └── CardService.class
│ │ └── controller
│ │ └── CardController.class
├── logfile.log
├── README.md
├── src
│ ├── test
│ │ └── java
│ │ │ └── Test.java
│ └── main
│ │ └── java
│ │ └── utils
│ │ └── JdbcUtil.java
├── pom.xml
└── MySQL.sql
├── spring-boot-message-board
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── static
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── css
│ │ │ │ │ └── style.css
│ │ │ │ ├── fonts
│ │ │ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ │ │ └── glyphicons-halflings-regular.woff2
│ │ │ │ └── js
│ │ │ │ │ ├── npm.js
│ │ │ │ │ └── util.js
│ │ │ └── application.yml
│ │ └── java
│ │ │ └── com
│ │ │ └── gaohanghang
│ │ │ └── messageboard
│ │ │ ├── service
│ │ │ ├── WordService.java
│ │ │ ├── TalkService.java
│ │ │ └── UserService.java
│ │ │ ├── DemoApplication.java
│ │ │ ├── dao
│ │ │ ├── UserRepository.java
│ │ │ ├── WordRepository.java
│ │ │ └── TalkRepository.java
│ │ │ ├── controller
│ │ │ └── BaseExceptionHandler.java
│ │ │ └── utils
│ │ │ ├── CommonTools.java
│ │ │ └── Response.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── gaohanghang
│ │ └── messageboard
│ │ └── DemoApplicationTests.java
├── .gitignore
└── README.md
├── jdbc-games-store
├── README.md
├── src
│ └── main
│ │ └── java
│ │ ├── dao
│ │ ├── ShopDao.java
│ │ ├── PlantDao.java
│ │ ├── UserDao.java
│ │ └── impl
│ │ │ └── UserDaoImpl.java
│ │ └── entity
│ │ ├── Shop.java
│ │ └── User.java
├── pom.xml
└── jdbc-games-store.iml
├── socket-study
├── ScoketDemo
│ ├── lib
│ │ └── mysql-connector-java-5.0.8.jar
│ ├── sql
│ │ └── User.sql
│ └── src
│ │ └── com
│ │ └── imooc
│ │ ├── socket
│ │ ├── StartClient.java
│ │ └── StartServer.java
│ │ ├── entity
│ │ ├── File.java
│ │ └── User.java
│ │ ├── util
│ │ ├── CommandTransfer.java
│ │ └── DBUtil.java
│ │ └── service
│ │ └── FileService.java
└── src
│ ├── Test01.java
│ ├── Test02.java
│ ├── Test03.java
│ ├── UDPClient.java
│ ├── Client.java
│ ├── Server.java
│ └── UDPServer.java
├── .gitignore
├── jdbc-girl
├── README.md
├── pom.xml
└── jdbc-girl.iml
├── qrcode-img-svg
├── README.md
├── .gitignore
└── src
│ └── main
│ └── java
│ └── QRGenDemo.java
├── spring-boot-gephi
└── src
│ ├── main
│ ├── resources
│ │ └── application.yml
│ └── java
│ │ └── com
│ │ └── gaohanghang
│ │ └── springbootgephi
│ │ ├── dao
│ │ ├── EdgesRepository.java
│ │ ├── NodesRepository.java
│ │ └── RelationShipRepository.java
│ │ ├── entity
│ │ ├── StatusCode.java
│ │ ├── PageResult.java
│ │ ├── Edges.java
│ │ ├── Nodes.java
│ │ └── Result.java
│ │ ├── config
│ │ └── CorsConfig.java
│ │ ├── common
│ │ └── enums
│ │ │ └── Group.java
│ │ ├── controller
│ │ └── BaseExceptionHandler.java
│ │ └── jsonexporter
│ │ └── model
│ │ ├── GraphElement.java
│ │ └── GraphEdge.java
│ └── test
│ └── java
│ └── com
│ └── gaohanghang
│ └── springbootgephi
│ ├── Test.java
│ └── Test2.java
├── spring-boot-statemachine
├── src
│ └── main
│ │ └── java
│ │ └── top
│ │ └── ghang
│ │ └── springbootstatemachine
│ │ ├── enums
│ │ ├── Events.java
│ │ └── States.java
│ │ └── config
│ │ └── EventConfig.java
└── README.md
├── spring-boot-easy-excel-demo
├── src
│ └── main
│ │ ├── resources
│ │ ├── static
│ │ │ └── layui
│ │ │ │ ├── font
│ │ │ │ ├── iconfont.eot
│ │ │ │ ├── iconfont.ttf
│ │ │ │ └── iconfont.woff
│ │ │ │ ├── images
│ │ │ │ └── face
│ │ │ │ │ ├── 0.gif
│ │ │ │ │ ├── 1.gif
│ │ │ │ │ ├── 2.gif
│ │ │ │ │ ├── 3.gif
│ │ │ │ │ ├── 4.gif
│ │ │ │ │ ├── 5.gif
│ │ │ │ │ ├── 6.gif
│ │ │ │ │ ├── 7.gif
│ │ │ │ │ ├── 8.gif
│ │ │ │ │ ├── 9.gif
│ │ │ │ │ ├── 10.gif
│ │ │ │ │ ├── 11.gif
│ │ │ │ │ ├── 12.gif
│ │ │ │ │ ├── 13.gif
│ │ │ │ │ ├── 14.gif
│ │ │ │ │ ├── 15.gif
│ │ │ │ │ ├── 16.gif
│ │ │ │ │ ├── 17.gif
│ │ │ │ │ ├── 18.gif
│ │ │ │ │ ├── 19.gif
│ │ │ │ │ ├── 20.gif
│ │ │ │ │ ├── 21.gif
│ │ │ │ │ ├── 22.gif
│ │ │ │ │ ├── 23.gif
│ │ │ │ │ ├── 24.gif
│ │ │ │ │ ├── 25.gif
│ │ │ │ │ ├── 26.gif
│ │ │ │ │ ├── 27.gif
│ │ │ │ │ ├── 28.gif
│ │ │ │ │ ├── 29.gif
│ │ │ │ │ ├── 30.gif
│ │ │ │ │ ├── 31.gif
│ │ │ │ │ ├── 32.gif
│ │ │ │ │ ├── 33.gif
│ │ │ │ │ ├── 34.gif
│ │ │ │ │ ├── 35.gif
│ │ │ │ │ ├── 36.gif
│ │ │ │ │ ├── 37.gif
│ │ │ │ │ ├── 38.gif
│ │ │ │ │ ├── 39.gif
│ │ │ │ │ ├── 40.gif
│ │ │ │ │ ├── 41.gif
│ │ │ │ │ ├── 42.gif
│ │ │ │ │ ├── 43.gif
│ │ │ │ │ ├── 44.gif
│ │ │ │ │ ├── 45.gif
│ │ │ │ │ ├── 46.gif
│ │ │ │ │ ├── 47.gif
│ │ │ │ │ ├── 48.gif
│ │ │ │ │ ├── 49.gif
│ │ │ │ │ ├── 50.gif
│ │ │ │ │ ├── 51.gif
│ │ │ │ │ ├── 52.gif
│ │ │ │ │ ├── 53.gif
│ │ │ │ │ ├── 54.gif
│ │ │ │ │ ├── 55.gif
│ │ │ │ │ ├── 56.gif
│ │ │ │ │ ├── 57.gif
│ │ │ │ │ ├── 58.gif
│ │ │ │ │ ├── 59.gif
│ │ │ │ │ ├── 60.gif
│ │ │ │ │ ├── 61.gif
│ │ │ │ │ ├── 62.gif
│ │ │ │ │ ├── 63.gif
│ │ │ │ │ ├── 64.gif
│ │ │ │ │ ├── 65.gif
│ │ │ │ │ ├── 66.gif
│ │ │ │ │ ├── 67.gif
│ │ │ │ │ ├── 68.gif
│ │ │ │ │ ├── 69.gif
│ │ │ │ │ ├── 70.gif
│ │ │ │ │ └── 71.gif
│ │ │ │ ├── css
│ │ │ │ └── modules
│ │ │ │ │ ├── layer
│ │ │ │ │ └── default
│ │ │ │ │ │ ├── icon.png
│ │ │ │ │ │ ├── icon-ext.png
│ │ │ │ │ │ ├── loading-0.gif
│ │ │ │ │ │ ├── loading-1.gif
│ │ │ │ │ │ └── loading-2.gif
│ │ │ │ │ └── code.css
│ │ │ │ └── lay
│ │ │ │ └── modules
│ │ │ │ └── code.js
│ │ └── application.yml
│ │ └── java
│ │ └── com
│ │ └── gaohanghang
│ │ └── easyexceldemo
│ │ ├── dao
│ │ └── UserRepository.java
│ │ ├── controller
│ │ └── BaseExceptionHandler.java
│ │ └── entity
│ │ └── User.java
├── sql
│ └── MySQL.sql
└── README.md
├── rpc-easy-demo
├── src
│ └── com
│ │ └── acts
│ │ └── rpc
│ │ ├── HelloService.java
│ │ ├── HelloServiceImpl.java
│ │ ├── RpcProvider.java
│ │ └── RpcConsumer.java
└── README.md
├── jms-spring
├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── imooc
│ │ │ └── jms
│ │ │ ├── producer
│ │ │ ├── ProducerService.java
│ │ │ ├── AppProducer.java
│ │ │ └── ProducerServiceImpl.java
│ │ │ └── consumer
│ │ │ ├── AppConsumer.java
│ │ │ └── ConsumerMessageListener.java
│ │ └── resources
│ │ ├── producer.xml
│ │ ├── consumer.xml
│ │ └── common.xml
└── README.md
├── nio-group-chat-software
├── README.md
├── src
│ └── main
│ │ └── java
│ │ └── bio
│ │ ├── BIOClient.java
│ │ └── BIOServer.java
└── pom.xml
├── spring-boot-mail-practice
├── README.md
└── src
│ └── main
│ └── resources
│ └── templates
│ └── emailTemplate.html
├── springboot-file-uploader
├── .gitignore
└── src
│ ├── main
│ ├── java
│ │ └── cn
│ │ │ └── attackme
│ │ │ └── myuploader
│ │ │ ├── MyUploaderApplication.java
│ │ │ ├── config
│ │ │ ├── UploadConfig.java
│ │ │ └── LogAspect.java
│ │ │ ├── dao
│ │ │ └── FileDao.java
│ │ │ ├── controller
│ │ │ ├── QuickUploadController.java
│ │ │ ├── TestExceptionController.java
│ │ │ └── FileUploadController.java
│ │ │ └── model
│ │ │ └── File.java
│ └── resources
│ │ ├── schema.sql
│ │ └── application.yml
│ └── test
│ └── java
│ └── cn
│ └── attackme
│ └── myuploader
│ └── MyUploaderApplicationTests.java
├── spring-boot-shiro
├── src
│ └── main
│ │ ├── resources
│ │ └── application.yml
│ │ └── java
│ │ └── org
│ │ └── hackerandpainter
│ │ └── springbootshiro
│ │ ├── SpringBootShiroApplication.java
│ │ ├── MyRealm.java
│ │ └── LoginController.java
└── .gitignore
├── spring-boot-printer
└── src
│ └── main
│ └── java
│ └── com
│ └── gaohanghang
│ └── springbootprinter
│ └── test
│ └── PrintPDF.java
├── io-download-picture
├── README.md
├── src
│ └── test
│ │ └── java
│ │ └── DownloadPicTest.java
├── pom.xml
└── io-download-picture.iml
├── project-practice.iml
├── project-common
└── src
│ └── main
│ └── java
│ └── entity
│ ├── StatusCode.java
│ ├── PageResult.java
│ └── Result.java
├── .idea
└── libraries
│ ├── Maven__mysql_mysql_connector_java_8_0_13.xml
│ └── Maven__com_google_protobuf_protobuf_java_3_6_1.xml
└── jms-test
├── pom.xml
└── src
└── main
└── java
└── com
└── imooc
├── queue
└── AppProducter.java
└── topic
└── AppProducter.java
/spring-boot-manage-books/sql/final_sql.sql:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-boot-file/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/springboot_logstash/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/financial-system/README.md:
--------------------------------------------------------------------------------
1 | # 理财系统
2 |
3 | > 来自慕课网的项目
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: dev
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World!
4 |
5 |
6 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/README.md:
--------------------------------------------------------------------------------
1 | 慕课网项目 Java秒杀系统方案优化 高性能高并发实战
2 |
3 | > 视频地址
4 | https://www.bilibili.com/video/av48189136/?p=3
--------------------------------------------------------------------------------
/spring-boot-course-manage-system/README.md:
--------------------------------------------------------------------------------
1 | # 课程管理系统
2 |
3 | [课程管理系统](https://github.com/xiaoze-smirk/easy-springboot)
4 |
5 |
--------------------------------------------------------------------------------
/financial-system/文档/数据库设计/产品表.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/financial-system/文档/数据库设计/产品表.png
--------------------------------------------------------------------------------
/financial-system/文档/数据库设计/订单表.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/financial-system/文档/数据库设计/订单表.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/文档/需求.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/文档/需求.pdf
--------------------------------------------------------------------------------
/spring-boot-mongodb/README.md:
--------------------------------------------------------------------------------
1 | # SpringBoot操作MongoDB数据库,实现基本的增删改查
2 |
3 | > 项目来自 https://github.com/souyunku/SpringBootExamples
4 |
5 |
--------------------------------------------------------------------------------
/spring-boot2_1_study/README.md:
--------------------------------------------------------------------------------
1 | # springboot2.1学习
2 |
3 | [2019年最新版springboot2.1+IDEA](https://www.bilibili.com/video/av39775932)
4 |
5 |
--------------------------------------------------------------------------------
/issues-dashboard/README.md:
--------------------------------------------------------------------------------
1 | # From Zero to Hero with Spring Boot - Brian Clozel
2 |
3 | https://www.youtube.com/watch?v=aA4tfBGY6jY
4 |
5 |
--------------------------------------------------------------------------------
/spring-boot-google-jib/README.md:
--------------------------------------------------------------------------------
1 | # Jib构建你的第一个java镜像
2 |
3 | > 原文链接 https://juejin.im/post/5b4e9c316fb9a04fa01d39d6
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/spring-boot-online-executor/doc/pic/项目展示.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-online-executor/doc/pic/项目展示.gif
--------------------------------------------------------------------------------
/kafka-example-imooc/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/kafka-example-imooc/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-boot-online-executor/doc/pic/getTask执行流程.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-online-executor/doc/pic/getTask执行流程.jpg
--------------------------------------------------------------------------------
/kafka-example-imooc/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
2 |
--------------------------------------------------------------------------------
/spring-boot-online-executor/doc/pic/Java程序编译和运行的过程.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-online-executor/doc/pic/Java程序编译和运行的过程.jpg
--------------------------------------------------------------------------------
/spring-boot-online-executor/doc/pic/在线执行Java代码实现流程.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-online-executor/doc/pic/在线执行Java代码实现流程.jpg
--------------------------------------------------------------------------------
/spring-boot-online-executor/doc/pic/客户端程序编译和运行的过程.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-online-executor/doc/pic/客户端程序编译和运行的过程.jpg
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/target/test-classes/Test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/jdbc-easy-meal-card-system/target/test-classes/Test.class
--------------------------------------------------------------------------------
/spring-boot-message-board/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-message-board/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-boot-message-board/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/target/classes/dao/CardDao.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/jdbc-easy-meal-card-system/target/classes/dao/CardDao.class
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/target/classes/entity/Card.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/jdbc-easy-meal-card-system/target/classes/entity/Card.class
--------------------------------------------------------------------------------
/jdbc-games-store/README.md:
--------------------------------------------------------------------------------
1 | # 基于JDBC的游戏商店项目(Java控制台版)
2 |
3 | 涵盖MySQL、JDBC、Java SE、接口编程等Java核心技术。
4 |
5 | 
6 |
7 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/lib/mysql-connector-java-5.0.8.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/socket-study/ScoketDemo/lib/mysql-connector-java-5.0.8.jar
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/target/classes/utils/JdbcUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/jdbc-easy-meal-card-system/target/classes/utils/JdbcUtil.class
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-message-board/src/main/resources/static/favicon.ico
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/target/classes/service/CardService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/jdbc-easy-meal-card-system/target/classes/service/CardService.class
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/qc.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/qc.jpg
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/qc1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/qc1.jpg
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/qc2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/qc2.jpg
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Example user template template
3 | ### Example user template
4 |
5 | # IntelliJ project files
6 | .idea
7 | *.iml
8 | out
9 | gen
10 |
--------------------------------------------------------------------------------
/jdbc-games-store/src/main/java/dao/ShopDao.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/23 10:09
7 | */
8 | public interface ShopDao {
9 | }
10 |
--------------------------------------------------------------------------------
/jdbc-girl/README.md:
--------------------------------------------------------------------------------
1 | # JDBC练习项目 "对面的女孩看过来"
2 |
3 | > 项目来自[JDBC之"对岸的女孩看过来"](https://www.imooc.com/video/5433)
4 |
5 |
6 | ## 运行效果
7 |
8 | 
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/avatar.jpg
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/target/classes/controller/CardController.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/jdbc-easy-meal-card-system/target/classes/controller/CardController.class
--------------------------------------------------------------------------------
/qrcode-img-svg/README.md:
--------------------------------------------------------------------------------
1 | java生成二维码
2 |
3 | > 效果
4 |
5 | 
6 |
7 | 
8 |
9 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8888
3 | spring:
4 | datasource:
5 | url: jdbc:postgresql://10.0.0.156:5432/cobweb
6 | username: postgres
7 | password: root
8 |
--------------------------------------------------------------------------------
/spring-boot-statemachine/src/main/java/top/ghang/springbootstatemachine/enums/Events.java:
--------------------------------------------------------------------------------
1 | package top.ghang.springbootstatemachine.enums;
2 |
3 | public enum Events {
4 | PAY, // 支付
5 | RECEIVE // 收货
6 | }
7 |
--------------------------------------------------------------------------------
/jdbc-games-store/src/main/java/dao/PlantDao.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/23 10:09
7 | */
8 | public interface PlantDao {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/font/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/font/iconfont.eot
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/font/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/font/iconfont.ttf
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/0.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/1.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/2.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/3.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/4.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/5.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/6.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/7.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/8.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/9.gif
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/logfile.log:
--------------------------------------------------------------------------------
1 | 2019-01-22 19:08:49,661 INFO [entity.Card] - sql: com.mysql.cj.jdbc.PreparedStatement@470f1802: UPDATE card set id = '2', name = 'dd', class_name = 'dd', password = 'dd' where id ='1'
2 |
--------------------------------------------------------------------------------
/qrcode-img-svg/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Example user template template
3 | ### Example user template
4 |
5 | # IntelliJ project files
6 | .idea
7 | *.iml
8 | out
9 | gen
10 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/font/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/font/iconfont.woff
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/10.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/11.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/12.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/13.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/14.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/15.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/16.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/17.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/18.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/19.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/20.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/21.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/22.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/23.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/24.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/25.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/26.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/27.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/28.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/29.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/30.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/31.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/32.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/33.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/34.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/35.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/36.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/37.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/38.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/39.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/40.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/41.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/42.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/43.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/44.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/45.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/46.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/47.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/48.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/49.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/50.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/51.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/52.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/53.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/54.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/55.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/56.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/57.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/58.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/59.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/60.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/61.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/62.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/63.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/64.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/65.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/66.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/67.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/68.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/69.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/70.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/images/face/71.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/sql/MySQL.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE `user` (
2 | `id` varchar(255) NOT NULL,
3 | `name` varchar(255) DEFAULT NULL,
4 | `age` int(11) DEFAULT NULL,
5 | PRIMARY KEY (`id`)
6 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro1.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro2.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro3.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro4.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro5.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro6.png
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-manage-books/src/main/resources/static/lib/images/managebooks_intro7.png
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/java/com/imooc/kafka/common/ErrorCode.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka.common;
2 |
3 | public class ErrorCode {
4 | public final static int SUCCESS = 200;
5 | public final static int EXCEPTION = 500;
6 | }
7 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/css/style.css:
--------------------------------------------------------------------------------
1 | .location{
2 | margin-left: 33.3%;
3 | padding-top: 180px;
4 | }
5 | .s-margin-1{
6 | margin-top: 10px;
7 | }
8 | .s-margin-2{
9 | margin-top: 20px;
10 | }
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-message-board/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/spring-boot-statemachine/src/main/java/top/ghang/springbootstatemachine/enums/States.java:
--------------------------------------------------------------------------------
1 | package top.ghang.springbootstatemachine.enums;
2 |
3 | public enum States {
4 | UNPAID, // 待支付
5 | WAITING_FOR_RECEIVE, // 待收货
6 | DONE // 结束
7 | }
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/README.md:
--------------------------------------------------------------------------------
1 | # JDBC简单练习项目,简易饭卡系统
2 |
3 | > 项目参考链接 [JAVA的JDBC的简单练习项目,一个简单的饭卡系统](https://blog.csdn.net/m0_37961948/article/details/71139397)
4 |
5 | ## 效果图
6 |
7 | 
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/icon.png
--------------------------------------------------------------------------------
/rpc-easy-demo/src/com/acts/rpc/HelloService.java:
--------------------------------------------------------------------------------
1 | package com.acts.rpc;
2 |
3 | /**
4 | * @Description: 接口
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/27 12:44
7 | */
8 | public interface HelloService {
9 | String hello(String name);
10 | }
11 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/icon-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/icon-ext.png
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/loading-0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/loading-0.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/loading-1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/loading-1.gif
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/loading-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gaohanghang/java-project-practice/HEAD/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/layer/default/loading-2.gif
--------------------------------------------------------------------------------
/jdbc-games-store/src/main/java/dao/UserDao.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/23 10:08
7 | */
8 | public interface UserDao {
9 | public abstract int UserRes(String id, String password);
10 | }
11 |
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/src/test/java/Test.java:
--------------------------------------------------------------------------------
1 | /**
2 | * @Description:
3 | * @author: Gao Hang Hang
4 | * @date 2019/01/22 22:01
5 | */
6 | public class Test {
7 | public static void main(String[] args) {
8 | System.out.println("ddd\n");
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | Archetype Created Web Application
7 |
8 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/README.md:
--------------------------------------------------------------------------------
1 | # SpringBoot Excel导入功能实现
2 |
3 | 使用技术栈 springboot, spring data jpa, 阿里巴巴的easy excel,mysql数据库
4 |
5 |
6 | ## 实现效果
7 |
8 | 
9 |
10 | ## 待办
11 |
12 | - 前端下载excel功能
13 | - 界面优化
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8080
3 | servlet:
4 | context-path: /easy-excel-demo
5 | spring:
6 | datasource:
7 | url: jdbc:mysql://localhost:3306/excel?characterEncoding=utf8&useSSL=false
8 | username: root
9 | password: root
--------------------------------------------------------------------------------
/jms-spring/src/main/java/com/imooc/jms/producer/ProducerService.java:
--------------------------------------------------------------------------------
1 | package com.imooc.jms.producer;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/02/10 10:58
7 | */
8 | public interface ProducerService {
9 | void sendMessage(String message);
10 | }
11 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/src/main/resources/templates/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/README.md:
--------------------------------------------------------------------------------
1 | # 基于SpringBoot和thymeleaf的图书管理系统
2 |
3 | > 项目来源 []()
4 | ### 简介
5 |
6 | 一个基于SpringBoot+Thymeleaf渲染的图书管理系统
7 | 功能:
8 | 用户: 预约图书 查看预约记录 还书
9 | 管理员: 添加图书 处理预约(借书) 查看借阅记录
10 | 另:
11 | 1.当用户过了还书日期仍旧未还书时会发邮件通知
12 | 2.当有书被还时发邮件通知预约书的用户到图书馆进行借书
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/nio-group-chat-software/README.md:
--------------------------------------------------------------------------------
1 |
2 | Java-NIO实现项目演练,一小时带你们做一个群聊软件 clip
3 | https://www.youtube.com/watch?v=Y_nDeRIahvE
4 |
5 | > 运行效果
6 |
7 |
8 | 
9 |
10 | 
11 |
12 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/sql/User.sql:
--------------------------------------------------------------------------------
1 | create table tb_user{
2 | id int auto_increment primary key,
3 | username varchar(20) not null unique,
4 | password varchar(30)
5 | };
6 |
7 | create table tb_file{
8 | fid int auto_increment primary key,
9 | fname varchar(50) not null,
10 | fcontent longblob
11 | };
--------------------------------------------------------------------------------
/spring-boot2_1_study/src/main/resources/banner.txt:
--------------------------------------------------------------------------------
1 | ${AnsiColor.BLUE}
2 | _______ _______ ______
3 | | || || |
4 | |____ || ___|| _ |
5 | ____| || |___ | | | |
6 | | ______|| ___|| |_| |
7 | | |_____ | |___ | |
8 | |_______||_______||______|
9 |
10 | -----版本号-----${spring-boot.version}
--------------------------------------------------------------------------------
/springboot_logstash/src/main/resources/logstash/springboot.conf:
--------------------------------------------------------------------------------
1 | input {
2 | tcp {
3 | mode => "server"
4 | host => "0.0.0.0"
5 | port => 4560
6 | codec => json_lines
7 | }
8 | }
9 | output {
10 | elasticsearch {
11 | hosts => "localhost:9200"
12 | index => "springboot-logstash-%{+YYYY.MM.dd}"
13 | }
14 | }
--------------------------------------------------------------------------------
/rpc-easy-demo/README.md:
--------------------------------------------------------------------------------
1 | # JAVA实现一个简单的RPC+项目源码
2 |
3 | > 原文来自 [JAVA实现一个简单的RPC+项目源码](https://blog.52itstyle.com/archives/84/)
4 |
5 | ## 效果
6 |
7 | ### 启动服务
8 |
9 | 
10 |
11 | ### 调用服务
12 |
13 | 
14 |
15 |
16 |
--------------------------------------------------------------------------------
/jdbc-games-store/src/main/java/dao/impl/UserDaoImpl.java:
--------------------------------------------------------------------------------
1 | package dao.impl;
2 |
3 | import dao.UserDao;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/23 10:09
9 | */
10 | public class UserDaoImpl implements UserDao {
11 | public int UserRes(String id, String password) {
12 | return 0;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rpc-easy-demo/src/com/acts/rpc/HelloServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.acts.rpc;
2 |
3 | /**
4 | * @Description: 实现
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/27 12:45
7 | */
8 | public class HelloServiceImpl implements HelloService {
9 |
10 | @Override
11 | public String hello(String name) {
12 | return "Hello " + name;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/spring-boot-mail-practice/README.md:
--------------------------------------------------------------------------------
1 | # 使用Spring Boot发送邮件
2 |
3 | > 来自慕课网 [Spring Boot 发送邮件](https://www.imooc.com/video/17765)
4 |
5 |
6 | 
7 |
8 | 
9 |
10 | 
11 |
--------------------------------------------------------------------------------
/rpc-easy-demo/src/com/acts/rpc/RpcProvider.java:
--------------------------------------------------------------------------------
1 | package com.acts.rpc;
2 |
3 | /**
4 | * @Description: 提供者
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/27 12:46
7 | */
8 | public class RpcProvider {
9 | public static void main(String[] args) throws Exception {
10 | HelloService service = new HelloServiceImpl();
11 | RpcFramework.export(service, 1234);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/socket/StartClient.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.socket;
2 |
3 | /**
4 | * @Description: 启动客户端
5 | * @author: Gao Hang Hang
6 | * @date 2019/02/09 14:08
7 | */
8 | public class StartClient {
9 | public static void main(String[] args) {
10 | SocketClient client = new SocketClient();
11 | client.showMainMenu();// 显示主菜单
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/spring-boot-mail-practice/src/main/resources/templates/emailTemplate.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 邮件模板
6 |
7 |
8 | 你好,感谢您的注册,这是一封验证邮件,请点击下面的链接完成注册,感谢您的支持!
9 | 激活账号
10 |
11 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/ProcessResult.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 |
5 | /**
6 | * @Description: 添加图书结果的包装类
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/28 13:51
9 | */
10 | @AllArgsConstructor
11 | public class ProcessResult {
12 | boolean success;
13 | }
14 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/task/SendMail.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.task;
2 |
3 | import org.springframework.stereotype.Component;
4 |
5 | /**
6 | * @Description: 统计失败邮件定时重新发送
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/29 12:10
9 | */
10 | @Component("sendMail")
11 | public class SendMail {
12 | public void sendMail() {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/springboot-file-uploader/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /log/
3 | /upload/
4 | .mvn/
5 |
6 | ### STS ###
7 | .apt_generated
8 | .classpath
9 | .factorypath
10 | .project
11 | .settings
12 | .springBeans
13 | .sts4-cache
14 |
15 | ### IntelliJ IDEA ###
16 | .idea
17 | *.iws
18 | *.iml
19 | *.ipr
20 |
21 | ### NetBeans ###
22 | /nbproject/private/
23 | /build/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
--------------------------------------------------------------------------------
/spring-boot-message-board/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/springboot_logstash/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /nbbuild/
22 | /dist/
23 | /nbdist/
24 | /.nb-gradle/
25 | /build/
26 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/dao/EdgesRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.dao;
2 |
3 | import com.gaohanghang.springbootgephi.entity.Edges;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.stereotype.Repository;
6 |
7 | @Repository
8 | public interface EdgesRepository extends JpaRepository {
9 |
10 | }
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/java/com/imooc/kafka/common/Response.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka.common;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | @Getter
7 | @Setter
8 | public class Response {
9 | private int code;
10 | private String message;
11 |
12 | public Response(int code, String message) {
13 | this.code = code;
14 | this.message = message;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/spring-boot-statemachine/README.md:
--------------------------------------------------------------------------------
1 | # Spring StateMachine,教你快速实现一个状态机
2 |
3 | > 原文链接 [Spring StateMachine,教你快速实现一个状态机](https://mp.weixin.qq.com/s/3swpZWJufg5k7jJeNiok5A)
4 |
5 |
6 | > 运行效果
7 |
8 | 
9 |
10 | > 通过上面的例子,我们可以对如何使用Spring StateMachine做如下小结:
11 |
12 | - 定义状态和事件枚举
13 | - 为状态机定义使用德所有状态以及初始状态
14 | - 为状态机定义状态的迁移动作
15 | - 为状态机指定监听处理器
16 |
17 | > 注意 不是线程安全
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/repository/MailRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.repository;
2 |
3 | import com.gaohanghang.mail.entity.OaEmail;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | /**
7 | * @Description: 邮件管理
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/29 11:47
10 | */
11 | public interface MailRepository extends JpaRepository {
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/exception/AddBooklistException.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.exception;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/02/28 12:42
7 | */
8 | public class AddBooklistException extends RuntimeException {
9 | public AddBooklistException(String message) {
10 | super(message);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/java/com/gaohanghang/easyexceldemo/dao/UserRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.easyexceldemo.dao;
2 |
3 | import com.gaohanghang.easyexceldemo.entity.User;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/28 15:37
10 | */
11 | public interface UserRepository extends JpaRepository {
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/exception/ReservationException.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.exception;
2 |
3 | /**
4 | * @Description: 自定义预定异常
5 | * @author: Gao Hang Hang
6 | * @date 2019/02/28 12:43
7 | */
8 | public class ReservationException extends RuntimeException {
9 | public ReservationException(String message) {
10 | super(message);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/service/UserService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.service;
2 |
3 | import com.gaohanghang.springbootmanagebooks.entity.User;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/28 16:46
9 | */
10 | public interface UserService {
11 | User checkUser(User user);
12 |
13 | User checkManager(User user);
14 | }
15 |
--------------------------------------------------------------------------------
/spring-boot-shiro/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | shiro:
2 | # 表示登录页面
3 | loginUrl: /login
4 | sessionManager:
5 | # 表示是否允许将sessionId 放到 cookie 中
6 | sessionIdCookieEnabled: true
7 | # 表示是否允许将 sessionId 放到 Url 地址拦中
8 | sessionIdUrlRewritingEnabled: true
9 | # 表示登录页面
10 | successUrl: /index
11 | # 表示访问未获授权的页面时,默认的跳转路径
12 | unauthorizedUrl: /unauthorizedurl
13 | # 表示开启 shiro
14 | web:
15 | enabled: true
16 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/dao/NodesRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.dao;
2 |
3 | import com.gaohanghang.springbootgephi.entity.Nodes;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.stereotype.Repository;
6 |
7 | @Repository
8 | public interface NodesRepository extends JpaRepository {
9 | Nodes findById(String id);
10 | }
11 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/service/WordService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.service;
2 |
3 | import com.gaohanghang.messageboard.utils.Response;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/25 10:59
9 | */
10 | public interface WordService {
11 | Response getWords(Integer userId);
12 | Response addWord(Integer userId,String title,String content);
13 | }
14 |
--------------------------------------------------------------------------------
/spring-boot-printer/src/main/java/com/gaohanghang/springbootprinter/test/PrintPDF.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootprinter.test;
2 |
3 | import java.io.File;
4 |
5 | /**
6 | * @Description: 这段代码提供了核心的打印工作
7 | * @author: Gao Hang Hang
8 | * @date 2019/03/07 18:16
9 | */
10 | public class PrintPDF {
11 | public static void printPDF() {
12 | String filePath = "";
13 | File file = new File(filePath);
14 |
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/spring-boot-online-executor/src/main/java/com/gaohanghang/springbootonlineexecutor/compile/StringSourceCompiler.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootonlineexecutor.compile;
2 |
3 | import javax.tools.DiagnosticCollector;
4 | import javax.tools.JavaFileObject;
5 |
6 | public class StringSourceCompiler {
7 | public static byte[] compile(String source, DiagnosticCollector compileController) {
8 | return new byte[0];
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/MyUploaderApplication.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class MyUploaderApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(MyUploaderApplication.class, args);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/dao/RelationShipRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.dao;
2 |
3 | import com.gaohanghang.springbootgephi.entity.Relationship;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/28 15:37
10 | */
11 | public interface RelationShipRepository extends JpaRepository {
12 | }
13 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/DemoApplication.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class DemoApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(DemoApplication.class, args);
11 | }
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/io-download-picture/README.md:
--------------------------------------------------------------------------------
1 | # 给定url和路径下载图片
2 |
3 | ## 快速开始
4 |
5 | ````java
6 | public class DownloadPicTest {
7 | public static void main(String[] args) {
8 | String url = "http://lorempixel.com/1600/900";
9 | String path="/users/gaohanghang/download/";
10 | DownloadPicFromURL.downloadPicture(url,path + UUID.randomUUID() + ".jpg");
11 | }
12 | }
13 | ````
14 |
15 | ## 运行后示例
16 | 
--------------------------------------------------------------------------------
/project-practice.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/spring-boot-google-jib/src/main/java/com/gaohanghang/springbootgooglejib/controller/WebController.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgooglejib.controller;
2 |
3 | import org.springframework.web.bind.annotation.RequestMapping;
4 | import org.springframework.web.bind.annotation.RestController;
5 |
6 | @RestController
7 | public class WebController {
8 | @RequestMapping("/blog")
9 | public String index() {
10 | return "http://ghang.top";
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/dao/UserRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.dao;
2 |
3 | import com.gaohanghang.messageboard.entity.User;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/25 10:56
10 | */
11 | public interface UserRepository extends JpaRepository {
12 | User findByUserName(String userName);
13 | }
--------------------------------------------------------------------------------
/io-download-picture/src/test/java/DownloadPicTest.java:
--------------------------------------------------------------------------------
1 | import java.util.UUID;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/24 15:47
7 | */
8 | public class DownloadPicTest {
9 | public static void main(String[] args) {
10 | String url = "http://lorempixel.com/1600/900";
11 | String path="/users/gaohanghang/download/";
12 | DownloadPicFromURL.downloadPicture(url,path + UUID.randomUUID() + ".jpg");
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/kafka-example-imooc/src/test/java/com/imooc/kafka/ExampleApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class ExampleApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/test/java/com/gaohanghang/mail/countDownLatch/Main.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.countDownLatch;
2 |
3 | public class Main {
4 | public static void main(String[] args)
5 | {
6 | boolean result = false;
7 | try {
8 | result = ApplicationStartupUtil.checkExternalServices();
9 | } catch (Exception e) {
10 | e.printStackTrace();
11 | }
12 | System.out.println("External services validation completed !! Result was :: "+ result);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/jdbc-games-store/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | top.ghang
8 | jdbc-games-store
9 | 1.0-SNAPSHOT
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/service/TalkService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.service;
2 |
3 | import com.gaohanghang.messageboard.utils.Response;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/25 10:59
9 | */
10 | public interface TalkService {
11 | Response getTalks(Integer userId);
12 | Response addTalk(Integer userId, String content);
13 |
14 | Response getSize(Integer userId);
15 | }
16 |
--------------------------------------------------------------------------------
/spring-boot-online-executor/src/main/java/com/gaohanghang/springbootonlineexecutor/execute/HotSwapClassLoader.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootonlineexecutor.execute;
2 |
3 | public class HotSwapClassLoader extends ClassLoader {
4 |
5 | public HotSwapClassLoader() {
6 | super(HotSwapClassLoader.class.getClassLoader());
7 | }
8 |
9 | public Class loadByte(byte[] classBytes) {
10 | return defineClass(null, classBytes, 0, classBytes.length);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/config/UploadConfig.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.config;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.context.annotation.Configuration;
5 |
6 | @Configuration
7 | public class UploadConfig {
8 |
9 | public static String path;
10 |
11 | @Value("${upload.path}")
12 | public void setPath(String path) {
13 | UploadConfig.path = path;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/service/MailService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.service;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/02/28 16:51
7 | */
8 | public interface MailService {
9 | // 发送简单邮件
10 | void sendSimpleMail(String to, String subject, String content);
11 | // 归还提醒
12 | void processReturnReminder();
13 | // 预定提醒
14 | void processResReminder();
15 | }
16 |
--------------------------------------------------------------------------------
/spring-boot-shiro/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/io-download-picture/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.gaohanghang
8 | io-download-picture
9 | 1.0-SNAPSHOT
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/src/main/java/com/imooc/miaosha/domain/User.java:
--------------------------------------------------------------------------------
1 | package com.imooc.miaosha.domain;
2 |
3 | public class User {
4 | private int id;
5 | private String name;
6 |
7 | public int getId() {
8 | return id;
9 | }
10 |
11 | public void setId(int id) {
12 | this.id = id;
13 | }
14 |
15 | public String getName() {
16 | return name;
17 | }
18 |
19 | public void setName(String name) {
20 | this.name = name;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/dao/WordRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.dao;
2 |
3 | import com.gaohanghang.messageboard.entity.Word;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import java.util.List;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @date 2019/01/25 10:57
11 | */
12 | public interface WordRepository extends JpaRepository{
13 | List findAllByOrderByLeaveTime();
14 | }
--------------------------------------------------------------------------------
/spring-boot-shiro/src/main/java/org/hackerandpainter/springbootshiro/SpringBootShiroApplication.java:
--------------------------------------------------------------------------------
1 | package org.hackerandpainter.springbootshiro;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class SpringBootShiroApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(SpringBootShiroApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/test/java/cn/attackme/myuploader/MyUploaderApplicationTests.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class MyUploaderApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/springboot_logstash/src/test/java/com/dalaoyang/SpringbootLogstashApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.dalaoyang;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class SpringbootLogstashApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/test/java/com/gaohanghang/messageboard/DemoApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class DemoApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/resources/schema.sql:
--------------------------------------------------------------------------------
1 | drop table if exists file;
2 |
3 | CREATE TABLE `file` (
4 | `id` bigint(20) NOT NULL AUTO_INCREMENT,
5 | `name` varchar(100) NOT NULL COMMENT '文件名',
6 | `md5` varchar(32) DEFAULT NULL COMMENT 'MD5值',
7 | `path` varchar(100) NOT NULL COMMENT '文件路径',
8 | `upload_time` datetime(3) NOT NULL COMMENT '上传时间',
9 | `ext` varchar(255) DEFAULT NULL COMMENT '文件后缀名',
10 | PRIMARY KEY (`id`)
11 | ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
12 |
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/java/com/imooc/kafka/ExampleApplication.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 |
7 | @SpringBootApplication
8 | public class ExampleApplication {
9 |
10 | public static void main(String[] args) {
11 | SpringApplication.run(ExampleApplication.class, args);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/MailDetail.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/02/28 13:47
10 | */
11 | @Getter
12 | @Setter
13 | public class MailDetail {
14 | private String userName; //用户名
15 | private String email; //邮件地址
16 | private String bname; //书名
17 | private String btime; //预定时间
18 | }
19 |
--------------------------------------------------------------------------------
/jms-spring/src/main/java/com/imooc/jms/consumer/AppConsumer.java:
--------------------------------------------------------------------------------
1 | package com.imooc.jms.consumer;
2 |
3 | import org.springframework.context.ApplicationContext;
4 | import org.springframework.context.support.ClassPathXmlApplicationContext;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/02/10 16:44
10 | */
11 | public class AppConsumer {
12 | public static void main(String[] args) {
13 | ApplicationContext context = new ClassPathXmlApplicationContext("consumer.xml");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/dao/MailMapper.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.dao;
2 |
3 | import com.gaohanghang.springbootmanagebooks.entity.MailDetail;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @date 2019/02/28 16:28
11 | */
12 | public interface MailMapper {
13 | List returnReminder(); //返回提醒
14 |
15 | // 注意一下这里MailDetail.btime字段为空
16 | List resReminder(); //预定提醒
17 | }
18 |
--------------------------------------------------------------------------------
/project-common/src/main/java/entity/StatusCode.java:
--------------------------------------------------------------------------------
1 | package entity;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/09 19:38
7 | */
8 | public class StatusCode {
9 | public static final int OK = 20000;//成功
10 | public static final int ERROR = 20001;//失败
11 | public static final int LOGINERROR = 20002;//用户名或密码错误
12 | public static final int ACCESSERROR =20003;//权限不足
13 | public static final int REMOTEERROR =20004;//远程调用失败
14 | public static final int REPERROR =20004;//重复操作
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/dao/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.dao;
2 |
3 | import com.gaohanghang.springbootmanagebooks.entity.User;
4 | import org.apache.ibatis.annotations.Param;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/02/28 16:26
10 | */
11 | public interface UserMapper {
12 | //通过username和passwd 验证用户 reader
13 | User checkUser(@Param("user") User user);
14 | User checkManager(@Param("user") User user);
15 | }
16 |
--------------------------------------------------------------------------------
/spring-boot-mongodb/src/main/java/com/gaohanghang/springbootmongodb/dao/DemoDao.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmongodb.dao;
2 |
3 | import com.gaohanghang.springbootmongodb.entity.DemoEntity;
4 |
5 | /**
6 | * @Description: 提供增删改查 MongoDB 接口
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/29 19:17
9 | */
10 | public interface DemoDao {
11 |
12 | void saveDemo(DemoEntity demoEntity);
13 |
14 | void removeDemo(Long id);
15 |
16 | void updateDemo(DemoEntity demoEntity);
17 |
18 | DemoEntity findDemoById(Long id);
19 | }
20 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | datasource:
3 | username: root
4 | password: root
5 | url: jdbc:mysql:///MyUploader?useUnicode=true&characterEncoding=utf-8&serverTimeZone=UTC&useSSL=false
6 | driver-class-name: com.mysql.jdbc.Driver
7 | servlet:
8 | multipart:
9 | max-file-size: 10000Mb
10 | max-request-size: 100000Mb
11 | mybatis:
12 | mapper-locations: classpath:mapper/*Mapper.xml
13 | type-aliases-package: cn.attackme.myuploader.model
14 | upload:
15 | path: ./upload/ #文件上传路径
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/dao/TalkRepository.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.dao;
2 |
3 | import com.gaohanghang.messageboard.entity.Talk;
4 | import com.gaohanghang.messageboard.entity.Word;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @Description:
11 | * @author: Gao Hang Hang
12 | * @date 2019/01/25 10:57
13 | */
14 | public interface TalkRepository extends JpaRepository{
15 | List findAllByOrderByLeaveTime();
16 | }
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/service/UserService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.service;
2 |
3 | import com.gaohanghang.messageboard.utils.Response;
4 | import org.springframework.stereotype.Service;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/25 10:59
10 | */
11 | @Service
12 | public interface UserService {
13 | Response getUser(Integer userId);
14 | Response userRegister(String userName,String userPassword);
15 | Response userLogin(String userName,String userPassword);
16 | }
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/java/com/imooc/kafka/common/MessageEntity.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka.common;
2 |
3 | import lombok.EqualsAndHashCode;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 |
7 | @Getter
8 | @Setter
9 | @EqualsAndHashCode
10 | public class MessageEntity {
11 | private String title;
12 | private String body;
13 |
14 | @Override
15 | public String toString() {
16 | return "MessageEntity{" +
17 | "title='" + title + '\'' +
18 | ", body='" + body + '\'' +
19 | '}';
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/Reservation.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 | import lombok.ToString;
6 |
7 | import java.util.Date;
8 |
9 | /**
10 | * @Description: 预定类
11 | * @author: Gao Hang Hang
12 | * @date 2019/02/28 16:00
13 | */
14 | @Getter
15 | @Setter
16 | @ToString
17 | public class Reservation {
18 | private int reservationId;
19 | private int userId;
20 | private int bookId;
21 | private Date deadline;
22 | }
23 |
--------------------------------------------------------------------------------
/spring-boot-online-executor/src/test/java/com/gaohanghang/springbootonlineexecutor/OnlineExecutor/OnlineExecutorApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootonlineexecutor.OnlineExecutor;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | @RunWith(SpringRunner.class)
9 | @SpringBootTest
10 | public class OnlineExecutorApplicationTests {
11 |
12 | @Test
13 | public void contextLoads() {
14 | }
15 |
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/rpc-easy-demo/src/com/acts/rpc/RpcConsumer.java:
--------------------------------------------------------------------------------
1 | package com.acts.rpc;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/27 12:48
7 | */
8 | public class RpcConsumer {
9 | public static void main(String[] args) throws Exception {
10 | HelloService service = RpcFramework.refer(HelloService.class, "127.0.0.1", 1234);
11 | for (int i = 0; i < Integer.MAX_VALUE; i ++) {
12 | String hello = service.hello("World" + i);
13 | System.out.println(hello);
14 | Thread.sleep(1000);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/entity/StatusCode.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.entity;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/09 19:38
7 | */
8 | public class StatusCode {
9 | public static final int OK = 20000;//成功
10 | public static final int ERROR = 20001;//失败
11 | public static final int LOGINERROR = 20002;//用户名或密码错误
12 | public static final int ACCESSERROR =20003;//权限不足
13 | public static final int REMOTEERROR =20004;//远程调用失败
14 | public static final int REPERROR =20004;//重复操作
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/Dynamicquery/NativeQueryResultEntity.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.Dynamicquery;
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 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/01/30 13:01
12 | */
13 | @Target(ElementType.TYPE) // 注解的作用目标
14 | @Retention(RetentionPolicy.RUNTIME) // 默认的保留策略,注解会在class字节码文件中存在,但运行时无法获得,
15 | public @interface NativeQueryResultEntity {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 9004
3 | servlet:
4 | context-path: /messageBoard
5 | spring:
6 | datasource:
7 | url: jdbc:mysql://localhost:3306/messageboard?characterEncoding=utf8&useSSL=false
8 | username: root
9 | password: root
10 | jpa:
11 | hibernate:
12 | ddl-auto: update
13 | show-sql: true
14 | thymeleaf:
15 | prefix: classpath:/static/
16 | suffix: .html
17 | cache: false
18 | jackson:
19 | date-format: yyyy-MM-dd HH:mm:ss
20 | time-zone: GMT+8
21 | mvc:
22 | favicon:
23 | enable: false
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/ReservationDetail.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 | import lombok.ToString;
6 |
7 | import java.util.Date;
8 |
9 | /**
10 | * @Description:
11 | * @author: Gao Hang Hang
12 | * @date 2019/02/28 16:00
13 | */
14 | @Getter
15 | @Setter
16 | @ToString
17 | public class ReservationDetail {
18 | private int reservationId;
19 | private int bookId;
20 | private String bname;
21 | private Date deadline;
22 | private String userName;
23 | }
24 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/src/main/java/com/imooc/miaosha/dao/UserDao.java:
--------------------------------------------------------------------------------
1 | package com.imooc.miaosha.dao;
2 |
3 | import com.imooc.miaosha.domain.User;
4 | import org.apache.ibatis.annotations.Insert;
5 | import org.apache.ibatis.annotations.Mapper;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.apache.ibatis.annotations.Select;
8 |
9 | @Mapper
10 | public interface UserDao {
11 |
12 | @Select("select * from user where id = #{id}")
13 | public User getById(@Param("id") int id);
14 |
15 |
16 | @Insert("insert into user(id, name) values (#{id}, #{name})")
17 | public User insert(User user);
18 | }
19 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/Book.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.*;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @date 2019/02/28 12:43
11 | */
12 | @AllArgsConstructor
13 | @NoArgsConstructor
14 | @Getter
15 | @Setter
16 | @ToString
17 | @EqualsAndHashCode
18 | public class Book implements Serializable {
19 | private int bookId;
20 | private String ISBN;
21 | private String location;
22 | private int state;
23 | private int operator;
24 | }
25 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/BorrowDetail.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import java.util.Date;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/28 13:42
12 | */
13 | @Getter
14 | @Setter
15 | public class BorrowDetail {
16 | private int borrowId; //借书id
17 | private String bname; //书名
18 | private String userName; //用户名
19 | private Date btime; //借书时间
20 | private Date deadline; //规定归还时间
21 | private Date rtime; //归还时间
22 | }
23 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/util/Constants.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.util;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/30 18:37
7 | */
8 | public class Constants {
9 | /**
10 | * 分割符
11 | */
12 | public static final String SF_FILE_SEPARATOR = System.getProperty("file.separator"); // 文件分隔符(在 UNIX 系统中是“/”)
13 | public static final String SF_LINE_SEPARATOR = System.getProperty("line.separator"); // 行分隔符(在 UNIX 系统中是“/n”)
14 | public static final String SF_PATH_SEPARATOR = System.getProperty("path.separator"); // 路径分隔符(在 UNIX 系统中是“:”)
15 | }
16 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/Borrow.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import java.util.Date;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/28 13:41
12 | */
13 | @Getter
14 | @Setter
15 | public class Borrow {
16 | private int borrowId; //借书id
17 | private int bookId; //书id
18 | private int userId; //用户id
19 | private Date btime; //借书时间
20 | private Date deadline; //规定归还时间
21 | private Date rtime; //归还时间
22 | private int operator; //操作者
23 | }
24 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_13.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/Mapper/mail.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
14 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/util/CommonUtil.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.util;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/30 18:34
9 | */
10 | public class CommonUtil {
11 | private static ObjectMapper mapper;
12 |
13 | public static synchronized ObjectMapper getMapperInstance(boolean createNew) {
14 | if (createNew) {
15 | return new ObjectMapper();
16 | } else if (mapper == null) {
17 | mapper = new ObjectMapper();
18 | }
19 | return mapper;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/config/CorsConfig.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.config;
2 |
3 | import org.springframework.boot.SpringBootConfiguration;
4 | import org.springframework.web.servlet.config.annotation.CorsRegistry;
5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6 |
7 | /**
8 | * 跨域请求配置
9 | * 解决No 'Access-Control-Allow-Origin' header is present on the requested resource.
10 | */
11 |
12 | @SpringBootConfiguration
13 | public class CorsConfig implements WebMvcConfigurer {
14 |
15 | public void addCorsMappings(CorsRegistry registry) {
16 | registry.addMapping("/**");
17 | }
18 | }
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | #============== kafka ===================
2 | kafka.consumer.zookeeper.connect=127.0.0.1:2181
3 | kafka.consumer.servers=127.0.0.1:9092
4 | kafka.consumer.enable.auto.commit=true
5 | kafka.consumer.session.timeout=6000
6 | kafka.consumer.auto.commit.interval=100
7 | kafka.consumer.auto.offset.reset=latest
8 | kafka.consumer.topic=imooc-kafka
9 | kafka.consumer.group.id=imooc
10 | kafka.consumer.concurrency=10
11 |
12 | kafka.producer.servers=127.0.0.1:9092
13 | kafka.producer.retries=0
14 | kafka.producer.batch.size=4096
15 | kafka.producer.linger=1
16 | kafka.producer.buffer.memory=40960
17 |
18 | kafka.topic.default=imooc-kafka
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/dao/BookMapper.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.dao;
2 |
3 | import com.gaohanghang.springbootmanagebooks.entity.Book;
4 | import com.gaohanghang.springbootmanagebooks.entity.BookList;
5 | import org.apache.ibatis.annotations.Param;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @Description:
11 | * @author: Gao Hang Hang
12 | * @date 2019/02/28 16:22
13 | */
14 | public interface BookMapper {
15 | List getList();
16 |
17 | List getListByQuery(@Param("query") String query);
18 |
19 | /*得到能被预约的书*/
20 | List getRes(@Param("isbn") String ISBN);
21 | }
22 |
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/java/com/imooc/kafka/consumer/SimpleConsumer.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka.consumer;
2 |
3 | import com.google.gson.Gson;
4 | import com.imooc.kafka.common.MessageEntity;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.kafka.annotation.KafkaListener;
7 | import org.springframework.stereotype.Component;
8 |
9 | @Slf4j
10 | @Component
11 | public class SimpleConsumer {
12 |
13 | private final Gson gson = new Gson();
14 |
15 | @KafkaListener(topics = "${kafka.topic.default}", containerFactory = "kafkaListenerContainerFactory")
16 | public void receive(MessageEntity message) {
17 | log.info(gson.toJson(message));
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/test/java/com/gaohanghang/mail/countDownLatch/verifier/CacheHealthChecker.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.countDownLatch.verifier;
2 |
3 | import java.util.concurrent.CountDownLatch;
4 |
5 | public class CacheHealthChecker extends BaseHealthChecker
6 | {
7 | public CacheHealthChecker (CountDownLatch latch)
8 | {
9 | super("Cache Service", latch);
10 | }
11 |
12 | @Override
13 | public void verifyService()
14 | {
15 | System.out.println("Checking " + this.getServiceName());
16 | try {
17 | Thread.sleep(5000);
18 | } catch (InterruptedException e) {
19 | e.printStackTrace();
20 | }
21 | System.out.println(this.getServiceName() + " is UP");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/Mapper/user.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/test/java/com/gaohanghang/mail/countDownLatch/verifier/DatabaseHealthChecker.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.countDownLatch.verifier;
2 |
3 | import java.util.concurrent.CountDownLatch;
4 |
5 | public class DatabaseHealthChecker extends BaseHealthChecker
6 | {
7 | public DatabaseHealthChecker (CountDownLatch latch)
8 | {
9 | super("Database Service", latch);
10 | }
11 |
12 | @Override
13 | public void verifyService()
14 | {
15 | System.out.println("Checking " + this.getServiceName());
16 | try {
17 | Thread.sleep(2000);
18 | } catch (InterruptedException e) {
19 | e.printStackTrace();
20 | }
21 | System.out.println(this.getServiceName() + " is UP");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/nio-group-chat-software/src/main/java/bio/BIOClient.java:
--------------------------------------------------------------------------------
1 | package bio;
2 |
3 | import java.io.IOException;
4 | import java.io.OutputStream;
5 | import java.net.Socket;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @create: 2019/04/29 08:40
11 | */
12 | public class BIOClient {
13 | public static void main(String[] args) {
14 | try {
15 | Socket client = new Socket("localhost", 8081);
16 | OutputStream out = client.getOutputStream();
17 | out.write("jack要连接服务器".getBytes());
18 | out.close();
19 | client.close();
20 | } catch (IOException e) {
21 | e.printStackTrace();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/jdbc-girl/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | top.ghang
8 | jdbc-girl
9 | 1.0-SNAPSHOT
10 |
11 |
12 |
13 | mysql
14 | mysql-connector-java
15 | 8.0.13
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/controller/BaseExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.controller;
2 |
3 | import com.gaohanghang.messageboard.utils.Response;
4 | import org.springframework.web.bind.annotation.ExceptionHandler;
5 | import org.springframework.web.bind.annotation.RestControllerAdvice;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @date 2019/01/10 16:48
11 | */
12 | @RestControllerAdvice
13 | public class BaseExceptionHandler {
14 | @ExceptionHandler(value = Exception.class)
15 | public Response exception(Exception e) {
16 | e.printStackTrace();
17 | return new Response("-1", "服务器发生异常");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/jms-spring/src/main/java/com/imooc/jms/consumer/ConsumerMessageListener.java:
--------------------------------------------------------------------------------
1 | package com.imooc.jms.consumer;
2 |
3 | import javax.jms.JMSException;
4 | import javax.jms.Message;
5 | import javax.jms.MessageListener;
6 | import javax.jms.TextMessage;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/10 16:39
12 | */
13 | public class ConsumerMessageListener implements MessageListener {
14 | public void onMessage(Message message) {
15 | TextMessage textMessage = (TextMessage) message;
16 |
17 | try {
18 | System.out.println("接收消息" + textMessage.getText());
19 | } catch (JMSException e) {
20 | e.printStackTrace();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/test/java/com/gaohanghang/mail/countDownLatch/verifier/NetworkHealthChecker.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.countDownLatch.verifier;
2 |
3 | import java.util.concurrent.CountDownLatch;
4 |
5 | public class NetworkHealthChecker extends BaseHealthChecker
6 | {
7 | public NetworkHealthChecker (CountDownLatch latch)
8 | {
9 | super("Network Service", latch);
10 | }
11 |
12 | @Override
13 | public void verifyService()
14 | {
15 | System.out.println("Checking " + this.getServiceName());
16 | try
17 | {
18 | Thread.sleep(7000);
19 | }
20 | catch (InterruptedException e)
21 | {
22 | e.printStackTrace();
23 | }
24 | System.out.println(this.getServiceName() + " is UP");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/utils/CommonTools.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.utils;
2 |
3 | import java.sql.Timestamp;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/25 10:52
9 | */
10 | public class CommonTools {
11 | public static boolean isEmpty(String str) {
12 | if (str == null)
13 | return true;
14 | if (str.isEmpty())
15 | return true;
16 | if (str == "" || str.equals("")) {
17 | return true;
18 | }
19 | return false;
20 | }
21 |
22 | public static Timestamp getCurrentTime() {
23 | return new Timestamp(System.currentTimeMillis());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/spring-boot-file/src/main/resources/settings.properties:
--------------------------------------------------------------------------------
1 | appid=8218a6b0-2d74-11e8-9997-218659f8f259
2 | appsecret=ffdfbf70-2d74-11e8-9997-218659f8f259
3 | #订单通知广播地址群
4 | orderChangeNotifyURLs=${JL_APP_ORDERCHANGENOTIFY:http://192.168.1.52:4002/openapi/v1/tripDetail/listenOrderChange}
5 | #所有项目头地址
6 | #url=https://t.jingli365.com/
7 | url=${JL_APP_URL:https://j.jingli365.com/}
8 | #小tmcurl
9 | #adapterUrl=${JL_APP_ADAPTER_URL:https://j.jingli365.com/proj/tmc-tmc-adapter-#adapterName/}
10 | adapterUrl=https://j.jingli365.com/proj/tmc-tmc-adapter-#adapterName/
11 | #基础数据请求地址
12 | marshmallowUrl=${JL_APP_MARSHMALLOW_URL:https://j.jingli365.com/svc/java-jingli-marshmallow/}
13 | #美亚logoUrl
14 | meiyaLogoUrl=static/logo/meiya.png
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/jms-spring/src/main/java/com/imooc/jms/producer/AppProducer.java:
--------------------------------------------------------------------------------
1 | package com.imooc.jms.producer;
2 |
3 | import org.springframework.context.ApplicationContext;
4 | import org.springframework.context.support.ClassPathXmlApplicationContext;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/02/10 11:39
10 | */
11 | public class AppProducer {
12 | public static void main(String[] args) {
13 | ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("producer.xml");
14 | ProducerService service = context.getBean(ProducerService.class);
15 | for (int i = 0; i < 100; i++) {
16 | service.sendMessage("test" + i);
17 | }
18 | context.close();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/ReservationResult.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | /**
7 | * @Description: 预定结果
8 | * @author: Gao Hang Hang
9 | * @date 2019/02/28 16:04
10 | */
11 | @Getter
12 | @Setter
13 | public class ReservationResult {
14 | boolean success;
15 | T data;
16 | String error;
17 |
18 | public ReservationResult(boolean success, String error) {
19 | this.success = success;
20 | this.error = error;
21 | }
22 |
23 | public ReservationResult(boolean success, T data) {
24 | this.success = success;
25 | this.data = data;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/java/com/gaohanghang/easyexceldemo/controller/BaseExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.easyexceldemo.controller;
2 |
3 | import entity.Result;
4 | import entity.StatusCode;
5 | import org.springframework.web.bind.annotation.ControllerAdvice;
6 | import org.springframework.web.bind.annotation.ExceptionHandler;
7 | import org.springframework.web.bind.annotation.ResponseBody;
8 |
9 | /**
10 | * 统一异常处理类
11 | */
12 | @ControllerAdvice
13 | public class BaseExceptionHandler {
14 |
15 | @ExceptionHandler(value = Exception.class)
16 | @ResponseBody
17 | public Result error(Exception e){
18 | e.printStackTrace();
19 | return new Result(false, StatusCode.ERROR, "执行出错");
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/financial-system/sql/seller.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE `order_t` (
2 | `order_id` varchar(50) NOT NULL COMMENT '订单编号',
3 | `chan_id` varchar(50) NOT NULL COMMENT '渠道编号',
4 | `product_id` varchar(50) NOT NULL COMMENT '产品编号',
5 | `chan_user_id` varchar(50) NOT NULL COMMENT '渠道用户编号',
6 | `order_type` varchar(50) NOT NULL COMMENT '典型,APPLY:申购,REDEEM:赎回',
7 | `order_status` varchar(50) NOT NULL COMMENT '状态,INIT:初始化,PROCESS:处理中,SUCCESS:成功,FAIL:失败',
8 | `outer_order_id` varchar(50) NOT NULL COMMENT '外部订单编号',
9 | `amount` decimal(15,3) NOT NULL COMMENT '金额',
10 | `memo` varchar(200) DEFAULT NULL COMMENT '备注',
11 | `create_at` datetime DEFAULT NULL COMMENT '创建时间',
12 | `update_at` datetime DEFAULT NULL COMMENT '更新时间',
13 | PRIMARY KEY (`order_id`)
14 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--------------------------------------------------------------------------------
/spring-boot-file/src/main/resources/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Getting Started: Serving Web Content
5 |
6 |
7 |
8 | Get your greeting here
9 |
13 | 下载test
14 | 多文件上传
15 |
20 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/User.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.NoArgsConstructor;
5 | import lombok.Setter;
6 | import lombok.ToString;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/28 16:07
12 | */
13 | @NoArgsConstructor
14 | @Getter
15 | @Setter
16 | @ToString
17 | public class User {
18 | private int userId;
19 | private String userName;
20 | private String passWd;
21 | private String rname;
22 | private String phone;
23 | private String email;
24 |
25 | public User(String userName, String passWd) {
26 | this.userName = userName;
27 | this.passWd = passWd;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/common/enums/Group.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.common.enums;
2 |
3 | public enum Group {
4 | PERSON("Person","男人"),
5 | WOMAN("Woman","女人"),
6 | CREDITCARD("CreditCard","信用卡/银行卡"),
7 | INSURGENT("Insurgent","嫌疑人"),
8 | QQ("QQ","微信"),
9 | WHATSAPP("WhatsApp","WhatsApp"),
10 | DD("DD","钉钉"),
11 | BUILDING("Building","建筑"),;
12 |
13 | //自定义字段
14 | private String code;
15 | private String name;
16 |
17 | //构造方法
18 | private Group(String code, String name) {
19 | this.name = name;
20 | }
21 |
22 | //一般方法
23 | public String getCode() {
24 | return this.code;
25 | }
26 |
27 | public String getName() {
28 | return this.name;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/project-common/src/main/java/entity/PageResult.java:
--------------------------------------------------------------------------------
1 | package entity;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/09 19:36
9 | */
10 | public class PageResult {
11 | private long total;
12 | private List rows;
13 |
14 | public PageResult() {
15 | }
16 |
17 | public PageResult(long total, List rows) {
18 | this.total = total;
19 | this.rows = rows;
20 | }
21 |
22 | public long getTotal() {
23 | return total;
24 | }
25 |
26 | public void setTotal(long total) {
27 | this.total = total;
28 | }
29 |
30 | public List getRows() {
31 | return rows;
32 | }
33 |
34 | public void setRows(List rows) {
35 | this.rows = rows;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/config/LogAspect.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.config;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.aspectj.lang.JoinPoint;
5 | import org.aspectj.lang.annotation.AfterThrowing;
6 | import org.aspectj.lang.annotation.Aspect;
7 | import org.springframework.stereotype.Component;
8 |
9 | import static cn.attackme.myuploader.utils.LogUtils.logToFile;
10 |
11 | @Aspect
12 | @Component
13 | @Slf4j
14 | public class LogAspect {
15 |
16 | /**
17 | * 日志切面
18 | * @param joinPoint
19 | * @param ex
20 | */
21 | @AfterThrowing(throwing = "ex", pointcut = "execution(* cn.attackme.myuploader.*.*.*(..)))")
22 | public void logPoint(JoinPoint joinPoint, Throwable ex) {
23 | logToFile(joinPoint,ex);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/controller/BaseExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.controller;
2 |
3 | import com.gaohanghang.springbootgephi.entity.Result;
4 | import com.gaohanghang.springbootgephi.entity.StatusCode;
5 | import org.springframework.web.bind.annotation.ControllerAdvice;
6 | import org.springframework.web.bind.annotation.ExceptionHandler;
7 | import org.springframework.web.bind.annotation.ResponseBody;
8 |
9 | /**
10 | * 统一异常处理类
11 | */
12 | @ControllerAdvice
13 | public class BaseExceptionHandler {
14 |
15 | @ExceptionHandler(value = Exception.class)
16 | @ResponseBody
17 | public Result error(Exception e){
18 |
19 | e.printStackTrace();
20 | return new Result(false, StatusCode.ERROR, "执行出错");
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/spring-boot-statemachine/src/main/java/top/ghang/springbootstatemachine/config/EventConfig.java:
--------------------------------------------------------------------------------
1 | package top.ghang.springbootstatemachine.config;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.springframework.statemachine.annotation.OnTransition;
5 | import org.springframework.statemachine.annotation.WithStateMachine;
6 |
7 | @WithStateMachine
8 | @Slf4j
9 | public class EventConfig {
10 |
11 | @OnTransition(target = "UNPAID")
12 | public void create() {
13 | log.info("订单创建,待支付");
14 | }
15 |
16 | @OnTransition(source = "UNPAID", target = "WAITING_FOR_RECEIVE")
17 | public void pay() {
18 | log.info("用户完成支付,待收货");
19 | }
20 |
21 | @OnTransition(source = "WAITING_FOR_RECEIVE", target = "DONE")
22 | public void receive() {
23 | log.info("用户已收货,订单完成");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/interceptor/MyAdapter.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.interceptor;
2 |
3 | import org.hibernate.criterion.Order;
4 | import org.springframework.core.Ordered;
5 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/01/30 18:27
12 | */
13 | public class MyAdapter extends WebMvcConfigurerAdapter {
14 | public void addViewController(ViewControllerRegistry registry) {
15 | registry.addViewController( "/" ).setViewName( "forward:/login.shtml" );
16 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
17 | super.addViewControllers( registry );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/spring-boot-mail/README.md:
--------------------------------------------------------------------------------
1 | # spring-boot-mail
2 | https://gitee.com/52itstyle/spring-boot-mail
3 |
4 | 邮件发送服务,文本,附件,模板,队列,多线程,定时任务实现多种功能!!!
5 |
6 | ## 开发环境
7 |
8 | JDK1.8、Maven、Idea、SpringBoot1.5.9、spring-boot-starter-mail、spring-boot-starter-thymeleaf、spring-boot-starter-freemarker、Dubbo、Zookeeper、Redis、Spring data jpa
9 |
10 | ## 流程图
11 |
12 | ### 平台架构
13 | 
14 |
15 | ### 进程内邮件队列
16 | 
17 |
18 | ## 项目结构
19 |
20 | - 普通文本发送
21 | - 富文本发送(图片、附件)
22 | - freeMarker模版发送邮件
23 | - thymeleaf模版发送邮件
24 |
25 |
26 | # 评测生成模版时间对比(1000次循环)
27 |
28 |
29 | - Thymeleaf用时:2686ms
30 | - Freemarker用时:498ms
31 |
32 | 对比测试,建议使用Freemarker模版
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/jms-spring/src/main/resources/producer.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/spring-boot-online-executor/src/test/java/com/gaohanghang/springbootonlineexecutor/execute/ByteUtilsTest.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootonlineexecutor.execute;
2 |
3 | import org.junit.Test;
4 | import org.junit.runner.RunWith;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 | import org.springframework.test.context.junit4.SpringRunner;
7 |
8 | import java.util.Arrays;
9 |
10 | @RunWith(SpringRunner.class)
11 | @SpringBootTest
12 | public class ByteUtilsTest {
13 |
14 | @Test
15 | public void test1() {
16 | byte[] b = ByteUtils.string2Byte("a");
17 | System.out.println(Arrays.toString(b));
18 | int num = ByteUtils.byte2Int(b, 0, b.length);
19 | System.out.println(num);
20 | b = ByteUtils.int2Byte(num, b.length);
21 | System.out.println(Arrays.toString(b));
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/dao/FileDao.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.dao;
2 |
3 | import cn.attackme.myuploader.model.File;
4 | import org.apache.ibatis.annotations.Mapper;
5 |
6 | @Mapper
7 | public interface FileDao {
8 | /**
9 | * 通过主键获取一行数据
10 | * @return
11 | */
12 | File getById(Long id);
13 |
14 | /**
15 | * 插入一行数据
16 | * @param file
17 | * @return
18 | */
19 | int save(File file);
20 |
21 | /**
22 | * 更新一行数据
23 | * @param file
24 | * @return
25 | */
26 | int update(File file);
27 |
28 | /**
29 | * 删除一行数据
30 | * @param id
31 | * @return
32 | */
33 | int deleteById(Long id);
34 |
35 | /**
36 | * 根据一个或多个属性获取File
37 | * @param file
38 | * @return
39 | */
40 | File getByFile(File file);
41 | }
42 |
--------------------------------------------------------------------------------
/spring-boot-message-board/README.md:
--------------------------------------------------------------------------------
1 | # SpringBoot实现留言版
2 | ## 简介
3 |
4 | 使用SpringBoot实现的一个非常简单的留言板
5 |
6 | ## 使用的技术
7 |
8 | 开发工具:Intellij IDEA
9 | 数据库:MySQL
10 | 开发框架:SpringBoot
11 | 包括的技术:Spring Boot、Spring Data Jpa、Mysql、Swagger、bootstrap
12 |
13 | ## 快速开始
14 |
15 | 创建数据库: messageboard
16 |
17 | 导入项目后,运行DemoApplication.java
18 |
19 | ## Swagger接口文档
20 |
21 | > 使用下面的url打开
22 | > http://localhost:8080/messageBoard/swagger-ui.html
23 |
24 | 
25 |
26 | ## 运行截图
27 |
28 | 
29 |
30 | 
31 |
32 | # 亮点
33 |
34 | - 实时在线聊天
35 | - swagger查看接口文档
36 |
37 | # 待优化
38 |
39 | - address路径动态化 已解完成
40 | - 服务器与客户端建立长连接,而不是每次客户端请求服务器获取新数据
41 | - 服务器断开后,客户端服务异常
42 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/java/com/gaohanghang/messageboard/utils/Response.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.messageboard.utils;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/25 10:55
7 | */
8 | public class Response {
9 | private String status;
10 | private Object content;
11 |
12 | public Response() {
13 | }
14 |
15 | public Response(String status, Object content) {
16 | this.status = status;
17 | this.content = content;
18 | }
19 |
20 | public String getStatus() {
21 | return status;
22 | }
23 |
24 | public void setStatus(String status) {
25 | this.status = status;
26 | }
27 |
28 | public Object getContent() {
29 | return content;
30 | }
31 |
32 | public void setContent(Object content) {
33 | this.content = content;
34 | }
35 | }
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/entity/PageResult.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.entity;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/09 19:36
9 | */
10 | public class PageResult {
11 | private long total;
12 | private List rows;
13 |
14 | public PageResult() {
15 | }
16 |
17 | public PageResult(long total, List rows) {
18 | this.total = total;
19 | this.rows = rows;
20 | }
21 |
22 | public long getTotal() {
23 | return total;
24 | }
25 |
26 | public void setTotal(long total) {
27 | this.total = total;
28 | }
29 |
30 | public List getRows() {
31 | return rows;
32 | }
33 |
34 | public void setRows(List rows) {
35 | this.rows = rows;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/entity/BookList.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.entity;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.Getter;
6 | import lombok.Setter;
7 | import lombok.ToString;
8 |
9 | import java.util.Date;
10 |
11 | /**
12 | * @Description:
13 | * @author: Gao Hang Hang
14 | * @date 2019/02/28 13:35
15 | */
16 | @Getter
17 | @Setter
18 | @ToString
19 | @EqualsAndHashCode
20 | public class BookList {
21 | private String isbn; //国际标准书号
22 | private String bname;
23 | private String publisher; //出版者
24 | private String writer; //作者
25 | @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
26 | private Date ptime;
27 | private int number; //编号
28 | private int operator; //操作者
29 | }
30 |
--------------------------------------------------------------------------------
/springboot_logstash/src/main/java/com/dalaoyang/SpringbootLogstashApplication.java:
--------------------------------------------------------------------------------
1 | package com.dalaoyang;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 | import org.springframework.web.bind.annotation.RestController;
9 |
10 | @SpringBootApplication
11 | @RestController
12 | public class SpringbootLogstashApplication {
13 |
14 | Logger logger = LoggerFactory.getLogger(SpringbootLogstashApplication.class);
15 |
16 | public static void main(String[] args) {
17 | SpringApplication.run(SpringbootLogstashApplication.class, args);
18 | }
19 |
20 | @GetMapping("test")
21 | public void test(){
22 | logger.info("测试初始一些日志吧!");
23 | }
24 |
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/jdbc-games-store/jdbc-games-store.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/jms-spring/src/main/resources/consumer.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/io-download-picture/io-download-picture.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/jms-test/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.imooc
8 | jms-test
9 | 1.0-SNAPSHOT
10 |
11 |
12 |
13 | javax.jms
14 | javax.jms-api
15 | 2.0.1
16 |
17 |
18 |
19 | org.apache.activemq
20 | activemq-core
21 | 5.7.0
22 |
23 |
24 |
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.ghang
8 | jdbc-easy-meal-card-system
9 | 1.0-SNAPSHOT
10 |
11 |
12 |
13 | mysql
14 | mysql-connector-java
15 | 6.0.6
16 |
17 |
18 | log4j
19 | log4j
20 | 1.2.16
21 |
22 |
23 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | thymeleaf:
3 | cache: false
4 | prefix: classpath:/templates/
5 | suffix: .html
6 | encoding: utf-8
7 | mode: HTML5
8 | datasource:
9 | name: test
10 | url: jdbc:mysql://localhost:3306/library?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
11 | username: root
12 | password: root
13 | # 使用druid数据源
14 | type: com.alibaba.druid.pool.DruidDataSource
15 | driver-class-name: com.mysql.cj.jdbc.Driver
16 | mail:
17 | host: smtp.163.com
18 | username: 18595739675@163.com
19 | password: 1124512195
20 | default-encoding: utf-8
21 | mybatis:
22 | mapper-locations: classpath:Mapper/*.xml
23 | type-aliases-package: com.gaohanghang.springbootmanagebooks.entity
24 | configuration:
25 | map-underscore-to-camel-case: true
26 |
27 | mail:
28 | fromMail:
29 | addr: 18595739675@163.com
--------------------------------------------------------------------------------
/nio-group-chat-software/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.gaohanghang
8 | nio-group-chat-software
9 | 1.0-SNAPSHOT
10 |
11 |
12 |
13 | org.apache.maven.plugins
14 | maven-compiler-plugin
15 |
16 | 7
17 | 7
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/resources/static/common.js:
--------------------------------------------------------------------------------
1 | dialogOpen = function(opt){
2 | var defaults = {
3 | id : 'layerForm',
4 | title : '',
5 | width: '',
6 | height: '',
7 | url : null,
8 | scroll : false,
9 | data : {},
10 | btn: ['确定', '取消'],
11 | success: function(){},
12 | yes: function(){}
13 | }
14 | var option = $.extend({}, defaults, opt), content = null;
15 | if(option.scroll){
16 | content = [option.url]
17 | }else{
18 | content = [option.url, 'no']
19 | }
20 | top.layer.open({
21 | type : 2,
22 | id : option.id,
23 | title : option.title,
24 | closeBtn : 1,
25 | anim: -1,
26 | isOutAnim: false,
27 | shadeClose : false,
28 | shade : 0.3,
29 | area : [option.width, option.height],
30 | content : content,
31 | btn: option.btn,
32 | success: function(){
33 | option.success(option.id);
34 | },
35 | yes: function(){
36 | option.yes(option.id);
37 | }
38 | });
39 | }
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/service/UserServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.service;
2 |
3 | import com.gaohanghang.springbootmanagebooks.dao.UserMapper;
4 | import com.gaohanghang.springbootmanagebooks.entity.User;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Service;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/28 16:46
12 | */
13 | @Service
14 | public class UserServiceImpl implements UserService {
15 |
16 | @Autowired(required = false) // 有bean就注入,没有就不注入
17 | UserMapper userMapper;
18 |
19 | @Override
20 | public User checkUser(User user) {
21 | return userMapper.checkUser(user);
22 | }
23 |
24 | @Override
25 | public User checkManager(User user) {
26 | return userMapper.checkManager(user);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/src/main/java/com/imooc/miaosha/service/UserService.java:
--------------------------------------------------------------------------------
1 | package com.imooc.miaosha.service;
2 |
3 | import com.imooc.miaosha.dao.UserDao;
4 | import com.imooc.miaosha.domain.User;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | @Service
10 | public class UserService {
11 |
12 | @Autowired
13 | UserDao userDao;
14 |
15 | public User getById(int id){
16 | return userDao.getById(id);
17 | }
18 |
19 |
20 | @Transactional
21 | public boolean tx() {
22 | User u1 = new User();
23 | u1.setId(2);
24 | u1.setName("2222");
25 | userDao.insert(u1);
26 |
27 | User u2 = new User();
28 | u1.setId(1);
29 | u1.setName("11111");
30 | userDao.insert(u2);
31 |
32 | return true;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/test/java/com/gaohanghang/springbootgephi/Test.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi;
2 |
3 | import java.text.ParseException;
4 | import java.text.SimpleDateFormat;
5 | import java.time.LocalDateTime;
6 | import java.time.format.DateTimeFormatter;
7 | import java.util.Date;
8 | import java.util.Locale;
9 |
10 | public class Test {
11 | public static void main(String[] args) throws ParseException {
12 | String date = "Thu Aug 27 18:05:49 CST 2015";
13 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
14 | String formatDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(simpleDateFormat.parse(date));
15 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
16 | LocalDateTime localDateTime = LocalDateTime.parse(formatDate, formatter);
17 | System.out.println(localDateTime);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/web/IndexController.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.web;
2 |
3 | import io.swagger.annotations.Api;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.PathVariable;
6 |
7 | /**
8 | * 通用访问拦截匹配
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/01 17:02
12 | */
13 | @Api(tags = "通用访问拦截匹配")
14 | public class IndexController {
15 |
16 | /**
17 | * 页面跳转
18 | * @param url
19 | * @return
20 | */
21 | @GetMapping("{url}.shtml")
22 | public String page(@PathVariable("url") String url) {
23 | return url;
24 | }
25 |
26 | /**
27 | * 页面跳转(二级目录)
28 | * @param module
29 | * @param url
30 | * @return
31 | */
32 | public String page(@PathVariable("module") String module, @PathVariable("url") String url) {
33 | return module + "/" + url;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/entity/Edges.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.entity;
2 |
3 | import lombok.*;
4 |
5 | import javax.persistence.Entity;
6 | import javax.persistence.GeneratedValue;
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 | import java.io.Serializable;
10 | import java.util.Date;
11 |
12 | @Entity
13 | @Data
14 | @Table(name="edges")
15 | @Getter
16 | @Setter
17 | @ToString
18 | @AllArgsConstructor
19 | public class Edges implements Serializable {
20 | private static final long serialVersionUID = 1L;
21 | @Id
22 | @GeneratedValue
23 | private String id;
24 |
25 |
26 | private String source;
27 |
28 | private String target;
29 |
30 | private String weight;
31 |
32 |
33 | private String label;
34 |
35 |
36 | private Date date;
37 |
38 |
39 | private Date createTime;
40 |
41 |
42 | private Date updateTime;
43 |
44 | public Edges() {
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/socket/StartServer.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.socket;
2 |
3 | import java.io.IOException;
4 | import java.net.ServerSocket;
5 | import java.net.Socket;
6 |
7 | /**
8 | * @Description: 启动服务器
9 | * @author: Gao Hang Hang
10 | * @date 2019/02/09 14:52
11 | */
12 | public class StartServer {
13 | public static void main(String[] args) {
14 | try {
15 | // 创建服务器Socket, 绑定指定端口
16 | ServerSocket serverSocket = new ServerSocket(8800);
17 | Socket socket = null;
18 | System.out.println("服务器即将启动,等待客户端连接*****");
19 | while (true) { //服务器循环监听客户端的连接请求
20 | // 开始监听,等待客户端连接
21 | socket = serverSocket.accept();
22 | // 多线程通信
23 | ServerThread thread = new ServerThread(socket);
24 | thread.start();
25 | }
26 | } catch (IOException e) {
27 | e.printStackTrace();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/financial-system/sql/manager.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE `product` (
2 | `id` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '产品编号',
3 | `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '产品名称',
4 | `threshold_amount` decimal(15,3) NOT NULL COMMENT '起投金额',
5 | `step_amount` decimal(15,3) NOT NULL COMMENT '投资步长',
6 | `lock_term` smallint(6) NOT NULL COMMENT '锁定期',
7 | `reward_rate` decimal(5,3) NOT NULL COMMENT '收益率,1-100 百分比值',
8 | `status` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '状态,AUDINTING:审核中,IN_SELL:销售中,LOCKED:暂停销售,FINISHED:已结束',
9 | `memo` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
10 | `create_at` datetime DEFAULT NULL COMMENT '创建时间',
11 | `create_user` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '创建者',
12 | `update_at` datetime DEFAULT NULL COMMENT '更新时间',
13 | `update_user` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '更新者',
14 | PRIMARY KEY (`id`)
15 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
16 |
17 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/resources/spring-context-dubbo.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/spring-boot-shiro/src/main/java/org/hackerandpainter/springbootshiro/MyRealm.java:
--------------------------------------------------------------------------------
1 | package org.hackerandpainter.springbootshiro;
2 |
3 | import org.apache.shiro.authc.*;
4 | import org.apache.shiro.authz.AuthorizationInfo;
5 | import org.apache.shiro.realm.AuthorizingRealm;
6 | import org.apache.shiro.subject.PrincipalCollection;
7 |
8 | /**
9 | * @Author 江南一点雨
10 | * @Site www.javaboy.org 2019-06-05 11:10
11 | */
12 | public class MyRealm extends AuthorizingRealm {
13 |
14 | @Override
15 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
16 | return null;
17 | }
18 |
19 | @Override
20 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
21 | String username = (String) token.getPrincipal();
22 | if (!"javaboy".equals(username)) {
23 | throw new UnknownAccountException("账户不存在!");
24 | }
25 | return new SimpleAuthenticationInfo(username, "123", getName());
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/jdbc-games-store/src/main/java/entity/Shop.java:
--------------------------------------------------------------------------------
1 | package entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/01/23 09:53
9 | */
10 | public class Shop implements Serializable {
11 | private Integer id;//主键
12 | private String name;//
13 | private Double money;
14 |
15 | public Shop() {
16 | }
17 |
18 | public Shop(Integer id, String name, Double money) {
19 | this.id = id;
20 | this.name = name;
21 | this.money = money;
22 | }
23 |
24 | public Integer getId() {
25 | return id;
26 | }
27 |
28 | public void setId(Integer id) {
29 | this.id = id;
30 | }
31 |
32 | public String getName() {
33 | return name;
34 | }
35 |
36 | public void setName(String name) {
37 | this.name = name;
38 | }
39 |
40 | public Double getMoney() {
41 | return money;
42 | }
43 |
44 | public void setMoney(Double money) {
45 | this.money = money;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/controller/QuickUploadController.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.controller;
2 |
3 | import cn.attackme.myuploader.service.FileService;
4 | import io.swagger.annotations.Api;
5 | import io.swagger.annotations.ApiOperation;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.web.bind.annotation.CrossOrigin;
8 | import org.springframework.web.bind.annotation.GetMapping;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.RestController;
11 |
12 | /**
13 | * 秒传
14 | */
15 | @RestController
16 | @RequestMapping("/QuickUpload")
17 | @CrossOrigin
18 | @Api(tags = "文件秒传相关接口", description = "提供文件秒传相关的 Rest API")
19 | public class QuickUploadController {
20 | @Autowired
21 | private FileService fileService;
22 |
23 | @ApiOperation("文件秒传接口")
24 | @GetMapping("/")
25 | public boolean upload(String md5) {
26 | return fileService.checkMd5(md5);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/entity/File.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @Description: 文件实体类
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/09 13:40
9 | */
10 | public class File implements Serializable {
11 | private int fid;
12 | private String fname;
13 | private byte[] fcontent;
14 |
15 | public File() {
16 | }
17 |
18 | public File(String fname, byte[] fcontent) {
19 | super();
20 | this.fname = fname;
21 | this.fcontent = fcontent;
22 | }
23 |
24 | public int getFid() {
25 | return fid;
26 | }
27 |
28 | public void setFid(int fid) {
29 | this.fid = fid;
30 | }
31 |
32 | public String getFname() {
33 | return fname;
34 | }
35 |
36 | public void setFname(String fname) {
37 | this.fname = fname;
38 | }
39 |
40 | public byte[] getFcontent() {
41 | return fcontent;
42 | }
43 |
44 | public void setFcontent(byte[] fcontent) {
45 | this.fcontent = fcontent;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/socket-study/src/Test01.java:
--------------------------------------------------------------------------------
1 | import java.net.InetAddress;
2 | import java.net.UnknownHostException;
3 | import java.util.Arrays;
4 |
5 | /**
6 | * @Description: InetAddress
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/08 17:41
9 | */
10 | public class Test01 {
11 | public static void main(String[] args) throws UnknownHostException {
12 | // 获取本机的InetAddress实例
13 | InetAddress address = InetAddress.getLocalHost();
14 | System.out.println("计算机名:" + address.getHostName());
15 | System.out.println("IP地址:" + address.getHostAddress());
16 | byte[] bytes = address.getAddress();//获取字节数组形式的IP地址
17 | System.out.println("字节数组形式的IP:" + Arrays.toString(bytes));
18 | System.out.println(address); //直接输出InetAddress对象
19 |
20 | // 根据机器名获取InetAddress实例
21 | // InetAddress address2 = InetAddress.getByName("bogon");
22 | InetAddress address2 = InetAddress.getByName("192.168.21.100");
23 | System.out.println("计算机名:" + address2.getHostName());
24 | System.out.println("IP地址:" + address2.getHostAddress()); }
25 | }
26 |
--------------------------------------------------------------------------------
/socket-study/src/Test02.java:
--------------------------------------------------------------------------------
1 | import java.net.MalformedURLException;
2 | import java.net.URL;
3 |
4 | /**
5 | * @Description: URL常用方法
6 | * @author: Gao Hang Hang
7 | * @date 2019/02/08 17:51
8 | */
9 | public class Test02 {
10 | public static void main(String[] args) {
11 | try {
12 | // 创建一个URL实例
13 | URL imooc = new URL("http://www.imooc.com");
14 | // ?后面表示参数,#后面表示锚点
15 | URL url = new URL(imooc, "/index.html?username=tom#test");
16 | System.out.println("协议:" + url.getProtocol());
17 | System.out.println("主机:" + url.getHost());
18 | // 如果未指定端口号,则使用默认的端口号,此时getPort()方法返回值为-1
19 | System.out.println("端口:" + url.getPort());
20 | System.out.println("文件路径:" + url.getPath());
21 | System.out.println("文件名:" + url.getFile());
22 | System.out.println("相对路径:" + url.getRef());
23 | System.out.println("查询字符串:" + url.getQuery());
24 |
25 | } catch (MalformedURLException e) {
26 | e.printStackTrace();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/jdbc-girl/jdbc-girl.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/static/lib/css/signin.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 40px;
3 | padding-bottom: 40px;
4 | background-color: #eee;
5 | }
6 |
7 | .form-signin {
8 | max-width: 330px;
9 | padding: 15px;
10 | margin: 0 auto;
11 | }
12 |
13 | .form-signin .form-signin-heading,
14 | .form-signin .checkbox {
15 | margin-bottom: 10px;
16 | }
17 |
18 | .form-signin .checkbox {
19 | font-weight: normal;
20 | }
21 |
22 | .form-signin .form-control {
23 | position: relative;
24 | height: auto;
25 | -webkit-box-sizing: border-box;
26 | -moz-box-sizing: border-box;
27 | box-sizing: border-box;
28 | padding: 10px;
29 | font-size: 16px;
30 | }
31 |
32 | .form-signin .form-control:focus {
33 | z-index: 2;
34 | }
35 |
36 | .form-signin input[type="email"] {
37 | margin-bottom: -1px;
38 | border-bottom-right-radius: 0;
39 | border-bottom-left-radius: 0;
40 | }
41 |
42 | .form-signin input[type="password"] {
43 | margin-bottom: 10px;
44 | border-top-left-radius: 0;
45 | border-top-right-radius: 0;
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/test/java/com/gaohanghang/mail/countDownLatch/verifier/BaseHealthChecker.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.countDownLatch.verifier;
2 |
3 | import java.util.concurrent.CountDownLatch;
4 |
5 | public abstract class BaseHealthChecker implements Runnable {
6 |
7 | private CountDownLatch _latch;
8 | private String _serviceName;
9 | private boolean _serviceUp;
10 |
11 | public BaseHealthChecker(String serviceName, CountDownLatch latch)
12 | {
13 | super();
14 | this._latch = latch;
15 | this._serviceName = serviceName;
16 | this._serviceUp = false;
17 | }
18 |
19 | @Override
20 | public void run() {
21 | try {
22 | verifyService();
23 | _serviceUp = true;
24 | } catch (Throwable t) {
25 | t.printStackTrace(System.err);
26 | _serviceUp = false;
27 | } finally {
28 | if(_latch != null) {
29 | _latch.countDown();
30 | }
31 | }
32 | }
33 |
34 | public String getServiceName() {
35 | return _serviceName;
36 | }
37 |
38 | public boolean isServiceUp() {
39 | return _serviceUp;
40 | }
41 |
42 | public abstract void verifyService();
43 | }
44 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/css/modules/code.css:
--------------------------------------------------------------------------------
1 | /** layui-v2.4.5 MIT License By https://www.layui.com */
2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/jsonexporter/model/GraphElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package com.gaohanghang.springbootgephi.jsonexporter.model;
6 |
7 | import java.util.HashMap;
8 |
9 | /**
10 | * @author shale
11 | */
12 | public class GraphElement {
13 | protected double size;
14 | private HashMap attributes;
15 |
16 | public GraphElement() {
17 | attributes = new HashMap();
18 | }
19 |
20 | public void putAttribute(String key, String value) {
21 | attributes.put(key, value);
22 | }
23 |
24 | public HashMap getAttributes() {
25 | return attributes;
26 | }
27 |
28 | public void putAttributes(HashMap attributes) {
29 | this.attributes = attributes;
30 | }
31 |
32 | public double getSize() {
33 | return size;
34 | }
35 |
36 | public void setSize(double size) {
37 | this.size = size;
38 | }
39 |
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/entity/User.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.entity;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @Description: 用户实体类
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/09 13:39
9 | */
10 | public class User implements Serializable {
11 |
12 | private int id;//编号
13 | private String username;//用户名
14 | private String password;//密码
15 |
16 | public User() {
17 | super();
18 | }
19 |
20 | public User(String username, String password) {
21 | this.username = username;
22 | this.password = password;
23 | }
24 |
25 | public int getId() {
26 | return id;
27 | }
28 |
29 | public void setId(int id) {
30 | this.id = id;
31 | }
32 |
33 | public String getUsername() {
34 | return username;
35 | }
36 |
37 | public void setUsername(String username) {
38 | this.username = username;
39 | }
40 |
41 | public String getPassword() {
42 | return password;
43 | }
44 |
45 | public void setPassword(String password) {
46 | this.password = password;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/util/CommandTransfer.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.util;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @Description: 此类表示客户机和服务器之间传输的指令数据
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/09 14:06
9 | */
10 | public class CommandTransfer implements Serializable {
11 | private String cmd;//当前操作的命令
12 | private Object data;//发送的数据
13 | private boolean flag;//操作是否成功
14 | private String result;//返回的结果
15 |
16 | public String getCmd() {
17 | return cmd;
18 | }
19 |
20 | public void setCmd(String cmd) {
21 | this.cmd = cmd;
22 | }
23 |
24 | public Object getData() {
25 | return data;
26 | }
27 |
28 | public void setData(Object data) {
29 | this.data = data;
30 | }
31 |
32 | public boolean isFlag() {
33 | return flag;
34 | }
35 |
36 | public void setFlag(boolean flag) {
37 | this.flag = flag;
38 | }
39 |
40 | public String getResult() {
41 | return result;
42 | }
43 |
44 | public void setResult(String result) {
45 | this.result = result;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/jms-spring/src/main/java/com/imooc/jms/producer/ProducerServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.imooc.jms.producer;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.jms.core.JmsTemplate;
5 | import org.springframework.jms.core.MessageCreator;
6 |
7 | import javax.annotation.Resource;
8 | import javax.jms.*;
9 |
10 | /**
11 | * @Description:
12 | * @author: Gao Hang Hang
13 | * @date 2019/02/10 11:32
14 | */
15 | public class ProducerServiceImpl implements ProducerService {
16 |
17 | @Autowired
18 | JmsTemplate jmsTemplate;
19 | @Resource(name = "topicDestination")
20 | Destination destination;
21 |
22 | public void sendMessage(final String message) {
23 | // 使用JmsTemplate发送消息
24 | jmsTemplate.send(destination, new MessageCreator() {
25 | // 创建一个消息
26 | public Message createMessage(Session session) throws JMSException {
27 | TextMessage textMessage = session.createTextMessage(message);
28 | return textMessage;
29 | }
30 | });
31 | System.out.println("发送消息:" + message);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/jms-spring/README.md:
--------------------------------------------------------------------------------
1 | # Java消息中间件实战
2 |
3 | >慕课网 [Java消息中间件](https://www.imooc.com/video/15224)
4 |
5 | 
6 |
7 | 
8 |
9 |
10 | 
11 |
12 | 
13 |
14 | 
15 |
16 |
17 | 
18 |
19 | 
20 |
21 | 
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 | 
30 |
31 | 
32 |
33 |
34 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/service/FileService.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.service;
2 |
3 | import src.com.imooc.entity.File;
4 | import src.com.imooc.util.DBUtil;
5 |
6 | import java.sql.Connection;
7 | import java.sql.PreparedStatement;
8 | import java.sql.ResultSet;
9 | import java.sql.SQLException;
10 |
11 | /**
12 | * @Description:
13 | * @author: Gao Hang Hang
14 | * @date 2019/02/09 13:44
15 | */
16 | public class FileService {
17 | private Connection conn = null;
18 | private PreparedStatement pstmt = null;
19 | private ResultSet rs = null;
20 |
21 | // 将文件保存到数据库中
22 | public void save(File file) {
23 | String sql = "insert into tb_file(fname,fcontent) values (?,?)";
24 | try {
25 | conn = conn = DBUtil.getConnection();
26 | pstmt = conn.prepareStatement(sql);
27 | pstmt.setString(1, file.getFname());
28 | pstmt.setBytes(2, file.getFcontent());
29 | pstmt.executeUpdate();
30 | } catch (SQLException e) {
31 | e.printStackTrace();
32 | } finally {
33 | DBUtil.clostAll(rs, pstmt, conn);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/test/java/com/gaohanghang/springbootgephi/Test2.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi;
2 |
3 | import com.gaohanghang.springbootgephi.common.enums.Group;
4 | import com.google.gson.Gson;
5 | import com.google.gson.GsonBuilder;
6 | import org.json.JSONException;
7 |
8 | import java.io.FileWriter;
9 | import java.io.Writer;
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | public class Test2 {
14 | public static void main(String[] args) throws JSONException {
15 | try{
16 | List foo = new ArrayList();
17 | foo.add("1");
18 | foo.add("2");
19 | foo.add("3");
20 | System.out.println("values :: "+foo);
21 | Writer writer = new FileWriter("operatorList.json");
22 | Gson gson = new GsonBuilder().create();
23 | gson.toJson(foo, writer);
24 | writer.flush(); //flush data to file <---
25 | writer.close(); //close write <---
26 | }catch(Exception e){
27 | e.printStackTrace();
28 | }
29 |
30 | System.out.println(Group.BUILDING.getName());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/spring-boot-message-board/src/main/resources/static/js/util.js:
--------------------------------------------------------------------------------
1 | var address = "http://" + location.host + "/messageBoard/";
2 |
3 | function setCookie(name, value, days) {
4 | var d = new Date;
5 | d.setTime(d.getTime() + 24*60*60*1000*days);
6 | window.document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
7 | }
8 |
9 | function getCookie(name) {
10 | var v = window.document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
11 | return v ? v[2] : null;
12 | }
13 |
14 | function getUserName(userId) {
15 | var user = {};
16 | user.userId = userId;
17 | var response;
18 | $.ajax({
19 | async : false,
20 | type : 'POST',
21 | url : address+"getUser",
22 | data : user,
23 | dataType : 'json',
24 | success : function(result) {
25 | response = result;
26 | },
27 | error : function(result) {
28 | alert('服务器异常');
29 | }
30 | });
31 | if(response.status == "0"){
32 | var user = response.content;
33 | user = JSON.parse(user);
34 | return user.userName;
35 | }
36 | else{
37 | alert(response.content);
38 | }
39 | }
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/controller/TestExceptionController.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.controller;
2 |
3 | import io.swagger.annotations.Api;
4 | import io.swagger.annotations.ApiOperation;
5 | import org.springframework.web.bind.annotation.GetMapping;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | import static cn.attackme.myuploader.utils.LogUtils.logToFile;
10 |
11 | /**
12 | * 测试日志功能
13 | */
14 | @RestController
15 | @RequestMapping("/Ex")
16 | @Api(tags = "测试日志功能接口", description = "提供测试日志功能的 Rest API")
17 | public class TestExceptionController {
18 | /**
19 | * 测试日志切面
20 | * @return
21 | */
22 | @ApiOperation("测试日志切面的接口")
23 | @GetMapping("/aspect")
24 | public int aspect() {
25 | int i = 1 / 0;
26 | return i;
27 | }
28 |
29 | /**
30 | * 测试日志util
31 | */
32 | @ApiOperation("测试日志util的接口")
33 | @GetMapping("/util")
34 | public void util() {
35 | try {
36 | System.out.println(1/0);
37 | } catch (Exception e) {
38 | logToFile(e);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/resources/static/layui/lay/modules/code.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.4.5 MIT License By https://www.layui.com */
2 | ;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('- '+o.replace(/[\r\t\n]+/g,"
- ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend(''+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"
");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/model/File.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.model;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.ToString;
6 |
7 | import java.io.Serializable;
8 | import java.util.Date;
9 |
10 | /**
11 | * File表存储上传的文件信息
12 | */
13 | @Data
14 | @AllArgsConstructor
15 | @ToString
16 | public class File implements Serializable {
17 |
18 | private static final long serialVersionUID = -6956947981866795431L;
19 |
20 | private Long id;
21 | private String name;
22 | private String md5;
23 | private String path;
24 | private Date uploadTime;
25 | private String ext; // 文件扩展名
26 |
27 | public File() {
28 | }
29 |
30 | public File(String name, String md5, String path, Date uploadTime) {
31 | this.name = name;
32 | this.md5 = md5;
33 | this.path = path;
34 | this.uploadTime = uploadTime;
35 | }
36 |
37 | public File(String name, String md5, String path, Date uploadTime, String ext) {
38 | this.name = name;
39 | this.md5 = md5;
40 | this.path = path;
41 | this.uploadTime = uploadTime;
42 | this.ext = ext;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/socket-study/ScoketDemo/src/com/imooc/util/DBUtil.java:
--------------------------------------------------------------------------------
1 | package src.com.imooc.util;
2 |
3 | import java.sql.*;
4 |
5 | /**
6 | * @Description:
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/09 13:59
9 | */
10 | public class DBUtil {
11 |
12 | // 获取数据库连接
13 | public static Connection getConnection() {
14 | String driverClassName = "com.mysql.jdbc.Driver";
15 | String url = "jdbc:mysql://localhost:3306/test";
16 | String username = "root";
17 | String password = "root";
18 | Connection conn = null;
19 | try {
20 | Class.forName(driverClassName);
21 | conn = DriverManager.getConnection(url, username, password);
22 | } catch (Exception e) {
23 | e.printStackTrace();
24 | }
25 | return conn;
26 | }
27 |
28 | // 关闭所有
29 | public static void clostAll(ResultSet rs, Statement stmt, Connection conn) {
30 | try {
31 | if(rs != null)
32 | rs.close();
33 | if (stmt != null)
34 | stmt.close();
35 | if (conn != null)
36 | conn.close();
37 | } catch (SQLException e) {
38 | e.printStackTrace();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/socket-study/src/Test03.java:
--------------------------------------------------------------------------------
1 | import java.io.BufferedReader;
2 | import java.io.IOException;
3 | import java.io.InputStream;
4 | import java.io.InputStreamReader;
5 | import java.net.MalformedURLException;
6 | import java.net.URL;
7 |
8 | /**
9 | * @Description: 使用URL读取页面内容
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/08 17:59
12 | */
13 | public class Test03 {
14 | public static void main(String[] args) {
15 | try {
16 | // 创建一个URL实例
17 | URL url = new URL("http://www.baidu.com");
18 | InputStream inputStream = url.openStream();
19 | // 将字节输入流转换为字符输入流
20 | InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
21 | // 为字符输入流添加缓冲
22 | BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
23 | String data = bufferedReader.readLine();
24 | while (data != null) { //循环读取数据
25 | System.out.println(data);
26 | data = bufferedReader.readLine();
27 | }
28 | } catch (MalformedURLException e) {
29 | e.printStackTrace();
30 | } catch (IOException e) {
31 | e.printStackTrace();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/springboot-file-uploader/src/main/java/cn/attackme/myuploader/controller/FileUploadController.java:
--------------------------------------------------------------------------------
1 | package cn.attackme.myuploader.controller;
2 |
3 | import cn.attackme.myuploader.service.FileService;
4 | import io.swagger.annotations.Api;
5 | import io.swagger.annotations.ApiOperation;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.web.bind.annotation.CrossOrigin;
8 | import org.springframework.web.bind.annotation.PostMapping;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.RestController;
11 | import org.springframework.web.multipart.MultipartFile;
12 |
13 | import java.io.IOException;
14 |
15 | /**
16 | * 文件上传
17 | */
18 | @RestController
19 | @RequestMapping("/File")
20 | @CrossOrigin
21 | @Api(tags = "文件上传相关接口", description = "提供文件上传相关的 Rest API")
22 | public class FileUploadController {
23 | @Autowired
24 | private FileService fileService;
25 |
26 | @ApiOperation("文件上传接口")
27 | @PostMapping("/")
28 | public void upload(String name,
29 | String md5,
30 | MultipartFile file) throws IOException {
31 | fileService.upload(name, md5,file);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/src/main/java/utils/JdbcUtil.java:
--------------------------------------------------------------------------------
1 | package utils;
2 |
3 | import java.sql.Connection;
4 | import java.sql.DriverManager;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/22 17:51
10 | */
11 | public class JdbcUtil {
12 | private static final String URL = "jdbc:mysql://localhost:3306/meal_card?characterEncoding=utf8&useSSL=true";
13 | private static final String USERNAME = "root";
14 | private static final String PASSWORD = "root";
15 | // 上面分别定义了URL(统一资源定位器),USERNAME(用户名),PASSWORD(密码)
16 |
17 | private static Connection connection = null; // 定义一个空的Connection
18 |
19 | static {
20 | try {
21 | // 自Java 6(JDBC 4.0)以来,通常不需要手动加载驱动程序类Class.forName
22 | connection = DriverManager.getConnection(URL, USERNAME, PASSWORD); // 获取连接
23 | } catch (Exception e) {
24 | e.printStackTrace();
25 | }
26 | }
27 |
28 | public static Connection getConnection() {
29 | return connection;
30 | }
31 |
32 | public static void main(String[] args) {
33 | Connection connection = getConnection();
34 | if (connection!=null) {
35 | System.out.println("数据库连接成功!");
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/jdbc-easy-meal-card-system/MySQL.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Navicat Premium Data Transfer
3 |
4 | Source Server : mysql
5 | Source Server Type : MySQL
6 | Source Server Version : 50723
7 | Source Host : localhost:3306
8 | Source Schema : meal_card
9 |
10 | Target Server Type : MySQL
11 | Target Server Version : 50723
12 | File Encoding : 65001
13 |
14 | Date: 22/01/2019 21:27:01
15 | */
16 |
17 | SET NAMES utf8mb4;
18 | SET FOREIGN_KEY_CHECKS = 0;
19 |
20 | -- ----------------------------
21 | -- Table structure for card
22 | -- ----------------------------
23 | DROP TABLE IF EXISTS `card`;
24 | CREATE TABLE `card` (
25 | `id` varchar(20) NOT NULL,
26 | `name` varchar(35) DEFAULT NULL,
27 | `class_name` varchar(30) DEFAULT NULL,
28 | `money` double DEFAULT '100',
29 | `password` varchar(30) DEFAULT '000000',
30 | `num_of_bank_card` double DEFAULT '1000',
31 | PRIMARY KEY (`id`)
32 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
33 |
34 | -- ----------------------------
35 | -- Records of card
36 | -- ----------------------------
37 | BEGIN;
38 | INSERT INTO `card` VALUES ('1', 'test1', 'class1', 90, '123456', 1000);
39 | INSERT INTO `card` VALUES ('4', 'test4', 'class4', 100, '123456', 1000);
40 | COMMIT;
41 |
42 | SET FOREIGN_KEY_CHECKS = 1;
43 |
--------------------------------------------------------------------------------
/jdbc-games-store/src/main/java/entity/User.java:
--------------------------------------------------------------------------------
1 | package entity;
2 |
3 | /**
4 | * @Description: 顾客实体类
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/23 09:51
7 | */
8 | public class User {
9 | private String id;//主键
10 | private String name;//网名
11 | private String password;//登录密码
12 | private double money;//所拥有的金币
13 |
14 | public User() {
15 | }
16 |
17 | public User(String id, String name, String password, double money) {
18 | this.id = id;
19 | this.name = name;
20 | this.password = password;
21 | this.money = money;
22 | }
23 |
24 | public String getId() {
25 | return id;
26 | }
27 |
28 | public void setId(String id) {
29 | this.id = id;
30 | }
31 |
32 | public String getName() {
33 | return name;
34 | }
35 |
36 | public void setName(String name) {
37 | this.name = name;
38 | }
39 |
40 | public String getPassword() {
41 | return password;
42 | }
43 |
44 | public void setPassword(String password) {
45 | this.password = password;
46 | }
47 |
48 | public double getMoney() {
49 | return money;
50 | }
51 |
52 | public void setMoney(double money) {
53 | this.money = money;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/socket-study/src/UDPClient.java:
--------------------------------------------------------------------------------
1 | import javax.xml.crypto.Data;
2 | import java.io.IOException;
3 | import java.net.*;
4 |
5 | /**
6 | * @Description: 客户端
7 | * @author: Gao Hang Hang
8 | * @date 2019/02/09 13:15
9 | */
10 | public class UDPClient {
11 | public static void main(String[] args) throws IOException {
12 | // 1.定义服务器的地址、端口号、数据
13 | InetAddress address = InetAddress.getByName("localhost");
14 | int port = 8800;
15 | byte[] data = "用户名: admin;密码:123".getBytes();
16 | // 2.创建数据报,包含发送的数据信息
17 | DatagramPacket packet = new DatagramPacket(data, data.length, address, port);
18 | // 3.创建DatagramSocket对象
19 | DatagramSocket socket = new DatagramSocket();
20 | // 4.向服务端发送数据报
21 | socket.send(packet);
22 |
23 | /*
24 | 接收服务器端响应的数据
25 | */
26 | // 1.创建数据报,用于接收服务器端响应的数据
27 | byte[] data2 = new byte[1024];
28 | DatagramPacket packet2 = new DatagramPacket(data2, data2.length);
29 | // 2.接收服务器响应的数据
30 | socket.receive(packet2);
31 | // 3.读取数据
32 | String reply = new String(data2, 0, packet2.getLength());
33 | System.out.println("我是客户端,服务器说:" + reply);
34 | // 4.关闭资源
35 | socket.close();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/socket-study/src/Client.java:
--------------------------------------------------------------------------------
1 | import java.io.*;
2 | import java.net.Socket;
3 |
4 | /**
5 | * @Description: 客户端
6 | * @author: Gao Hang Hang
7 | * @date 2019/02/09 00:01
8 | */
9 | public class Client {
10 | public static void main(String[] args) {
11 | try {
12 | // 1.创建Socket,指定服务器地址和端口
13 | Socket socket = new Socket("localhost", 8888);
14 | // 2.获取输出流,向服务器端发送信息
15 | OutputStream os = socket.getOutputStream();//字节输出流
16 | PrintWriter pw = new PrintWriter(os);//将输出流包装为打印流
17 | pw.write("用户名:admin;密码:123");
18 | pw.flush();
19 | socket.shutdownOutput();//关闭输出流
20 | //3.获取输入流,并读取服务端的响应信息
21 | InputStream is = socket.getInputStream();
22 | BufferedReader br = new BufferedReader(new InputStreamReader(is));
23 | String info = null;
24 | while ((info=br.readLine()) != null) {
25 | System.out.println("我是客户端,服务器说:"+info);
26 | }
27 | // 4.关闭资源
28 | br.close();
29 | is.close();
30 | pw.close();
31 | os.close();
32 | socket.close();
33 | } catch (IOException e) {
34 | e.printStackTrace();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/entity/OaEmail.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.entity;
2 |
3 | import java.io.Serializable;
4 | import java.sql.Timestamp;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/26 21:56
10 | */
11 | public class OaEmail implements Serializable {
12 | private static final long serialVersionUID = 1L;
13 |
14 | /**
15 | * 自增主键
16 | */
17 | private Long id;
18 |
19 | /**
20 | * 接收人邮箱(过个逗号分开)
21 | */
22 | private String receiveEmail;
23 |
24 | /**
25 | * 主题
26 | */
27 | private String subject;
28 |
29 | /**
30 | * 发送内容
31 | */
32 | private String content;
33 |
34 | /**
35 | * 模板
36 | */
37 | private String template;
38 |
39 | /**
40 | * 发送时间
41 | */
42 | private Timestamp sendTime;
43 |
44 | public OaEmail() {
45 | super();
46 | }
47 |
48 | public OaEmail(Long id, String receiveEmail, String subject, String content, String template, Timestamp sendTime) {
49 | this.id = id;
50 | this.receiveEmail = receiveEmail;
51 | this.subject = subject;
52 | this.content = content;
53 | this.template = template;
54 | this.sendTime = sendTime;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/web/mailController.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.web;
2 |
3 | import com.gaohanghang.mail.common.model.Email;
4 | import com.gaohanghang.mail.common.model.Result;
5 | import com.gaohanghang.mail.service.IMailService;
6 | import io.swagger.annotations.Api;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.PostMapping;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RestController;
12 |
13 | /**
14 | * @Description:
15 | * @author: Gao Hang Hang
16 | * @date 2019/02/01 17:08
17 | */
18 | @Api(tags = "邮件管理")
19 | @RestController
20 | @RequestMapping("/mial")
21 | public class mailController {
22 |
23 | @Autowired
24 | private IMailService mailService;
25 |
26 | @PostMapping("send")
27 | public Result send(Email mail) {
28 | try {
29 | mailService.sendFreemarker(mail);
30 | } catch (Exception e) {
31 | e.printStackTrace();
32 | }
33 | return Result.ok();
34 | }
35 |
36 | @ApiOperation("获取所有邮件")
37 | @PostMapping("list")
38 | public Result list(Email mail) {
39 | return mailService.listMail(mail);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/nio-group-chat-software/src/main/java/bio/BIOServer.java:
--------------------------------------------------------------------------------
1 | package bio;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.net.ServerSocket;
6 | import java.net.Socket;
7 |
8 | /**
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @create: 2019/04/28 23:19
12 | */
13 | public class BIOServer {
14 |
15 | ServerSocket server;
16 |
17 | public BIOServer(int port) {
18 | try {
19 | server = new ServerSocket(port);
20 | System.out.println("IO服务已经启动,监控的端口是:" + port);
21 | } catch (IOException e) {
22 | e.printStackTrace();
23 | }
24 | }
25 |
26 | public static void main(String[] args) {
27 | new BIOServer(8081).start();
28 | }
29 |
30 | public void start() {
31 | while (true) {
32 | try {
33 | Socket client = server.accept();
34 | InputStream is = client.getInputStream();
35 | byte[] buff = new byte[1024];
36 | int len = is.read(buff);
37 | if (len > 0) {
38 | String msg = new String(buff,0,len);
39 | System.out.println("服务端已接收客户端数据,数据内容是:" + msg);
40 | }
41 | } catch (IOException e) {
42 | e.printStackTrace();
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/qrcode-img-svg/src/main/java/QRGenDemo.java:
--------------------------------------------------------------------------------
1 | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
2 | import net.glxn.qrgen.core.image.ImageType;
3 | import net.glxn.qrgen.javase.QRCode;
4 |
5 | import java.awt.*;
6 | import java.io.File;
7 | import java.io.IOException;
8 | import java.nio.file.Files;
9 | import java.nio.file.Path;
10 | import java.nio.file.Paths;
11 |
12 | public class QRGenDemo {
13 |
14 | public static void main(String[] args) throws IOException {
15 | File file = QRCode.from("wwww.google.com").to(ImageType.PNG)
16 | .withSize(200, 200)
17 | .file();
18 |
19 | String fileName = "qugen-qrcode.png";
20 |
21 | Path path = Paths.get(fileName);
22 | if (Files.exists(path)) {
23 | Files.delete(path);
24 | }
25 |
26 | Files.copy(file.toPath(), path);
27 |
28 |
29 | Path colorPath = Paths.get("qrgen-color-qrcode.png");
30 | if (Files.exists(colorPath)) {
31 | Files.delete(colorPath);
32 | }
33 |
34 | file = QRCode.from("www.google.com")
35 | .withColor(Color.RED.getRGB(), Color.WHITE.getRGB())
36 | .withSize(200, 200)
37 | .withErrorCorrection(ErrorCorrectionLevel.Q)
38 | .file();
39 | Files.copy(file.toPath(), colorPath);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-boot-shiro/src/main/java/org/hackerandpainter/springbootshiro/LoginController.java:
--------------------------------------------------------------------------------
1 | package org.hackerandpainter.springbootshiro;
2 |
3 | import org.apache.shiro.SecurityUtils;
4 | import org.apache.shiro.authc.AuthenticationException;
5 | import org.apache.shiro.authc.UsernamePasswordToken;
6 | import org.apache.shiro.subject.Subject;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 | import org.springframework.web.bind.annotation.PostMapping;
9 | import org.springframework.web.bind.annotation.RestController;
10 |
11 | /**
12 | * @Author 江南一点雨
13 | * @Site www.javaboy.org 2019-06-05 11:24
14 | */
15 | @RestController
16 | public class LoginController {
17 |
18 | @PostMapping("/doLogin")
19 | public void doLogin(String username, String password) {
20 | Subject subject = SecurityUtils.getSubject();
21 | try {
22 | subject.login(new UsernamePasswordToken(username, password));
23 | System.out.println("登录成功!");
24 | } catch (AuthenticationException e) {
25 | e.printStackTrace();
26 | System.out.println("登录失败!");
27 | }
28 | }
29 |
30 | @GetMapping("/hello")
31 | public String hello() {
32 | return "hello";
33 | }
34 |
35 | @GetMapping("/login")
36 | public String login() {
37 | return "please login!";
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/java/com/gaohanghang/springbootmanagebooks/service/BookService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootmanagebooks.service;
2 |
3 | import com.gaohanghang.springbootmanagebooks.entity.*;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @date 2019/03/04 13:17
11 | */
12 | public interface BookService {
13 | /*
14 | user
15 | */
16 | List getList();
17 |
18 | //
19 | List getListByQuery(String query);
20 |
21 | // 获取借阅的图书
22 | List getListById(int userId);
23 |
24 | // 通过bookId删除图书
25 | int deleteById(int bookId);
26 |
27 | // 预约图书
28 | void processRes(String ISBN, User user);
29 |
30 | // 获取预定详情
31 | List getResById(User user);
32 |
33 | // 归还图书
34 | void returnBookById(int borrowId);
35 |
36 | /*admin*/
37 | void addBookList(BookList bookList, int state);
38 |
39 | //
40 | void insertBorrow(int reservationId,int operator);
41 |
42 | // 获取预约
43 | List getResInfo();
44 |
45 | //
46 | List getResList();
47 |
48 | // 借阅详情
49 | List getBorInfo(User user);
50 |
51 | //
52 | List getBorList();
53 |
54 | // 删除booklist
55 | int deleteBookList(BookList bookList);
56 | }
57 |
--------------------------------------------------------------------------------
/springboot_logstash/src/main/resources/logback-spring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 127.0.0.1:4560
7 |
8 |
10 |
11 |
12 | UTC
13 |
14 |
15 |
16 | {
17 | "logLevel": "%level",
18 | "serviceName": "${springAppName:-}",
19 | "pid": "${PID:-}",
20 | "thread": "%thread",
21 | "class": "%logger{40}",
22 | "rest": "%message"
23 | }
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/kafka-example-imooc/src/main/java/com/imooc/kafka/producer/SimpleProducer.java:
--------------------------------------------------------------------------------
1 | package com.imooc.kafka.producer;
2 |
3 | import com.imooc.kafka.common.MessageEntity;
4 | import org.apache.kafka.clients.producer.ProducerRecord;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.beans.factory.annotation.Qualifier;
7 | import org.springframework.kafka.core.KafkaTemplate;
8 | import org.springframework.kafka.support.SendResult;
9 | import org.springframework.stereotype.Component;
10 | import org.springframework.util.concurrent.ListenableFuture;
11 |
12 | @Component
13 | public class SimpleProducer {
14 |
15 | @Autowired
16 | @Qualifier("kafkaTemplate")
17 | private KafkaTemplate kafkaTemplate;
18 |
19 | public void send(String topic, MessageEntity message) {
20 | kafkaTemplate.send(topic, message);
21 | }
22 |
23 | public void send(String topic, String key, MessageEntity entity) {
24 | ProducerRecord record = new ProducerRecord<>(
25 | topic,
26 | key,
27 | entity);
28 |
29 | long startTime = System.currentTimeMillis();
30 |
31 | ListenableFuture> future = kafkaTemplate.send(record);
32 | future.addCallback(new ProducerCallback(startTime, key, entity));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/jms-spring/src/main/resources/common.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/service/IMailService.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.service;
2 |
3 | import com.gaohanghang.mail.common.model.Email;
4 | import com.gaohanghang.mail.common.model.Result;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/29 11:46
10 | */
11 | public interface IMailService {
12 | /**
13 | * 纯文本
14 | * @param email
15 | * @throws Exception
16 | */
17 | public void send(Email email) throws Exception;
18 |
19 | /**
20 | * 富文本
21 | * @param mail
22 | * @throws Exception
23 | */
24 | public void sendHtml(Email mail) throws Exception;
25 |
26 | /**
27 | * 模版发送 freemarker
28 | * @param mail
29 | * @throws Exception
30 | */
31 | public void sendFreemarker(Email mail) throws Exception;
32 |
33 | /**
34 | * 模版发送 thymeleaf(弃用、需要配合模板)
35 | * @param mail
36 | * @throws Exception
37 | */
38 | public void sendThymeleaf(Email mail) throws Exception;
39 |
40 | /**
41 | * 队列
42 | * @param mail
43 | * @throws Exception
44 | */
45 | public void sendQueue(Email mail) throws Exception;
46 |
47 | /**
48 | * Redis 队列
49 | * @param mail
50 | * @throws Exception
51 | */
52 | public void sendRedisQueue(Email mail) throws Exception;
53 |
54 | public Result listMail(Email mail);
55 | }
56 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/src/main/java/com/imooc/miaosha/result/Result.java:
--------------------------------------------------------------------------------
1 | package com.imooc.miaosha.result;
2 |
3 | public class Result {
4 |
5 | private int code;
6 | private String msg;
7 | private T data;
8 |
9 | public Result(T data) {
10 | this.data = data;
11 | }
12 |
13 | private Result(int code, String msg) {
14 | this.code = code;
15 | this.msg = msg;
16 | }
17 |
18 | private Result(CodeMsg codeMsg) {
19 | if(codeMsg != null) {
20 | this.code = codeMsg.getCode();
21 | this.msg = codeMsg.getMsg();
22 | }
23 | }
24 |
25 |
26 | /**
27 | * 成功时候的调用
28 | * */
29 | public static Result success(T data) {
30 | return new Result(data);
31 | }
32 |
33 | /**
34 | * 失败时候的调用
35 | * */
36 | public static Result error(CodeMsg codeMsg) {
37 | return new Result(codeMsg);
38 | }
39 |
40 |
41 | public int getCode() {
42 | return code;
43 | }
44 | public void setCode(int code) {
45 | this.code = code;
46 | }
47 | public String getMsg() {
48 | return msg;
49 | }
50 | public void setMsg(String msg) {
51 | this.msg = msg;
52 | }
53 | public T getData() {
54 | return data;
55 | }
56 | public void setData(T data) {
57 | this.data = data;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/socket-study/src/Server.java:
--------------------------------------------------------------------------------
1 | import java.io.*;
2 | import java.net.InetAddress;
3 | import java.net.ServerSocket;
4 | import java.net.Socket;
5 |
6 | /**
7 | * 基于TCP协议的Socket通信,实现用户登录
8 | * 服务器端
9 | * @Description:
10 | * @author: Gao Hang Hang
11 | * @date 2019/02/09 00:01
12 | */
13 | public class Server {
14 | public static void main(String[] args) {
15 | try {
16 | // 1.创建一个服务器端Socket,即ServerSocket,指定绑定的端口,并监听此端口
17 | ServerSocket serverSocket = new ServerSocket(8888);
18 | // 2.调用accept()方法开始监听,等待客户端的连接
19 | Socket socket = null;
20 | // 记录客户端的数量
21 | int count = 0;
22 | System.out.println("***服务器即将启动,等待客户端的连接***");
23 | // 循环监听等待客户端的连接
24 | while (true) {
25 | // 调用accept()方法开始监听,等地啊客户端的连接
26 | socket = serverSocket.accept();
27 | // 创建一个线程
28 | ServerThread serverThread = new ServerThread(socket);
29 | // 启动线程
30 | serverThread.start();
31 |
32 | count++;//统计客户端的数量
33 | System.out.println("客户端的数量:" + count);
34 | InetAddress address = socket.getInetAddress();
35 | System.out.println("当前客户端的IP:" + address.getHostAddress());
36 | }
37 | } catch (IOException e) {
38 | e.printStackTrace();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/api/SwaggerConfig.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.api;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import springfox.documentation.builders.ApiInfoBuilder;
5 | import springfox.documentation.builders.PathSelectors;
6 | import springfox.documentation.builders.RequestHandlerSelectors;
7 | import springfox.documentation.service.ApiInfo;
8 | import springfox.documentation.service.Contact;
9 | import springfox.documentation.spi.DocumentationType;
10 | import springfox.documentation.spring.web.plugins.Docket;
11 | import springfox.documentation.swagger2.annotations.EnableSwagger2;
12 |
13 | /**
14 | * @Description:
15 | * @author: Gao Hang Hang
16 | * @date 2019/01/26 21:46
17 | */
18 | @Configuration
19 | @EnableSwagger2
20 | public class SwaggerConfig {
21 | public Docket mailApi() {
22 | return new Docket(DocumentationType.SWAGGER_2).groupName("邮件管理").apiInfo(apiInfo()).select()
23 | .apis(RequestHandlerSelectors.basePackage("com.gaohanghang.mail.web")).paths(PathSelectors.any()).build();
24 | }
25 |
26 | // 预览地址:swagger-ui.html
27 | private ApiInfo apiInfo() {
28 | return new ApiInfoBuilder().title("Spring 中使用Swagger2构建文档").termsOfServiceUrl("http://ghang.top")
29 | .contact(new Contact("高行行", "http://ghang.top", "1341947277@qq.com")).version("1.2").build();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/model/Result.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.model;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/01/26 22:14
10 | */
11 | public class Result extends HashMap {
12 |
13 | private static final long serialVersionUID = 1L;
14 |
15 | public Result() {
16 | put("code", 0);
17 | }
18 |
19 | public static Result error() {
20 | return error(500, "未知异常,请联系管理员");
21 | }
22 |
23 | public static Result error(String msg) {
24 | return error(500, msg);
25 | }
26 |
27 | public static Result error(int code, String msg) {
28 | Result r = new Result();
29 | r.put("code", code);
30 | r.put("msg", msg);
31 | return r;
32 | }
33 |
34 | public static Result ok(Object msg) {
35 | Result r = new Result();
36 | r.put("msg", msg);
37 | return r;
38 | }
39 |
40 | public static Result ok(Map map) {
41 | Result r = new Result();
42 | r.putAll(map);
43 | return r;
44 | }
45 |
46 | public static Result ok() {
47 | return new Result();
48 | }
49 |
50 | @Override
51 | public Object put(String key, Object value) {
52 | super.put(key, value);
53 | return this;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/spring-boot-manage-books/src/main/resources/templates/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 图书管理系统
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spring-boot-miaosha/src/main/java/com/imooc/miaosha/controller/SampleController.java:
--------------------------------------------------------------------------------
1 | package com.imooc.miaosha.controller;
2 |
3 | import com.imooc.miaosha.domain.User;
4 | import com.imooc.miaosha.result.Result;
5 | import com.imooc.miaosha.service.UserService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Controller;
8 | import org.springframework.ui.Model;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.ResponseBody;
11 |
12 | @Controller
13 | @RequestMapping("/demo")
14 | public class SampleController {
15 |
16 | @Autowired
17 | UserService userService;
18 |
19 | @RequestMapping("/hello")
20 | @ResponseBody
21 | public Result home() {
22 | return Result.success("Hello , world");
23 | }
24 |
25 | @RequestMapping("/thymeleaf")
26 | public String thymeleaf(Model model) {
27 | model.addAttribute("name", "Joshua");
28 | return "hello";
29 | }
30 |
31 | @RequestMapping("/db/get")
32 | @ResponseBody
33 | public Result dbGet() {
34 | User user = userService.getById(1);
35 | return Result.success(user);
36 | }
37 |
38 | @RequestMapping("/db/tx")
39 | @ResponseBody
40 | public Result dbTx() {
41 | userService.tx();
42 | return Result.success(true);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/project-common/src/main/java/entity/Result.java:
--------------------------------------------------------------------------------
1 | package entity;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/09 19:32
7 | */
8 | public class Result {
9 | private boolean flag;
10 | private Integer code;
11 | private String message;
12 | private Object data;
13 |
14 | public Result() {
15 | }
16 |
17 | public Result(boolean flag, Integer code, String message) {
18 | this.flag = flag;
19 | this.code = code;
20 | this.message = message;
21 | }
22 |
23 | public Result(boolean flag, Integer code, String message, Object data) {
24 | this.flag = flag;
25 | this.code = code;
26 | this.message = message;
27 | this.data = data;
28 | }
29 |
30 | public boolean isFlag() {
31 | return flag;
32 | }
33 |
34 | public void setFlag(boolean flag) {
35 | this.flag = flag;
36 | }
37 |
38 | public Integer getCode() {
39 | return code;
40 | }
41 |
42 | public void setCode(Integer code) {
43 | this.code = code;
44 | }
45 |
46 | public String getMessage() {
47 | return message;
48 | }
49 |
50 | public void setMessage(String message) {
51 | this.message = message;
52 | }
53 |
54 | public Object getData() {
55 | return data;
56 | }
57 |
58 | public void setData(Object data) {
59 | this.data = data;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/jsonexporter/model/GraphEdge.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package com.gaohanghang.springbootgephi.jsonexporter.model;
6 |
7 | public class GraphEdge extends GraphElement {
8 |
9 |
10 | private String label;
11 | private String from;
12 | private String to;
13 | private String id;
14 | private Color color;
15 |
16 | public GraphEdge(String id) {
17 | super();
18 | this.id = id;
19 | label = "";
20 | from = "";
21 | to = "";
22 | }
23 |
24 | public String getLabel() {
25 | return label;
26 | }
27 |
28 | public void setLabel(String label) {
29 | this.label = label;
30 | }
31 |
32 | public String getFrom() {
33 | return from;
34 | }
35 |
36 | public void setFrom(String from) {
37 | this.from = from;
38 | }
39 |
40 | public String getTo() {
41 | return to;
42 | }
43 |
44 | public void setTo(String to) {
45 | this.to = to;
46 | }
47 |
48 | public String getId() {
49 | return id;
50 | }
51 |
52 | public void setId(String id) {
53 | this.id = id;
54 | }
55 |
56 | public Color getColor() {
57 | return color;
58 | }
59 |
60 | public void setColor(Color color) {
61 | this.color = color;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/spring-boot-mail/src/main/java/com/gaohanghang/mail/common/queue/MailQueue.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.mail.common.queue;
2 |
3 | import com.gaohanghang.mail.common.model.Email;
4 |
5 | import java.util.concurrent.BlockingDeque;
6 | import java.util.concurrent.LinkedBlockingDeque;
7 |
8 | /**
9 | * @Description: 邮件队列
10 | * @author: Gao Hang Hang
11 | * @date 2019/01/29 01:05
12 | */
13 | public class MailQueue {
14 | // 队列项目
15 | static final int QUEUE_MAX_SIZE = 1000;
16 |
17 | static BlockingDeque blockingDeque = new LinkedBlockingDeque<>();
18 |
19 | /**
20 | * 私有的默认构造器,保证外界无法直接实例化
21 | */
22 | private MailQueue() {}
23 |
24 | // 单例队列
25 | public static MailQueue getMailQueue() {
26 | return SingletonHolder.queue;
27 | }
28 |
29 | // 生成入队
30 | public void produce(Email mail) throws InterruptedException {
31 | blockingDeque.put(mail);
32 | }
33 |
34 | // 消费出队
35 | public Email consume() throws InterruptedException {
36 | return blockingDeque.take();
37 | }
38 |
39 | // 获取队列大小
40 | public int size() {
41 | return blockingDeque.size();
42 | }
43 |
44 | /**
45 | * 类级的内部类,也就是静态的成员式内部类,该内部类的实例与外部类的实例
46 | * 没有绑定关系,而且只有被调用到才会装载,从而实现了延迟加载
47 | */
48 | private static class SingletonHolder{
49 | /**
50 | * 静态初始化器,由JVM来保证线程安全
51 | */
52 | private static MailQueue queue = new MailQueue();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/entity/Nodes.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.entity;
2 |
3 | import lombok.Data;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 | import lombok.ToString;
7 |
8 | import javax.persistence.Entity;
9 | import javax.persistence.GeneratedValue;
10 | import javax.persistence.Id;
11 | import javax.persistence.Table;
12 | import java.io.Serializable;
13 |
14 | @Entity
15 | @Data
16 | @Table(name="nodes")
17 | @Getter
18 | @Setter
19 | @ToString
20 | public class Nodes implements Serializable {
21 | private static final long serialVersionUID = 1L;
22 | @Id
23 | @GeneratedValue
24 | /**
25 | * id
26 | */
27 | private String id;
28 |
29 | /**
30 | * node_id
31 | */
32 | private Integer nodeId;
33 |
34 | /**
35 | * label
36 | */
37 | private String label;
38 |
39 | /**
40 | * size
41 | */
42 | private String size;
43 |
44 | /**
45 | * url
46 | */
47 | private String url;
48 |
49 | /**
50 | * x
51 | */
52 | private Float x;
53 |
54 | /**
55 | * y
56 | */
57 | private Float y;
58 |
59 | /**
60 | * group
61 | */
62 | private String group;
63 |
64 | /**
65 | * color
66 | */
67 | private String color;
68 |
69 | /**
70 | * attributes
71 | */
72 | private String attributes;
73 |
74 | public Nodes() {
75 | }
76 |
77 | }
--------------------------------------------------------------------------------
/spring-boot-easy-excel-demo/src/main/java/com/gaohanghang/easyexceldemo/entity/User.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.easyexceldemo.entity;
2 |
3 | import com.alibaba.excel.annotation.ExcelProperty;
4 | import com.alibaba.excel.metadata.BaseRowModel;
5 |
6 | import javax.persistence.Entity;
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 |
10 | /**
11 | * @Description:
12 | * @author: Gao Hang Hang
13 | * @date 2019/01/28 15:36
14 | */
15 | @Entity
16 | @Table(name = "user")
17 | public class User extends BaseRowModel {
18 |
19 | @Id
20 | @ExcelProperty(index = 0)
21 | private String id;
22 | @ExcelProperty(index = 1)
23 | private String name;
24 | @ExcelProperty(index = 2)
25 | private String age;
26 |
27 | public String getId() {
28 | return id;
29 | }
30 |
31 | public void setId(String id) {
32 | this.id = id;
33 | }
34 |
35 | public String getName() {
36 | return name;
37 | }
38 |
39 | public void setName(String name) {
40 | this.name = name;
41 | }
42 |
43 | public String getAge() {
44 | return age;
45 | }
46 |
47 | public void setAge(String age) {
48 | this.age = age;
49 | }
50 |
51 | @Override
52 | public String toString() {
53 | return "User{" +
54 | "id='" + id + '\'' +
55 | ", name='" + name + '\'' +
56 | ", age='" + age + '\'' +
57 | '}';
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/spring-boot-gephi/src/main/java/com/gaohanghang/springbootgephi/entity/Result.java:
--------------------------------------------------------------------------------
1 | package com.gaohanghang.springbootgephi.entity;
2 |
3 | /**
4 | * @Description:
5 | * @author: Gao Hang Hang
6 | * @date 2019/01/09 19:32
7 | */
8 | public class Result {
9 | private boolean flag;
10 | private Integer code;
11 | private String message;
12 | private Object data;
13 |
14 | public Result() {
15 | }
16 |
17 | public Result(boolean flag, Integer code, String message) {
18 | this.flag = flag;
19 | this.code = code;
20 | this.message = message;
21 | }
22 |
23 | public Result(boolean flag, Integer code, String message, Object data) {
24 | this.flag = flag;
25 | this.code = code;
26 | this.message = message;
27 | this.data = data;
28 | }
29 |
30 | public boolean isFlag() {
31 | return flag;
32 | }
33 |
34 | public void setFlag(boolean flag) {
35 | this.flag = flag;
36 | }
37 |
38 | public Integer getCode() {
39 | return code;
40 | }
41 |
42 | public void setCode(Integer code) {
43 | this.code = code;
44 | }
45 |
46 | public String getMessage() {
47 | return message;
48 | }
49 |
50 | public void setMessage(String message) {
51 | this.message = message;
52 | }
53 |
54 | public Object getData() {
55 | return data;
56 | }
57 |
58 | public void setData(Object data) {
59 | this.data = data;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/jms-test/src/main/java/com/imooc/queue/AppProducter.java:
--------------------------------------------------------------------------------
1 | package com.imooc.queue;
2 |
3 | import org.apache.activemq.ActiveMQConnectionFactory;
4 | import javax.jms.*;
5 |
6 | /**
7 | * @Description:
8 | * @author: Gao Hang Hang
9 | * @date 2019/02/09 19:43
10 | */
11 | public class AppProducter {
12 |
13 | private static final String url = "tcp://localhost:61616";
14 | private static final String queueName = "queue-test";
15 |
16 | public static void main(String[] args) throws JMSException {
17 |
18 | // 1.创建ConnectionFactory
19 | ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
20 |
21 | // 2.创建Connection
22 | Connection connection = connectionFactory.createConnection();
23 |
24 | // 3.启动连接
25 | connection.start();
26 |
27 | // 4.创建会话
28 | Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
29 |
30 | // 5.创建一个目标
31 | Destination destination = session.createQueue(queueName);
32 |
33 | // 6.创建一个生产者
34 | MessageProducer producer = session.createProducer(destination);
35 |
36 | for (int i = 0; i < 100; i++) {
37 | // 7.创建消息
38 | TextMessage textMessage = session.createTextMessage("test" + i);
39 | // 8.发布消息
40 | producer.send(textMessage);
41 |
42 | System.out.println("发送消息" + textMessage.getText());
43 | }
44 |
45 | // 9.关闭连接
46 | connection.close();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/jms-test/src/main/java/com/imooc/topic/AppProducter.java:
--------------------------------------------------------------------------------
1 | package com.imooc.topic;
2 |
3 | import org.apache.activemq.ActiveMQConnectionFactory;
4 |
5 | import javax.jms.*;
6 |
7 | /**
8 | * @Description:
9 | * @author: Gao Hang Hang
10 | * @date 2019/02/09 19:43
11 | */
12 | public class AppProducter {
13 |
14 | private static final String url = "tcp://localhost:61616";
15 | private static final String topicName = "topic-test";
16 |
17 | public static void main(String[] args) throws JMSException {
18 |
19 | // 1.创建ConnectionFactory
20 | ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
21 |
22 | // 2.创建Connection
23 | Connection connection = connectionFactory.createConnection();
24 |
25 | // 3.启动连接
26 | connection.start();
27 |
28 | // 4.创建会话
29 | Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
30 |
31 | // 5.创建一个目标
32 | Destination destination = session.createTopic(topicName);
33 |
34 | // 6.创建一个生产者
35 | MessageProducer producer = session.createProducer(destination);
36 |
37 | for (int i = 0; i < 100; i++) {
38 | // 7.创建消息
39 | TextMessage textMessage = session.createTextMessage("test" + i);
40 | // 8.发布消息
41 | producer.send(textMessage);
42 |
43 | System.out.println("发送消息" + textMessage.getText());
44 | }
45 |
46 | // 9.关闭连接
47 | connection.close();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/socket-study/src/UDPServer.java:
--------------------------------------------------------------------------------
1 | import java.io.IOException;
2 | import java.net.DatagramPacket;
3 | import java.net.DatagramSocket;
4 | import java.net.InetAddress;
5 | import java.net.SocketException;
6 |
7 | /**
8 | * @Description: 服务器端,实现基于UDP的用户登录
9 | * @author: Gao Hang Hang
10 | * @date 2019/02/09 00:51
11 | */
12 | public class UDPServer {
13 | public static void main(String[] args) throws IOException {
14 | /**
15 | * 接收客户端发送的数据
16 | */
17 | // 1.创建服务器端DatagramSocket,指定端口
18 | DatagramSocket socket = new DatagramSocket(8800);
19 | // 2.创建数据报,用于接收客户端发送的数据
20 | byte[] data = new byte[1024];//创建字节数组,指定接收的数据包的大小
21 | DatagramPacket packet = new DatagramPacket(data, data.length);
22 | // 3.接收客户端发送的数据
23 | System.out.println("***服务器端已经启动,等待客户端发送的数据***");
24 | socket.receive(packet);//此方法在接收到数据报之前会一直阻塞
25 | // 4.读取数据
26 | String info = new String(data, 0, packet.getLength());
27 | System.out.println("我是服务器,客户端说:" + info);
28 |
29 | /**
30 | * 向客户端响应数据
31 | */
32 | // 1.定义客户端的地址、端口号、数据
33 | InetAddress address = packet.getAddress();
34 | int port = packet.getPort();
35 | byte[] data2 = "欢迎您!".getBytes();
36 | // 2.创建数据报,包含响应的数据信息
37 | DatagramPacket packet2 = new DatagramPacket(data2, data2.length, address, port);
38 | // 3.响应客户端
39 | socket.send(packet2);
40 | // 4.关闭资源
41 | socket.close();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------