Coder Social home page Coder Social logo

ausehk / springboot-learning-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeffli1993/springboot-learning-example

1.0 1.0 0.0 197 KB

spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。

License: Apache License 2.0

Java 92.69% CSS 0.08% HTML 7.00% FreeMarker 0.23%

springboot-learning-example's Introduction

springboot-learning-example

spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。

推荐 springcloud-learning-example

spring cloud 实践学习案例
https://github.com/JeffLi1993/springcloud-learning-example

Spring For All 社区

Spring For All 社区是新组建的关于 Spring 的纯技术交流社区(涵盖 Spring Boot、Spring Cloud 等内容),集诸多开源爱好者和技术大牛贡献内容和交流问题。我们不夸大、不装逼、做最纯粹的技术分享!!!

看看我们超强的群众基础,欢迎有兴趣的朋友加入QQ群分享与交流:

Spring For All 社区 ① 365234583(满)
Spring For All 社区 ② 123013854(满)
Spring For All 社区 ③ 290714704(满)
Spring For All 社区 ④ 112133511(满)
Spring For All 社区 ⑤ 157525002(满)
Spring For All 社区 ⑥ 564840207
Spring For All 社区 ⑦ 470962790(满)
Spring For All 社区 ⑧ 613456104(满)
Spring For All 社区 ⑨ 534583667
Spring For All 社区 ⑩ 210742970 (满)
Spring For All 社区 ⑪ 517395240
Spring For All 社区 ⑫ 498098401

博主微信:139-5868-6678

作者与学习乐园

源码地址:我的GitHub地址OSCGit地址
作者:泥瓦匠BYSocket
关注微信公众号【泥瓦匠BYSokcet】,及时得到技术文章推送
公众号

一、项目结构

「Spring Boot 那些事」:传送门

a. 『 基础 - 入门篇 』

b. 『 基础 - Web 业务开发篇 』

c. 『 基础 – 数据存储篇 』

d. 『 基础 – 数据缓存篇 』

e. 『 其他篇 』

『 Spring Data ES 篇 』

二、项目 Quick Start 快速开发指南

a. 基本环境配置

在 MySQL 中,创建数据库 springbootdb:

CREATE DATABASE springbootdb;

创建表 city 城市 (因为我喜欢徒步)

DROP TABLE IF EXISTS  `city`;
CREATE TABLE `city` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '城市编号',
  `province_id` int(10) unsigned  NOT NULL COMMENT '省份编号',
  `city_name` varchar(25) DEFAULT NULL COMMENT '城市名称',
  `description` varchar(25) DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

插入基础数据

INSERT city VALUES (1 ,1,'温岭市','BYSocket 的家在温岭。');

《 springboot-mybatis 工程 Quick Start 》

首先 check 基本环境配置完成,创建好数据库和表。

1. 修改数据库配置

配置文件地址:springboot-mybatis/src/main/resources/application.properties 修改相应的数据源配置,比如账号、密码等

2. 编译工程

在项目根目录 springboot-learning-example,运行 maven 指令:

mvn clean install

3. 运行工程

右键运行工程包中 org.spring.springboot.Application Spring Boot 应用启动类的 main 函数,然后在浏览器访问:

http://localhost:8080/api/city?cityName=温岭市

可以看到返回的 JSON 结果:

{
    "id": 1,
    "provinceId": 1,
    "cityName": "温岭市",
    "description": "我的家在温岭。"
}

最后,

推荐 《Spring Boot教程与Spring Cloud教程》

springboot-learning-example's People

Contributors

jeffli1993 avatar xchunzhao avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.