This repo is a spring-cloud-demo, can be used for a server backend
This project is a demo project for spring cloud microservice structure, using spring-boot, including:
This project has a login page. After login, you can see the first page of momentList, add new moments to the list, see the comments of each moment, and add new comments to the comment list.
create database test;
CREATE TABLE `account` (
`user_id` varchar(127) NOT NULL DEFAULT '',
`user_name` varchar(127) NOT NULL DEFAULT '',
`password` varchar(127) NOT NULL DEFAULT '',
`gmt_created` datetime NOT NULL,
`gmt_modified` datetime DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`),
KEY `index_user_id` (`user_id`) KEY_BLOCK_SIZE=10
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `moment` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar(127) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` text COLLATE utf8mb4_unicode_ci,
`gmt_created` datetime NOT NULL,
`gmt_modified` datetime DEFAULT NULL,
`is_deleted` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
create database test2;
CREATE TABLE `comment` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`moment_id` bigint(20) unsigned NOT NULL,
`content` text COLLATE utf8mb4_unicode_ci,
`gmt_created` datetime NOT NULL,
`gmt_modified` datetime DEFAULT NULL,
`is_deleted` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_moment_id` (`moment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
cd spring-cloud-parent
mvn clean install -DskipTests
cd ../spring-cloud-client
mvn clean install -DskipTests
cd ../spring-cloud-starter
mvn clean install -DskipTests
cd spring-cloud-eureka
mvn clean spring-boot:run
cd spring-cloud-account
mvn clean spring-boot:run
cd spring-cloud-biz
mvn clean spring-boot:run
cd spring-cloud-gateway
mvn clean spring-boot:run
http://127.0.0.1:7001/index
in browercurl -H 'Accept:application/json' -X POST localhost:7004/shutdown
, to stop the heartbeat to the eureka cluster.中文介绍: http://www.jianshu.com/p/c14c47243994
Any questions, please send to [email protected]
HomePage: http://www.jianshu.com/u/c031bded621b
wx: hurry_words