Skip to content

wang-qa/community

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring boot

练习参考资料

Spring Boot 文档 Spring Web Bootstrap 前端框架 Bootstrap 样式表 ES GitHub OAuth2 Okhttp Spring Mybaits Flyway Migration Project Lombok Thymeleaf Springboot文档手册

工具

代码版本管理GitHub 流程图Visual Paradigm 数据库版本脚本管理Flyway Migration 自动插入编辑器并构建工具Project Lombok

Git 使用

# Git 使用
git init # 初始化本地仓库
git add . # 添加当前目录文件
git state # 查看状态
git commit -m "备注" # 提交到本地仓库
git push origin master # 推送到名为origin的远程仓库的master分支
git pull origin master # 拉取名为origin的远程仓库的master分支
git commit --amend --no-edit # 提交 > 追加文件到上次本地提交 不需要改备注
git push -f origin master # 本地强制提交
git clone [Url] 复制项目

进度

参考手册地址 用户信息地址 http://api.github.com/users/用户昵称

  1. GitHub登录之调用 authorize
  2. GitHub登录之获取 用户信息code``token``UserName
  3. 配置文件application.properties新增配置参数 GitHub.client 信息
  4. 使用 MyBaits 链接数据库并插入数据
  5. 实现持久化登录 服务器下发 user_token 并在数据库查询
  6. 集成 Flyway Migration 统一数据库结构脚本(数据库版本控制)
  7. 添加 Lombok 支持 自动构建
  8. 完善首页问题列表展示
  9. 使用 developer tools 添加配置 spring.devtools.restart.exclude=static/**,public/** 完成自动部署(热更新)
  10. 添加分页功能
  11. 添加拦截器 WebConfig
  12. 完善问题详情页 & 修复登录持久化每次插入不更新用户信息 增加问题更新功能

排查问题先检查debug 信息中的 Caused by

*Flyway Migration*
创建第一次迁移
> 创建迁移目录 `src/main/resources/db/migration`(目标文件路径)
> 进行第一次迁移 `src/main/resources/db/migration/V1__Create_person_table.sql`(SQL语句)
> 执行Flyway迁移数据库 `mvn flyway:migrate`(执行语句)
  1. Octotree:快速以tree的方式展示github上的项目文件ctotree
  2. Table of contents sidebar:快速展示文章大纲Table of content sidebar
  3. OneTab:快速记录chrome打开页面,方便下次直接展开One Tab

数据库脚本

table For H2
-- ----------------------------
-- Table structure for User 
-- ----------------------------
create table USER
(
    ID           INT auto_increment,
    ACCOUNT_ID   VARCHAR,
    NAME         VARCHAR(100),
    TOKEN        CHAR(36),
    GMT_CREATE   BIGINT,
    GMT_MODIFIED BIGINT,
    BIO          VARCHAR(256),
    AVATAR_URL   VARCHAR(100),
    constraint TABLE_NAME_PK
        primary key (ID)
);

-- ----------------------------
-- Table structure for Question 
-- ----------------------------
create table question
(
	id int auto_increment,
	title varchar(50),
	description text,
	gmt_create bigint,
	gmt_modified bigint,
	creator int,
	comment_count int default 0,
	view_count int default 0,
	like_count int default 0,
	tag varchar(256),
	constraint question_pk
		primary key (id)
);

About

笔记练习

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published