From 369ebcb26c29b917ead5e360df4a36c8775b6eca Mon Sep 17 00:00:00 2001 From: ZSY <2127145278@qq.com> Date: Sat, 7 Dec 2024 13:51:13 +0800 Subject: [PATCH 01/12] 1 --- src/java/service/CategoryService.java | 76 +++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/java/service/CategoryService.java diff --git a/src/java/service/CategoryService.java b/src/java/service/CategoryService.java new file mode 100644 index 0000000..faaa1dd --- /dev/null +++ b/src/java/service/CategoryService.java @@ -0,0 +1,76 @@ +package com.liuyanzhao.ssm.blog.service; + + +import com.liuyanzhao.ssm.blog.entity.Category; + + +import java.util.List; + +/** + * @author 言曌 + * @date 2017/8/24 + */ +public interface CategoryService { + /** + * 获得分类总数 + * + * @return + */ + Integer countCategory(); + + + /** + * 获得分类列表 + * + * @return 分类列表 + */ + List listCategory(); + + /** + * 获得分类列表 + * + * @return 分类列表 + */ + List listCategoryWithCount(); + + /** + * 删除分类 + * + * @param id ID + */ + + void deleteCategory(Integer id); + + /** + * 根据id查询分类信息 + * + * @param id ID + * @return 分类 + */ + Category getCategoryById(Integer id); + + /** + * 添加分类 + * + * @param category 分类 + * @return 分类 + */ + Category insertCategory(Category category); + + /** + * 更新分类 + * + * @param category 分类 + */ + void updateCategory(Category category); + + /** + * 根据分类名获取分类 + * + * @param name 名称 + * @return 分类 + */ + Category getCategoryByName(String name); + + +} From bac6e2d3d020856f96c30c37abdd4b0ffd9b00bb Mon Sep 17 00:00:00 2001 From: ZSY <2127145278@qq.com> Date: Sat, 7 Dec 2024 13:54:15 +0800 Subject: [PATCH 02/12] 1 --- src/java/service/CommentService.java | 105 +++++++++++++++++++++++++++ src/java/service/LinkService.java | 60 +++++++++++++++ src/java/service/MenuService.java | 46 ++++++++++++ src/java/service/NoticeService.java | 50 +++++++++++++ src/java/service/OptionsService.java | 32 ++++++++ src/java/service/PageService.java | 58 +++++++++++++++ src/java/service/TagService.java | 82 +++++++++++++++++++++ src/java/service/UserService.java | 73 +++++++++++++++++++ 8 files changed, 506 insertions(+) create mode 100644 src/java/service/CommentService.java create mode 100644 src/java/service/LinkService.java create mode 100644 src/java/service/MenuService.java create mode 100644 src/java/service/NoticeService.java create mode 100644 src/java/service/OptionsService.java create mode 100644 src/java/service/PageService.java create mode 100644 src/java/service/TagService.java create mode 100644 src/java/service/UserService.java diff --git a/src/java/service/CommentService.java b/src/java/service/CommentService.java new file mode 100644 index 0000000..17613a8 --- /dev/null +++ b/src/java/service/CommentService.java @@ -0,0 +1,105 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.github.pagehelper.PageInfo; +import com.liuyanzhao.ssm.blog.entity.Comment; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; + + +/** + * @author 言曌 + * @date 2017/9/10 + */ +@Service +public interface CommentService { + + /** + * 添加评论 + * + * @param comment 评论 + */ + void insertComment(Comment comment); + + /** + * 根据文章id获取评论列表 + * + * @param articleId 文章ID + * @return 列表 + */ + List listCommentByArticleId(Integer articleId); + + /** + * 根据id获取评论 + * + * @param id + * @return + */ + Comment getCommentById(Integer id); + + + /** + * 获取所有评论列表 + * + * @param pageIndex 第几页开始 + * @param pageSize 一页显示数量 + * @return 列表 + */ + PageInfo listCommentByPage( + Integer pageIndex, + Integer pageSize, + HashMap criteria); + + /** + * 获得某个用户收到的评论 + * + * @param pageIndex 第几页开始 + * @param pageSize 一页显示数量 + * @return 列表 + */ + PageInfo listReceiveCommentByPage( + Integer pageIndex, + Integer pageSize, + Integer userId); + + + /** + * 删除评论 + * + * @param id ID + */ + void deleteComment(Integer id); + + /** + * 修改评论 + * + * @param comment 评论 + */ + void updateComment(Comment comment); + + /** + * 统计评论数 + * + * @return 数量 + */ + Integer countComment(); + + /** + * 获得最近评论 + * + * @param limit 查询数量 + * @return 列表 + */ + List listRecentComment(Integer userId, Integer limit); + + /** + * 获得评论的子评论 + * + * @param id 评论ID + * @return 列表 + */ + List listChildComment(Integer id); + + +} diff --git a/src/java/service/LinkService.java b/src/java/service/LinkService.java new file mode 100644 index 0000000..113b944 --- /dev/null +++ b/src/java/service/LinkService.java @@ -0,0 +1,60 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.Link; + +import java.util.List; + +/** + * + * @author 言曌 + * @date 2017/9/4 + */ +public interface LinkService { + + /** + * 获得链接总数 + * + * @param status 状态 + * @return 数量 + */ + Integer countLink(Integer status); + + /** + * 获得链接列表 + * + * @param status 状态 + * @return 链接列表 + */ + List listLink(Integer status); + + /** + * 添加链接 + * + * @param link 链接 + */ + void insertLink(Link link); + + /** + * 删除链接 + * + * @param id 链接ID + */ + void deleteLink(Integer id); + + /** + * 更新链接 + * + * @param link 链接 + */ + void updateLink(Link link); + + /** + * 根据id查询链接 + * + * @param id 链接ID + * @return 链接 + */ + Link getLinkById(Integer id); + + +} diff --git a/src/java/service/MenuService.java b/src/java/service/MenuService.java new file mode 100644 index 0000000..1355fd7 --- /dev/null +++ b/src/java/service/MenuService.java @@ -0,0 +1,46 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.Menu; + +import java.util.List; + + /** + * @author liuyanzhao + */ + public interface MenuService { + /** + * 获得菜单列表 + * + * @return 列表 + */ + List listMenu() ; + + /** + * 添加菜单项目 + * + * @param menu 菜单 + */ + Menu insertMenu(Menu menu) ; + + /** + * 删除菜单项目 + * + * @param id 菜单ID + */ + void deleteMenu(Integer id) ; + + /** + * 更新菜单项目 + * + * @param menu 菜单 + */ + void updateMenu(Menu menu) ; + + /** + * 根据id获得菜单项目信息 + * + * @param id 菜单ID + * @return 菜单 + */ + Menu getMenuById(Integer id) ; +} diff --git a/src/java/service/NoticeService.java b/src/java/service/NoticeService.java new file mode 100644 index 0000000..d7c767d --- /dev/null +++ b/src/java/service/NoticeService.java @@ -0,0 +1,50 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.Notice; + +import java.util.List; + +/** + * @author liuyanzhao + */ +public interface NoticeService { + + + /** + * 获得公告列表 + * + * @param status 状态 + * @return 列表 + */ + List listNotice(Integer status); + + /** + * 添加公告 + * + * @param notice 公告 + */ + void insertNotice(Notice notice); + + /** + * 删除公告 + * + * @param id + */ + void deleteNotice(Integer id); + + /** + * 更新公告 + * + * @param notice + */ + void updateNotice(Notice notice); + + /** + * 根据id查询公告 + * + * @param id ID + * @return 公告 + */ + Notice getNoticeById(Integer id); + +} diff --git a/src/java/service/OptionsService.java b/src/java/service/OptionsService.java new file mode 100644 index 0000000..ac9ec5b --- /dev/null +++ b/src/java/service/OptionsService.java @@ -0,0 +1,32 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.Options; + + +/** + * + * @author 言曌 + * @date 2017/9/7 + */ +public interface OptionsService { + /** + * 获得基本信息 + * + * @return 系统设置 + */ + Options getOptions(); + + /** + * 新建基本信息 + * + * @param options 系统设置 + */ + void insertOptions(Options options); + + /** + * 更新基本信息 + * + * @param options 系统设置 + */ + void updateOptions(Options options); +} diff --git a/src/java/service/PageService.java b/src/java/service/PageService.java new file mode 100644 index 0000000..da84508 --- /dev/null +++ b/src/java/service/PageService.java @@ -0,0 +1,58 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.Page; + +import java.util.List; + +/** + * + * @author 言曌 + * @date 2017/9/7 + */ +public interface PageService { + /** + * 获得页面列表 + * + * @param status 状态 + * @return 列表 + */ + List listPage(Integer status); + + /** + * 根据页面key获得页面 + * + * @param status 状态 + * @param key 别名 + * @return 页面 + */ + Page getPageByKey(Integer status, String key); + + /** + * 根据id获取页面 + * + * @param id 页面ID + * @return 页面 + */ + Page getPageById(Integer id); + + /** + * 添加页面 + * + * @param page 页面 + */ + void insertPage(Page page); + + /** + * 删除页面 + * + * @param id 页面ID + */ + void deletePage(Integer id); + + /** + * 编辑页面 + * + * @param page 分页 + */ + void updatePage(Page page); +} diff --git a/src/java/service/TagService.java b/src/java/service/TagService.java new file mode 100644 index 0000000..4bf6e51 --- /dev/null +++ b/src/java/service/TagService.java @@ -0,0 +1,82 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.Tag; + + +import java.util.List; + +/** + * + * @author 言曌 + * @date 2017/9/2 + */ +public interface TagService { + + /** + * 获得标签总数 + * + * @return 数量 + */ + Integer countTag() ; + + /** + * 获得标签列表 + * + * @return 标签列表 + */ + List listTag() ; + + /** + * 获得标签列表 + * + * @return 标签列表 + */ + List listTagWithCount() ; + + /** + * 根据id获得标签信息 + * + * @param id 标签ID + * @return 标签 + */ + Tag getTagById(Integer id) ; + + /** + * 添加标签 + * + * @param tag 标签 + * @return 标签 + */ + Tag insertTag(Tag tag) ; + + /** + * 修改标签 + * + * @param tag 标签 + */ + void updateTag(Tag tag) ; + + /** + * 删除标签 + * + * @param id 标签iD + */ + void deleteTag(Integer id) ; + + /** + * 根据标签名获取标签 + * + * @param name 标签名称 + * @return 标签 + */ + Tag getTagByName(String name) ; + + /** + * 根据文章ID获得标签 + * + * @param articleId 文章ID + * @return 标签列表 + */ + List listTagByArticleId(Integer articleId); + +} diff --git a/src/java/service/UserService.java b/src/java/service/UserService.java new file mode 100644 index 0000000..e0a60a1 --- /dev/null +++ b/src/java/service/UserService.java @@ -0,0 +1,73 @@ +package com.liuyanzhao.ssm.blog.service; + +import com.liuyanzhao.ssm.blog.entity.User; + +import java.util.List; + +/** + * @author 言曌 + * @date 2017/8/24 + */ + +public interface UserService { + /** + * 获得用户列表 + * + * @return 用户列表 + */ + List listUser(); + + /** + * 根据id查询用户信息 + * + * @param id 用户ID + * @return 用户 + */ + User getUserById(Integer id); + + /** + * 修改用户信息 + * + * @param user 用户 + */ + void updateUser(User user); + + /** + * 删除用户 + * + * @param id 用户ID + */ + void deleteUser(Integer id); + + /** + * 添加用户 + * + * @param user 用户 + * @return 用户 + */ + User insertUser(User user); + + /** + * 根据用户名和邮箱查询用户 + * + * @param str 用户名或Email + * @return 用户 + */ + User getUserByNameOrEmail(String str); + + /** + * 根据用户名查询用户 + * + * @param name 用户名 + * @return 用户 + */ + User getUserByName(String name); + + /** + * 根据邮箱查询用户 + * + * @param email Email + * @return 用户 + */ + User getUserByEmail(String email); +} From 5274a76256c25ea804a168d031be5ad52f6bfaaf Mon Sep 17 00:00:00 2001 From: ZSY <2127145278@qq.com> Date: Sat, 7 Dec 2024 14:53:43 +0800 Subject: [PATCH 03/12] 1 --- .idea/workspace.xml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c9c9203..644030f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,10 +4,7 @@