Spring 文档
Spring Web
es
Github deploy key
Bootstrap
Github OAuth
thymeleaf帮助文档
MarkDown 插件
UCloud UFile SDK
Git flyway lombok mybatis generator
@GetMapping("/publish/{questionId}")
public String republish(@PathVariable(name="questionId") Integer id,
Model model);
@PostMapping("/publish")
public String dopublish(
@RequestParam(value = "title",required = false) String title,
@RequestParam(value = "description",required = false) String description,;
mybatis generator的使用;
//Example具有限定功能,当没有限定时,传入一个无参构造Example(必传)
//使用创建的sql语句,语句中使id等于,有where xxx=xxx的语句就用这个
UserExample example=new UserExample();
userExample.createCriteria().andIdEqualTo(dbUser.getId());
//更新局部数据,直接是有where之前的update语句;
User updateUser = new User();
updateUser.setGmtModify(System.currentTimeMillis());
updateUser.setAvatarUrl(user.getAvatarUrl());
updateUser.setName(user.getName());
updateUser.setToken(user.getToken());
userMapper.updateByExampleSelective(updateUser,example);
Create Table
CREATE TABLE `user` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`account_id` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`token` char(36) DEFAULT NULL,
`gmt_create` bigint(20) DEFAULT NULL,
`gmt_modify` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
)
Create Table
CREATE TABLE `questionid` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` text,
`title` varchar(50) DEFAULT NULL,
`gmt_create` bigint(20) DEFAULT NULL,
`gmt_modify` bigint(20) DEFAULT NULL,
`creator_id` int(11) DEFAULT NULL,
`comment_count` int(11) DEFAULT '0',
`view_count` int(11) DEFAULT '0',
`like_count` int(11) DEFAULT '0',
`tag` varchar(256) DEFAULT NULL,
PRIMARY KEY (`id`)
)
terminal中使用
mvn flyway:migrate
mvn -Dmybatis.generator.overwrite=true mybatis-generator:generate