SpringBoot开发一个小而美的个人博客视频地址
可以学到的:
1)后端:springboot相关知识(各种注解、实体类生成表、条件查询、框架轮廓等)、idea使用及查找bug
2)前端:webstorm使用、semantic(手机端自适应)、css、thymeleaf、html、审美
3)编码规范
SpringBoot开发一个小而美的个人博客
视频中用到的网站
semantic、平滑滚动、文章二维码生成、目录生成、代码高亮
网页排版、markdown转html、占位图片、CDN加速 、CDN加速
背景图片、markdown编辑器
还发现了个调色网站,还没想到用处,不过感觉很好看:栗紫
问题
- 1 Required String parameter ‘username’ is not present
看看需要写username的地方,是否写的username。比如我,是login表单处写错了 - 2 WebMvcConfigurerAdapter 方法过时
- 3 Cannot resolve table ‘t_daily’
- 4 Server returns invalid timezone.
- 5 idea之springboot端口被占用/跳转到login
- 6 Inferred type ‘S’ for type parameter ‘S’ is not within its bound;
- 7 'Sort…has private access in … PageRequest… has protected access in …
- 8 group by和order by在springboot中连用
- 9 springboot国际化
- 10 题目过长,截取:
<td th:text="${#strings.abbreviate(daily.title,22)}"> 去哪里旅游?</td>
- 11 从零开始带你部署springboot项目到服务器
注解
- @Service:标注业务层组件
- @Controller:标注控制层组件
- @Autowired:自动装配
- @ResponseStatus(HttpStatus.NOT_FOUND) :把此Exception作为资源找不到的状态
- @RequestMapping():映射请求
- @Configuration:配置类
- @Transactional:事务,保持数据的一致性
- @Entity(name=“t_type”):表明该类为实体类,且对应表为t_type
- @Valid Type type:校验type对象
- @PostMapping("/types") :post和get同名不会冲突
- 表示id为主键,策略为自增长
@Id
@GeneratedValue
private Long id;
- @PathVariable接收路径中 id
@GetMapping("types/{id}/input")
public String editInput(@PathVariable Long id)
- @Transient
@Transient //正常属性值 不和数据库映射
private String tagIds;
- @Lob
@Basic(fetch = FetchType.LAZY) //使用的时候才会加载
@Lob //long text类型
private String content;
- @Query
@Query("select t from t_type t") //自定义查询,根据分页获取第一页数据
List<Type> findTop(Pageable pageable);
项目github及成品地址
github
我代码周围写了好多注释,大家如果看视频做项目的过程中,遇到哪些不理解,可以参考一下。也欢迎和我交流。
游记地址
后记
3/27 23:30 更新,没有看小说的日子里自律到了极致,我这算不算给自己玩了一把 9 12 7 啧啧
3/30 01:20 数据库查询还是不对,早上起来再说
终于写完了,开心
3/30 14:21 每次刚写完一个项目,就感觉自己的项目好厉害,用了xxx技术、框架,用了xx数据结构,引用了xx开源插件。但一段时间后,别人问你写过什么厉害的项目,左思右想,没有吧,全部浓缩为一句话:增删改查。
4/01 15:39 大二买了服务器就开始偶尔折腾,今天终于部署成功了,开心。