博客编写功能设计(个人博客)

一、编写dao层
二、绑定mapper配置文件
三、编写service层
四、编写controller层
@RequestMapping("/admin/toWrite")
public String toWrite(Model model){
List<Category> categories = categoryService.allCategories();
model.addAttribute("types",categories);
model.addAttribute("article", new Article());
return "admin/blogs-input";
}
五、绑定前端页面
主要是插入markdown编辑器,详情见开始页面其他栏目
注意下拉框值的传递用法
<div class="ui left labeled action input">
<label class="ui teal basic compact label">分类</label>
<div class="ui fluid selection dropdown">
<input type="hidden" name="categoryId" th:value="*{categoryId}">
<i class="dropdown icon"></i>
<div class="default text">分类</div>
<div class="menu">
<div th:each="type : ${types}" class="item" th:data-value="${type.statusId}" th:text="${type.name}">我的故事</div>
</div>
</div>
</div>
本文详细介绍了个人博客系统的编写流程,包括DAO层、Service层、Controller层的设计与实现,并展示了如何通过前端页面集成Markdown编辑器,特别关注了分类选择功能的实现细节。
3774

被折叠的 条评论
为什么被折叠?



