- Git 把代码拉下来
- JDK 编译
- Maven 构建项目
- MySQL 生产环境的数据库
- yum update: 更新源
- yum install git
- yum install maven 顺便把JDK也装了
- mvn -v 查看maven的版本
- mvn clean compile package
- cp src/main/resources/application.properties src/main/resources/application-production.properties
- mvn package
- java -jar -Dspring.profiles.active=production target/community-0.0.1-SNAPSHOT.jar 启动项目
- 访问项目,阿里云服务器需要配置80端口的安全组规则
- ps -aux | grep java 检查进程
- git pull 拉代码
Spring 文档
Spring web文档
es社区
bootstrap样式
GitHub OAuth 文档
菜鸟教程 MySQL
Spring boot mybatis
lombok---需要maven引用和idea的插件下载
spring-boot 热部署文档
Spring web MVC 文档 (拦截器)
thymeleaf 文档
mybatis
markdown编辑器
Markdown 插件
UFfile SDK
等待
Git
优秀的画图软件---VP
FlyWay
优秀的GitHub浏览插件---octotree
create table user
(
id bigint auto_increment,
account_id varchar(100),
name varchar(50),
token char(50),
gmt_create bigint,
gmt_modified bigint,
bio varchar(256),
avatar_url varchar(100),
constraint user_pk
primary key (id)
);
create table question
(
id bigint auto_increment
primary key,
title varchar(50),
description text,
gmt_create bigint,
gmt_modified bigint,
creator bigint,
comment_count integer default 0,
view_count integer default 0,
like_count integer default 0,
tag varchar(256)
);
create table notification
(
id bigint auto_increment,
notifier bigint not null,
receicer bigint not null,
outerid bigint not null,
type integer not null,
gmt_create bigint not null,
status integer default 0 not null,
notifier_name varchar(100),
outer_title varchar(256),
constraint notification_pk
primary key (id)
);
create table comment
(
id bigint auto_increment,
parent_id bigint not null,
type integer not null,
commentator bigint not null,
gmt_create bigint not null,
gmt_modified bigint not null,
like_count bigint default 0,
content varchar(1024) not null,
comment_count integer default 0 not null,
constraint comment_pk
primary key (id)
);
comment on column comment.parent_id is '父类id';
comment on column comment.type is '父类类型';
comment on column comment.gmt_create is '创建时间';
comment on column comment.gmt_modified is '更新时间';
comment on column comment.like_count is '点赞数';
select count(1) from QUESTION;
select * from QUESTION limit 0,5;
mvn -Dmybatis.generator.overwrite=true mybatis-generator:generate
- 在ide里直接执行main方法
- 打成jar包作为服务
- 用 maven 启动
- Spring大法好
- 会把对象自动实例化放在一个池子里,方便使用
- 根据配置文件去获得这个值
- Spring启动的时候会把配置文件里的值放在一个map里
- test
- 多了一句这个竟然就找不到h2的driver class了
- 服务端和ide不能同时连接h2数据库,记得关掉
- 删除 .idea 文件夹
- 重新 import 项目
- mapper是数据库模型的文件
- dto是数据传输时的模型
- service用来组装多个mapper的使用
- mybatis.configuration.map-underscore-to-camel-case=true
- shift-command-option-? 打开registry,compiler-automake-allow-when-app-running 打勾
- 这个注解代表全面接管SpringMVC,之前的默认配置都没了
- th:href="@{'question/'+${question.id}}"
- 空格也是算数的
- @Transactional
- 如果有异常或者错误,回滚前面的更新语句
- command+option+v 抽取变量
- command+option+p 抽取参数
- command+option+f 抽取方法
- 行云流水的mysql安装指南:https://blog.csdn.net/a774630093/article/details/79270080
- 添加的属性不能放在最后面,不然不管用。。
- 修改字符编码 https://www.jianshu.com/p/155c332340db
- 一定要先修改字符集再去创建表
- https://docs.lvrui.io/2016/08/21/%E4%BF%AE%E6%94%B9MySQL%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E4%B8%BAutf8mb4/
- 每次都查影响性能
- 作为一种异步的离线任务,api的形式
- 昨天的数据