月木学途开发 3.博客模块开发

news2024/11/18 21:49:58

概述

效果展示

 

 

 

数据库设计

专栏表

DROP TABLE IF EXISTS `blog_column`;
CREATE TABLE `blog_column` (
  `blogColumnId` int(11) NOT NULL AUTO_INCREMENT,
  `blogColumnName` varchar(255) DEFAULT NULL,
  `blogColumnCoverImg` longtext,
  `blogColumnIntroduction` longtext,
  `userId` int(11) DEFAULT NULL,
  PRIMARY KEY (`blogColumnId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

标签表

DROP TABLE IF EXISTS `blog_tag`;
CREATE TABLE `blog_tag` (
  `blogTagId` int(11) NOT NULL AUTO_INCREMENT,
  `blogTagName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`blogTagId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

博客类型表

DROP TABLE IF EXISTS `blog_type`;
CREATE TABLE `blog_type` (
  `blogTypeId` int(11) NOT NULL AUTO_INCREMENT,
  `blogTypeName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`blogTypeId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

评论表

DROP TABLE IF EXISTS `blog_comment`;
CREATE TABLE `blog_comment` (
  `blogCommentId` int(11) NOT NULL AUTO_INCREMENT,
  `blogCommentContent` varchar(255) DEFAULT NULL,
  `blogCommentTime` varchar(255) DEFAULT NULL,
  `userId` int(11) DEFAULT NULL,
  `blogId` int(11) DEFAULT NULL,
  PRIMARY KEY (`blogCommentId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

可见范围表

DROP TABLE IF EXISTS `blog_visibility`;
CREATE TABLE `blog_visibility` (
  `blogVisibilityId` int(11) NOT NULL AUTO_INCREMENT,
  `blogVisibilityName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`blogVisibilityId`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4;

博客表

DROP TABLE IF EXISTS `blog`;
CREATE TABLE `blog` (
  `blogId` int(11) NOT NULL AUTO_INCREMENT,
  `blogTitle` varchar(255) DEFAULT NULL,
  `blogCoverImg` longtext,
  `blogSummary` longtext,
  `blogContent` longtext,
  `blogCreateData` varchar(255) DEFAULT NULL,
  `blogShow` int(11) DEFAULT NULL,
  `blogRead` int(11) DEFAULT NULL,
  `blogLike` int(11) DEFAULT NULL,
  `blogFavorite` int(11) DEFAULT NULL,
  `userId` int(11) DEFAULT NULL,
  `blogTypeId` int(11) DEFAULT NULL,
  `blogVisibilityId` int(11) DEFAULT NULL,
  `blogStatus` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`blogId`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

博客专栏关联表

DROP TABLE IF EXISTS `blog_blog_column`;
CREATE TABLE `blog_blog_column` (
  `blogId` int(11) DEFAULT NULL,
  `blogColumnId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

博客标签关联表

DROP TABLE IF EXISTS `blog_blog_tag`;
CREATE TABLE `blog_blog_tag` (
  `blogId` int(11) DEFAULT NULL,
  `blogTagId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

实体类设计

Blog

/**
 * 博客文章实体类
 */
@Data
public class Blog implements Serializable {
    @TableId
    private Integer blogId;
    private String blogCoverImg;//封面
    private String blogTitle;//标题
    private String blogSummary;//摘要
    private String blogContent;//内容
    private String blogCreateData;//创作时间

    private String blogStatus;//状态【0:审核/1:发布】

    private Integer blogShow;//展现量
    private Integer blogRead;//阅读量
    private Integer blogLike;//点赞量
    private Integer blogFavorite;//收藏量

    private Integer userId;//作者
    @TableField(exist = false)
    private User user;

    private Integer blogTypeId;//类型
    @TableField(exist = false)
    private BlogType blogType;

    private Integer blogVisibilityId;//可见范围
    @TableField(exist = false)
    private BlogVisibility blogVisibility;

    @TableField(exist = false)
    private List<BlogTag> tags;//标签
    @TableField(exist = false)
    private List<BlogColumn> columns;//专栏

}

BlogColumn

/**
 * 专栏
 * 博客和专栏是多对多的关系
 * 用户和专栏是一对多的关系
 */
@Data
public class BlogColumn implements Serializable {
    @TableId
    private Integer blogColumnId;
    private String blogColumnName;//名称
    private String blogColumnCoverImg;//封面
    private String blogColumnIntroduction;//简介
    private Integer userId;//用户
}

BlogComment

/**
 * 评论
 */
@Data
public class BlogComment implements Serializable {
    @TableId
    private Integer blogCommentId;
    private String blogCommentTime;//评论时间
    private String blogCommentContent;//内容

    private Integer userId;//评论者
    private Integer blogId;//博客
}

BlogTag

/**
 * 标签
 * 博客和标签是多对多的关系
 */
@Data
public class BlogTag implements Serializable {
    @TableId
    private Integer blogTagId;
    private String blogTagName;//标签名
}

BlogType

/**
 * 类型
 */
@Data
public class BlogType implements Serializable {
    @TableId
    private Integer blogTypeId;
    private String blogTypeName;//类型名
}

BlogVisibility

/**
 * 可见范围
 */
@Data
public class BlogVisibility implements Serializable {
    @TableId
    private Integer blogVisibilityId;
    private String blogVisibilityName;//名称
}

Mapper层编写

BlogColumnMapper

public interface BlogColumnMapper extends BaseMapper<BlogColumn> {
    //根据标签id删除博客_专栏关联表的数据
    void deleteBlog_columnByBlogColumnId(Integer blogColumnId);
}

BlogColumnMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jkw.mapper.BlogColumnMapper">

    <delete id="deleteBlog_columnByBlogColumnId" parameterType="int">
        DELETE
        FROM blog_blog_column
        WHERE blogColumnId = #{blogColumnId}
    </delete>


</mapper>

BlogCommentMapper

public interface BlogCommentMapper extends BaseMapper<BlogComment> {
}

BlogMapper

public interface BlogMapper extends BaseMapper<Blog> {
    //添加博客_专栏中间表的数据
    void addBlog_column(@Param("blogId") Integer blogId, @Param("blogColumnId") Integer blogColumnId);

    //删除博客_专栏中间表的数据
    void deleteBlog_column(@Param("blogId") Integer blogId, @Param("blogColumnId") Integer blogColumnId);

    //根据博客id删除博客_专栏中间表的数据
    void deleteBlog_columnByBlogId(Integer blogId);

    //根据博客id查询博客_专栏中间表的专栏数据
    List<BlogColumn> findColumnByBlogId(Integer blogId);

    //添加博客_标签中间表的数据
    void addBlog_tag(@Param("blogId") Integer blogId, @Param("blogTagId") Integer blogTagId);

    //删除博客_标签中间表的数据
    void deleteBlog_tag(@Param("blogId") Integer blogId, @Param("blogTagId") Integer blogTagId);

    //根据博客id删除博客_标签中间表的数据
    void deleteBlog_tagByBlogId(Integer blogId);

    //根据博客id查询博客_标签中间表的标签数据
    List<BlogTag> findTagByBlogId(Integer blogId);

    //删除博客对应的所有评论
    void deleteAllComments(Integer blogId);

    //根据id查询博客内容【封装数据】
    Blog findById(Integer blogId);

    //条件分页分页查询博客内容【封装数据】
    Page<Blog> search(Page<Blog> page, @Param(Constants.WRAPPER) Wrapper<Blog> wrapper);

    //条件分页分页查询博客内容【封装数据并且为发布状态】
    Page<Blog> searchWhenStatus(Page<Blog> page, @Param(Constants.WRAPPER) Wrapper<Blog> wrapper);

}

BlogMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jkw.mapper.BlogMapper">
    <resultMap id="blogMapper" type="jkw.pojo.Blog">
        <id property="blogId" column="blogId"></id>
        <result property="blogTitle" column="blogTitle"></result>
        <result property="blogCoverImg" column="blogCoverImg"></result>
        <result property="blogSummary" column="blogSummary"></result>
        <result property="blogContent" column="blogContent"></result>
        <result property="blogCreateData" column="blogCreateData"></result>
        <result property="blogStatus" column="blogStatus"></result>
        <result property="blogShow" column="blogShow"></result>
        <result property="blogRead" column="blogRead"></result>
        <result property="blogLike" column="blogLike"></result>
        <result property="blogFavorite" column="blogFavorite"></result>
        <result property="userId" column="userId"></result>
        <result property="blogTypeId" column="blogTypeId"></result>
        <result property="blogVisibilityId" column="blogVisibilityId"></result>
        <result property="userId" column="userId"></result>
        <collection property="user" column="userId" ofType="jkw.pojo.User">
            <id property="userId" column="userId"></id>
            <result property="userImg" column="userImg"></result>
            <result property="nickname" column="nickname"></result>
            <result property="email" column="email"></result>
            <result property="username" column="username"></result>
            <result property="signature" column="signature"></result>
        </collection>
        <collection property="blogType" column="blogTypeId" ofType="jkw.pojo.BlogType">
            <id property="blogTypeId" column="blogTypeId"></id>
            <result property="blogTypeName" column="blogTypeName"></result>
        </collection>
        <collection property="blogVisibility" column="blogVisibilityId" ofType="jkw.pojo.BlogVisibility">
            <id property="blogVisibilityId" column="blogVisibilityId"></id>
            <result property="blogVisibilityName" column="blogVisibilityName"></result>
        </collection>
        <collection property="tags" column="blogId" ofType="jkw.pojo.BlogTag">
            <id property="blogTagId" column="blogTagId"></id>
            <result property="blogTagName" column="blogTagName"></result>
        </collection>
        <collection property="columns" column="blogId" ofType="jkw.pojo.BlogColumn">
            <id property="blogColumnId" column="blogColumnId"></id>
            <result property="blogColumnName" column="blogColumnName"></result>
            <result property="blogColumnCoverImg" column="blogColumnCoverImg"></result>
            <result property="blogColumnIntroduction" column="blogColumnIntroduction"></result>
            <result property="userId" column="userId"></result>
        </collection>
    </resultMap>
    <insert id="addBlog_column">
        INSERT INTO blog_blog_column
        VALUES (#{blogId}, #{blogColumnId});
    </insert>
    <delete id="deleteBlog_column" parameterType="int">
        DELETE
        FROM blog_blog_column
        WHERE blogId = #{blogId}
          and blogColumnId = #{blogColumnId});
    </delete>
    <delete id="deleteBlog_columnByBlogId" parameterType="int">
        DELETE
        FROM blog_blog_column
        WHERE blogId = #{blogId}
    </delete>

    <select id="findColumnByBlogId" resultType="jkw.pojo.BlogColumn" parameterType="int">
        select blog_column.*
        from blog_column
                 left join blog_blog_column
                           on blog_blog_column.blogColumnId = blog_column.blogColumnId
        where blog_blog_column.blogId = #{blogId}
    </select>

    <insert id="addBlog_tag">
        INSERT INTO blog_blog_tag
        VALUES (#{blogId}, #{blogTagId});
    </insert>
    <delete id="deleteBlog_tag" parameterType="int">
        DELETE
        FROM blog_blog_tag
        WHERE blogId = #{blogId}
          and blogTagId = #{blogTagId})
    </delete>
    <delete id="deleteBlog_tagByBlogId" parameterType="int">
        DELETE
        FROM blog_blog_tag
        WHERE blogId = #{blogId}
    </delete>

    <select id="findTagByBlogId" resultType="jkw.pojo.BlogTag" parameterType="int">
        select blog_tag.*
        from blog_tag
                 left join blog_blog_tag
                           on blog_blog_tag.blogTagId = blog_tag.blogTagId
        where blog_blog_tag.blogId = #{blogId}
    </select>

    <delete id="deleteAllComments" parameterType="int">
        DELETE
        FROM blog_comment
        WHERE blogId = #{blogId}
    </delete>

    <select id="findById" parameterType="int" resultMap="blogMapper">
        SELECT *
        FROM blog
                 LEFT JOIN user
                           ON blog.userId = user.userId
                 LEFT JOIN blog_type
                           ON blog.blogTypeId = blog_type.blogTypeId
                 LEFT JOIN blog_visibility
                           ON blog.blogVisibilityId = blog_visibility.blogVisibilityId
                 LEFT JOIN blog_blog_tag
                           ON blog.blogId = blog_blog_tag.blogId
                 LEFT JOIN blog_tag
                           ON blog_blog_tag.blogTagId = blog_tag.blogTagId
                 LEFT JOIN blog_blog_column
                           ON blog.blogId = blog_blog_column.blogId
                 LEFT JOIN blog_column
                           ON blog_column.blogColumnId = blog_blog_column.blogColumnId
        WHERE blog.blogId = #{blogId}
    </select>

    <select id="search" resultMap="blogMapper">
        SELECT *
        FROM blog
                 LEFT JOIN user
                           ON blog.userId = user.userId
                 LEFT JOIN blog_type
                           ON blog.blogTypeId = blog_type.blogTypeId
                 LEFT JOIN blog_visibility
                           ON blog.blogVisibilityId = blog_visibility.blogVisibilityId
                 LEFT JOIN blog_blog_tag
                           ON blog.blogId = blog_blog_tag.blogId
                 LEFT JOIN blog_tag
                           ON blog_blog_tag.blogTagId = blog_tag.blogTagId
                 LEFT JOIN blog_blog_column
                           ON blog.blogId = blog_blog_column.blogId
                 LEFT JOIN blog_column
                           ON blog_column.blogColumnId = blog_blog_column.blogColumnId
            ${ew.customSqlSegment}
        ORDER BY blog.blogId desc
    </select>

    <select id="searchWhenStatus" resultMap="blogMapper">
        SELECT *
        FROM blog
                 LEFT JOIN user
                           ON blog.userId = user.userId
                 LEFT JOIN blog_type
                           ON blog.blogTypeId = blog_type.blogTypeId
                 LEFT JOIN blog_visibility
                           ON blog.blogVisibilityId = blog_visibility.blogVisibilityId
                 LEFT JOIN blog_blog_tag
                           ON blog.blogId = blog_blog_tag.blogId
                 LEFT JOIN blog_tag
                           ON blog_blog_tag.blogTagId = blog_tag.blogTagId
                 LEFT JOIN blog_blog_column
                           ON blog.blogId = blog_blog_column.blogId
                 LEFT JOIN blog_column
                           ON blog_column.blogColumnId = blog_blog_column.blogColumnId ${ew.customSqlSegment} and blog.blogStatus=1
        ORDER BY blog.blogId desc
    </select>


</mapper>

BlogTagMapper

public interface BlogTagMapper extends BaseMapper<BlogTag> {
    //根据标签id删除博客_标签关联表的数据
    void deleteBlog_tagByBlogTagId(Integer blogTagId);
}

BlogTagMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jkw.mapper.BlogTagMapper">

    <delete id="deleteBlog_tagByBlogTagId" parameterType="int">
        DELETE
        FROM blog_blog_tag
        WHERE blogTagId = #{blogTagId}
    </delete>


</mapper>

BlogTypeMapper

public interface BlogTypeMapper extends BaseMapper<BlogType> {
}

BlogVisibilityMapper

public interface BlogVisibilityMapper extends BaseMapper<BlogVisibility> {
}

服务层接口

BlogColumnService

public interface BlogColumnService {
    void add(BlogColumn blogColumn);

    void update(BlogColumn blogColumn);

    void delete(Integer id);

    BlogColumn findById(Integer id);

    List<BlogColumn> findAll();

    Page<BlogColumn> search(String search, int page, int size);

    //根据用户id分页查询专栏
    Page<BlogColumn> searchByUserId(Integer userId, int page, int size);
}

BlogCommentService

public interface BlogCommentService {
    void add(BlogComment blogComment);

    void update(BlogComment blogComment);

    void delete(Integer id);

    BlogComment findById(Integer id);

    List<BlogComment> findAll();

    Page<BlogComment> search(String search, int page, int size);

    //根据博客id分页查询
    Page<BlogComment> searchByBlogId(Integer blogId, int page, int size);
}

BlogService

public interface BlogService {
    void add(Blog blog);

    void update(Blog blog);

    void delete(Integer id);

    Blog findById(Integer id);

    List<Blog> findAll();

    Page<Blog> search(String search, int page, int size);

    //分页查询状态为发布的博客
    Page<Blog> searchForStatus(String search, int page, int size);

    //更新博客状态
    void updateStatus(Integer id);

    //根据用户名分页查找博客文章
    Page<Blog> searchByUserId(Integer userId, int page, int size);

    //添加博客_专栏中间表的数据
    void addBlog_column(Integer blogId, Integer blogColumnId);

    //删除博客_专栏中间表的数据
    void deleteBlog_column(Integer blogId, Integer blogColumnId);

    //根据博客id查询博客_专栏中间表的专栏数据
    List<BlogColumn> findColumnByBlogId(Integer blogId);

    //添加博客_标签中间表的数据
    void addBlog_tag(Integer blogId, Integer blogTagId);

    //删除博客_标签中间表的数据
    void deleteBlog_tag(Integer blogId, Integer blogTagId);

    //根据博客id查询博客_标签中间表的标签数据
    List<BlogTag> findTagByBlogId(Integer blogId);
}

BlogTagService

public interface BlogTagService {
    void add(BlogTag blogTag);

    void update(BlogTag blogTag);

    void delete(Integer id);

    BlogTag findById(Integer id);

    List<BlogTag> findAll();

    Page<BlogTag> search(String search, int page, int size);
}

BlogTypeService

public interface BlogTypeService {
    void add(BlogType blogType);

    void update(BlogType blogType);

    void delete(Integer id);

    BlogType findById(Integer id);

    List<BlogType> findAll();

    Page<BlogType> search(String search, int page, int size);
}

BlogVisibilityService

public interface BlogVisibilityService {
    void add(BlogVisibility blogVisibility);

    void update(BlogVisibility blogVisibility);

    void delete(Integer id);

    BlogVisibility findById(Integer id);

    List<BlogVisibility> findAll();

    Page<BlogVisibility> search(String search, int page, int size);
}

服务层实现

BlogColumnServiceImpl

@Service
@Transactional
public class BlogColumnServiceImpl implements BlogColumnService {
    @Autowired
    private BlogColumnMapper blogColumnMapper;

    @Override
    public void add(BlogColumn blogColumn) {
        blogColumnMapper.insert(blogColumn);
    }

    @Override
    public void update(BlogColumn blogColumn) {
        blogColumnMapper.updateById(blogColumn);
    }

    @Override
    public void delete(Integer id) {
        //删除博客_专栏关联表的数据
        blogColumnMapper.deleteBlog_columnByBlogColumnId(id);
        //删除关联表的数据
        blogColumnMapper.deleteById(id);
    }

    @Override
    public BlogColumn findById(Integer id) {
        return blogColumnMapper.selectById(id);
    }

    @Override
    public List<BlogColumn> findAll() {
        return blogColumnMapper.selectList(null);
    }

    @Override
    public Page<BlogColumn> search(String search, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (search != null) {

        }
        return blogColumnMapper.selectPage(new Page<>(page, size), queryWrapper);
    }

    @Override
    public Page<BlogColumn> searchByUserId(Integer userId, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("userId", userId);
        return blogColumnMapper.selectPage(new Page<>(page, size), queryWrapper);
    }
}

BlogCommentServiceImpl

@Service
@Transactional
public class BlogCommentServiceImpl implements BlogCommentService {
    @Autowired
    private BlogCommentMapper blogCommentMapper;

    @Override
    public void add(BlogComment blogComment) {
        blogCommentMapper.insert(blogComment);
    }

    @Override
    public void update(BlogComment blogComment) {
        blogCommentMapper.updateById(blogComment);
    }

    @Override
    public void delete(Integer id) {
        blogCommentMapper.deleteById(id);
    }

    @Override
    public BlogComment findById(Integer id) {
        return blogCommentMapper.selectById(id);
    }

    @Override
    public List<BlogComment> findAll() {
        return blogCommentMapper.selectList(null);
    }

    @Override
    public Page<BlogComment> search(String search, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (search != null) {

        }
        return blogCommentMapper.selectPage(new Page<>(page, size), queryWrapper);
    }

    @Override
    public Page<BlogComment> searchByBlogId(Integer blogId, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("blogId", blogId);
        return blogCommentMapper.selectPage(new Page<>(page, size), queryWrapper);
    }
}

BlogServiceImpl

@Service
@Transactional
public class BlogServiceImpl implements BlogService {
    @Autowired
    private BlogMapper blogMapper;

    @Override
    public void add(Blog blog) {
        blogMapper.insert(blog);
    }

    @Override
    public void update(Blog blog) {
        blogMapper.updateById(blog);
    }

    @Override
    public void delete(Integer id) {
        //删除博客_专栏中间表的数据
        blogMapper.deleteBlog_columnByBlogId(id);
        //删除博客_标签中间表的数据
        blogMapper.deleteBlog_tagByBlogId(id);
        //删除博客对应的所有评论
        blogMapper.deleteAllComments(id);
        blogMapper.deleteById(id);
    }

    @Override
    public Blog findById(Integer id) {
        return blogMapper.findById(id);
    }

    @Override
    public List<Blog> findAll() {
        return blogMapper.selectList(null);
    }

    @Override
    public Page<Blog> search(String search, int page, int size) {
        QueryWrapper<Blog> queryWrapper = new QueryWrapper();
        if (search != null) {
            queryWrapper.like("blogTitle", search);
        }
        return blogMapper.search(new Page<>(page, size), queryWrapper);
    }

    @Override
    public Page<Blog> searchForStatus(String search, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (search != null) {

        }
        return blogMapper.searchWhenStatus(new Page<>(page, size), queryWrapper);
    }


    @Override
    public Page<Blog> searchByUserId(Integer userId, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("userId", userId);
        return blogMapper.search(new Page<>(page, size), queryWrapper);
    }

    @Override
    public void updateStatus(Integer id) {
        Blog blog = blogMapper.selectById(id);
        if (blog.getBlogStatus().equals("1")) {
            blog.setBlogStatus("0");
            blogMapper.updateById(blog);
        } else {
            blog.setBlogStatus("1");
            blogMapper.updateById(blog);
        }
    }

    @Override
    public void addBlog_column(Integer blogId, Integer blogColumnId) {
        blogMapper.addBlog_column(blogId, blogColumnId);
    }

    @Override
    public void deleteBlog_column(Integer blogId, Integer blogColumnId) {
        blogMapper.deleteBlog_column(blogId, blogColumnId);
    }

    @Override
    public List<BlogColumn> findColumnByBlogId(Integer blogId) {
        return blogMapper.findColumnByBlogId(blogId);
    }

    @Override
    public void addBlog_tag(Integer blogId, Integer blogTagId) {
        blogMapper.addBlog_tag(blogId, blogTagId);
    }

    @Override
    public void deleteBlog_tag(Integer blogId, Integer blogTagId) {
        blogMapper.deleteBlog_tag(blogId, blogTagId);
    }

    @Override
    public List<BlogTag> findTagByBlogId(Integer blogId) {
        return blogMapper.findTagByBlogId(blogId);
    }
}

BlogTagServiceImpl

@Service
@Transactional
public class BlogTagServiceImpl implements BlogTagService {
    @Autowired
    private BlogTagMapper blogTagMapper;

    @Override
    public void add(BlogTag blogTag) {
        blogTagMapper.insert(blogTag);
    }

    @Override
    public void update(BlogTag blogTag) {
        blogTagMapper.updateById(blogTag);
    }

    @Override
    public void delete(Integer id) {
        //删除博客_标签关联表的数据
        blogTagMapper.deleteBlog_tagByBlogTagId(id);
        //删除标签
        blogTagMapper.deleteById(id);
    }

    @Override
    public BlogTag findById(Integer id) {
       return blogTagMapper.selectById(id);
    }

    @Override
    public List<BlogTag> findAll() {
        return blogTagMapper.selectList(null);
    }

    @Override
    public Page<BlogTag> search(String search, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (search != null) {

        }
        return blogTagMapper.selectPage(new Page<>(page, size), queryWrapper);
    }
}

BlogTypeServiceImpl

@Service
@Transactional
public class BlogTypeServiceImpl implements BlogTypeService {
    @Autowired
    private BlogTypeMapper blogTypeMapper;

    @Override
    public void add(BlogType blogType) {
        blogTypeMapper.insert(blogType);
    }

    @Override
    public void update(BlogType blogType) {
        blogTypeMapper.updateById(blogType);
    }

    @Override
    public void delete(Integer id) {
        blogTypeMapper.deleteById(id);
    }

    @Override
    public BlogType findById(Integer id) {
       return blogTypeMapper.selectById(id);
    }

    @Override
    public List<BlogType> findAll() {
        return blogTypeMapper.selectList(null);
    }

    @Override
    public Page<BlogType> search(String search, int page, int size) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (search != null) {

        }
        return blogTypeMapper.selectPage(new Page<>(page, size), queryWrapper);
    }
}

BlogVisibilityServiceImpl

@Service
@Transactional
public class BlogVisibilityServiceImpl implements BlogVisibilityService {
    @Autowired
    private BlogVisibilityMapper blogVisibilityMapper;

    @Override
    public void add(BlogVisibility blogVisibility) {
        blogVisibilityMapper.insert(blogVisibility);
    }

    @Override
    public void update(BlogVisibility blogVisibility) {
        blogVisibilityMapper.updateById(blogVisibility);
    }

    @Override
    public void delete(Integer id) {
        blogVisibilityMapper.deleteById(id);
    }

    @Override
    public BlogVisibility findById(Integer id) {
        return blogVisibilityMapper.selectById(id);
    }

    @Override
    public List<BlogVisibility> findAll() {
        return blogVisibilityMapper.selectList(null);
    }

    @Override
    public Page<BlogVisibility> search(String search, int page, int size) {
        QueryWrapper<BlogVisibility> queryWrapper = new QueryWrapper();
        if (search != null) {

        }
        return blogVisibilityMapper.selectPage(new Page<>(page, size), queryWrapper);
    }
}

后台控制层接口

BlogColumnCon

@CrossOrigin
@RequestMapping("/back/blogColumn")
@RestController
public class BlogColumnCon {

    @Autowired
    private BlogColumnService blogColumnService;

    /**
     * 新增
     *
     * @param blogColumn
     * @return
     */
    @PostMapping("/add")
    public BaseResult add(BlogColumn blogColumn) {
        blogColumnService.add(blogColumn);
        return BaseResult.ok();
    }

    /**
     * 修改
     *
     * @param blogColumn
     * @return
     */
    @PostMapping("/update")
    public BaseResult update(BlogColumn blogColumn) {
        blogColumnService.update(blogColumn);
        return BaseResult.ok();
    }

    /**
     * 删除
     *
     * @param blogColumnId
     * @return
     */
    @DeleteMapping("/delete")
    public BaseResult delete(Integer blogColumnId) {
        blogColumnService.delete(blogColumnId);
        return BaseResult.ok();
    }

    /**
     * 根据id查询
     *
     * @param blogColumnId
     * @return
     */
    @GetMapping("/findById")
    public BaseResult findById(Integer blogColumnId) {
        BlogColumn blogColumn = blogColumnService.findById(blogColumnId);
        return BaseResult.ok(blogColumn);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<BlogColumn> all = blogColumnService.findAll();
        return BaseResult.ok(all);
    }

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/search")
    public BaseResult search(String search, int page, int size) {
        Page<BlogColumn> brandPage = blogColumnService.search(search, page, size);
        return BaseResult.ok(brandPage);
    }

    /**
     * 根据用户id分页查询
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/searchByUserId")
    public BaseResult search(Integer userId, int page, int size) {
        Page<BlogColumn> brandPage = blogColumnService.searchByUserId(userId, page, size);
        return BaseResult.ok(brandPage);
    }
}

BlogCommentCon

@CrossOrigin
@RequestMapping("/back/blogComment")
@RestController
public class BlogCommentCon {

    @Autowired
    private BlogCommentService blogCommentService;

    /**
     * 新增
     *
     * @param blogComment
     * @return
     */
    @PostMapping("/add")
    public BaseResult add(BlogComment blogComment) {
        blogCommentService.add(blogComment);
        return BaseResult.ok();
    }

    /**
     * 修改
     *
     * @param blogComment
     * @return
     */
    @PostMapping("/update")
    public BaseResult update(BlogComment blogComment) {
        blogCommentService.update(blogComment);
        return BaseResult.ok();
    }

    /**
     * 删除
     *
     * @param blogCommentId
     * @return
     */
    @DeleteMapping("/delete")
    public BaseResult delete(Integer blogCommentId) {
        blogCommentService.delete(blogCommentId);
        return BaseResult.ok();
    }

    /**
     * 根据id查询
     *
     * @param blogCommentId
     * @return
     */
    @GetMapping("/findById")
    public BaseResult findById(Integer blogCommentId) {
        BlogComment blogComment = blogCommentService.findById(blogCommentId);
        return BaseResult.ok(blogComment);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<BlogComment> all = blogCommentService.findAll();
        return BaseResult.ok(all);
    }

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/search")
    public BaseResult search(String search, int page, int size) {
        Page<BlogComment> brandPage = blogCommentService.search(search, page, size);
        return BaseResult.ok(brandPage);
    }

    /**
     * 根据博客id分页查询
     *
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/searchByBlogId")
    public BaseResult searchByBlogId(Integer blogId, int page, int size) {
        Page<BlogComment> brandPage = blogCommentService.searchByBlogId(blogId, page, size);
        return BaseResult.ok(brandPage);
    }
}

BlogCon

package jkw.controller.back;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jkw.pojo.Blog;
import jkw.pojo.BlogColumn;
import jkw.pojo.BlogTag;
import jkw.service.BlogService;
import jkw.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RequestMapping("/back/blog")
@RestController
public class BlogCon {
    @Autowired
    private BlogService blogService;

    /**
     * 新增
     *
     * @param blog
     * @return
     */
    @PostMapping("/add")
    public BaseResult add(Blog blog) {
        blogService.add(blog);
        return BaseResult.ok();
    }

    /**
     * 修改
     *
     * @param blog
     * @return
     */
    @PostMapping("/update")
    public BaseResult update(Blog blog) {
        blogService.update(blog);
        return BaseResult.ok();
    }

    /**
     * 删除
     *
     * @param blogId
     * @return
     */
    @DeleteMapping("/delete")
    public BaseResult delete(Integer blogId) {
        blogService.delete(blogId);
        return BaseResult.ok();
    }

    /**
     * 根据id查询
     *
     * @param blogId
     * @return
     */
    @GetMapping("/findById")
    public BaseResult findById(Integer blogId) {
        Blog blog = blogService.findById(blogId);
        return BaseResult.ok(blog);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<Blog> all = blogService.findAll();
        return BaseResult.ok(all);
    }

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/search")
    public BaseResult search(String search, int page, int size) {
        Page<Blog> brandPage = blogService.search(search, page, size);
        return BaseResult.ok(brandPage);
    }

    /**
     * 根据用户名分页查找博客文章
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/searchByUserId")
    public BaseResult search(Integer userId, int page, int size) {
        Page<Blog> brandPage = blogService.searchByUserId(userId, page, size);
        return BaseResult.ok(brandPage);
    }


    /**
     * 更新博客状态
     *
     * @param blogId
     * @return
     */
    @PostMapping("/updateStatus")
    public BaseResult update(Integer blogId) {
        blogService.updateStatus(blogId);
        return BaseResult.ok();
    }

    /**
     * 添加博客_专栏中间表的数据
     *
     * @param blogId       博客id
     * @param blogColumnId 专栏id
     * @return
     */
    @PostMapping("/addColumn")
    public BaseResult addColumn(Integer blogId, Integer blogColumnId) {
        blogService.addBlog_column(blogId, blogColumnId);
        return BaseResult.ok();
    }

    /**
     * 删除博客_专栏中间表的数据
     *
     * @param blogId       博客id
     * @param blogColumnId 专栏id
     * @return
     */
    @DeleteMapping("/deleteColumn")
    public BaseResult deleteColumn(Integer blogId, Integer blogColumnId) {
        blogService.deleteBlog_column(blogId, blogColumnId);
        return BaseResult.ok();
    }

    /**
     * 根据博客id查询博客_专栏中间表的专栏数据
     *
     * @param blogId
     * @return
     */
    @GetMapping("/findColumnByBlogId")
    public BaseResult findColumnByBlogId(Integer blogId) {
        List<BlogColumn> blogColumnList = blogService.findColumnByBlogId(blogId);
        return BaseResult.ok(blogColumnList);
    }

    /**
     * 添加博客_标签中间表的数据
     *
     * @param blogId    博客id
     * @param blogTagId 标签id
     * @return
     */
    @PostMapping("/addTag")
    public BaseResult addTag(Integer blogId, Integer blogTagId) {
        blogService.addBlog_tag(blogId, blogTagId);
        return BaseResult.ok();
    }

    /**
     * 删除博客_标签中间表的数据
     *
     * @param blogId    博客id
     * @param blogTagId 标签id
     * @return
     */
    @DeleteMapping("/deleteTag")
    public BaseResult deleteTag(Integer blogId, Integer blogTagId) {
        blogService.deleteBlog_tag(blogId, blogTagId);
        return BaseResult.ok();
    }

    /**
     * 根据博客id查询博客_标签中间表的标签数据
     *
     * @param blogId
     * @return
     */
    @GetMapping("/findTagByBlogId")
    public BaseResult findTagByBlogId(Integer blogId) {
        List<BlogTag> blogTagList = blogService.findTagByBlogId(blogId);
        return BaseResult.ok(blogTagList);
    }

}

BlogTagCon

@CrossOrigin
@RequestMapping("/back/blogTag")
@RestController
public class BlogTagCon {

    @Autowired
    private BlogTagService blogTagService;

    /**
     * 新增
     *
     * @param blogTag
     * @return
     */
    @PostMapping("/add")
    public BaseResult add(BlogTag blogTag) {
        blogTagService.add(blogTag);
        return BaseResult.ok();
    }

    /**
     * 修改
     *
     * @param blogTag
     * @return
     */
    @PostMapping("/update")
    public BaseResult update(BlogTag blogTag) {
        blogTagService.update(blogTag);
        return BaseResult.ok();
    }

    /**
     * 删除
     *
     * @param blogTagId
     * @return
     */
    @DeleteMapping("/delete")
    public BaseResult delete(Integer blogTagId) {
        blogTagService.delete(blogTagId);
        return BaseResult.ok();
    }

    /**
     * 根据id查询
     *
     * @param blogTagId
     * @return
     */
    @GetMapping("/findById")
    public BaseResult findById(Integer blogTagId) {
        BlogTag blogTag = blogTagService.findById(blogTagId);
        return BaseResult.ok(blogTag);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<BlogTag> all = blogTagService.findAll();
        return BaseResult.ok(all);
    }

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/search")
    public BaseResult search(String search, int page, int size) {
        Page<BlogTag> brandPage = blogTagService.search(search, page, size);
        return BaseResult.ok(brandPage);
    }
}

BlogTypeCon

@CrossOrigin
@RequestMapping("/back/blogType")
@RestController
public class BlogTypeCon {

    @Autowired
    private BlogTypeService blogTypeService;

    /**
     * 新增
     *
     * @param blogType
     * @return
     */
    @PostMapping("/add")
    public BaseResult add(BlogType blogType) {
        blogTypeService.add(blogType);
        return BaseResult.ok();
    }

    /**
     * 修改
     *
     * @param blogType
     * @return
     */
    @PostMapping("/update")
    public BaseResult update(BlogType blogType) {
        blogTypeService.update(blogType);
        return BaseResult.ok();
    }

    /**
     * 删除
     *
     * @param blogTypeId
     * @return
     */
    @DeleteMapping("/delete")
    public BaseResult delete(Integer blogTypeId) {
        blogTypeService.delete(blogTypeId);
        return BaseResult.ok();
    }

    /**
     * 根据id查询
     *
     * @param blogTypeId
     * @return
     */
    @GetMapping("/findById")
    public BaseResult findById(Integer blogTypeId) {
        BlogType blogType = blogTypeService.findById(blogTypeId);
        return BaseResult.ok(blogType);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<BlogType> all = blogTypeService.findAll();
        return BaseResult.ok(all);
    }

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */

    @GetMapping("/search")
    public BaseResult search(String search, int page, int size) {
        Page<BlogType> brandPage = blogTypeService.search(search, page, size);
        return BaseResult.ok(brandPage);
    }
}

BlogVisibilityCon

@CrossOrigin
@RequestMapping("/back/blogVisibility")
@RestController
public class BlogVisibilityCon {

    @Autowired
    private BlogVisibilityService blogVisibilityService;

    /**
     * 新增
     *
     * @param blogVisibility
     * @return
     */
    @PostMapping("/add")
    public BaseResult add(BlogVisibility blogVisibility) {
        blogVisibilityService.add(blogVisibility);
        return BaseResult.ok();
    }

    /**
     * 修改
     *
     * @param blogVisibility
     * @return
     */
    @PostMapping("/update")
    public BaseResult update(BlogVisibility blogVisibility) {
        blogVisibilityService.update(blogVisibility);
        return BaseResult.ok();
    }

    /**
     * 删除
     *
     * @param blogVisibilityId
     * @return
     */
    @DeleteMapping("/delete")
    public BaseResult delete(Integer blogVisibilityId) {
        blogVisibilityService.delete(blogVisibilityId);
        return BaseResult.ok();
    }

    /**
     * 根据id查询
     *
     * @param blogVisibilityId
     * @return
     */
    @GetMapping("/findById")
    public BaseResult findById(Integer blogVisibilityId) {
        BlogVisibility blogVisibility = blogVisibilityService.findById(blogVisibilityId);
        return BaseResult.ok(blogVisibility);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @GetMapping("/findAll")
    public BaseResult findAll() {
        List<BlogVisibility> all = blogVisibilityService.findAll();
        return BaseResult.ok(all);
    }

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/search")
    public BaseResult search(String search, int page, int size) {
        Page<BlogVisibility> blogVisibilityPage = blogVisibilityService.search(search, page, size);
        return BaseResult.ok(blogVisibilityPage);
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1032358.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

LeetCode算法心得——连续的子数组和(前缀和+HashMap)

大家好&#xff0c;我是晴天学长&#xff0c;同余定理的应用加上hashmap的灵活应用&#xff0c;需要的小伙伴可以关注支持一下哦&#xff01;后续会继续更新的。 1) .连续的子数组的和 题目描述&#xff1a; 给你一个整数数组 nums 和一个整数 k &#xff0c;编写一个函数来判断…

【 2023华为杯C题】大规模创新类竞赛评审方案研究(思路、代码......)

目录 1 题目概述 2 问题 3 极差的定义及标准分的计算方法 4 题目及数据下载 5 思路、代码下载...... 1 题目概述 现在创新类竞赛很多&#xff0c;其中规模较大的竞赛&#xff0c;一般采用两阶段&#xff08;网评、现场评审&#xff09;或三阶段&#xff08;网评、现场评审…

pcl--第十节 点云曲面重建

曲面重建技术在逆向工程、数据可视化、机器视觉、虚拟现实、医疗技术等领域中得到了广泛的应用 。 例如&#xff0c;在汽车、航空等工业领域中&#xff0c;复杂外形产品的设计仍需要根据手工模型&#xff0c;采用逆向工程的手段建立产品的数字化模型&#xff0c;根据测量数据建…

[React] 自定义hooks设计模式

文章目录 1.自定义hooks设计1.1 自定义hooks1.2 设计一个自定义hooks1.3 自定义hooks的驱动条件1.4 自定义hooks的通用模式1.5 自定义hooks的条件限定 1.自定义hooks设计 react-hooks是react16.8以后&#xff0c;react新增的钩子API&#xff0c;目的是增加代码的可复用性&…

线性表应用(非递减合并、分解链表、删除线性表)

将两个非递减的有序链表合并为一个非递增的有序链表。要求结果链表仍使用原来两个链表的存储空间&#xff0c;不另外占用其它的存储空间。表中允许有重复的数据。 #include<iostream> using namespace std; typedef struct list {int data;list* next; }list,*linklist;…

Linux 系统移植(一)-- 系统组成

参考资料&#xff1a; linux系统移植篇&#xff08;一&#xff09;—— linux系统组成【野火Linux移植篇】1-uboot初识与编译/烧录步骤 文章目录 一、linux系统组成二、Uboot三、Linux内核四、设备树 本篇为Linux系统移植系列的第一篇文章&#xff0c;介绍了一个完整可运行的L…

2015年蓝桥杯省赛C/C++ A组 灾后重建题解(100分)

10. 灾后重建 Pear市一共有N&#xff08;<50000&#xff09;个居民点&#xff0c;居民点之间有M&#xff08;<200000&#xff09;条双向道路相连。这些居民点两两之间都可以通过双向道路到达。这种情况一直持续到最近&#xff0c;一次严重的地震毁坏了全部M条道路。 震后…

【10个OOM异常的场景以及对应的排查经验】

文章目录 1. 场景描述&#xff1a;内存泄漏2. 场景描述&#xff1a;过多线程3. 场景描述&#xff1a;大量数据查询4. 场景描述&#xff1a;大文件读取5. 场景描述&#xff1a;高并发访问6. 场景描述&#xff1a;大字符串操作7. 场景描述&#xff1a;大数据集合操作8. 场景描述&…

C语言-扫雷游戏的实现

&#x1f308;write in front&#x1f308; &#x1f9f8;大家好&#xff0c;我是Aileen&#x1f9f8;.希望你看完之后&#xff0c;能对你有所帮助&#xff0c;不足请指正&#xff01;共同学习交流. &#x1f194;本文由Aileen_0v0&#x1f9f8; 原创 CSDN首发&#x1f412; 如…

反射【Java】

概念&#xff1a;允许对成员变量&#xff0c;成员方法和构造方法的信息进行编程访问 获取class对象 Class.forName("全类名"); //全类名&#xff1a;包名类名 类名.class 对象.getClass(); //有一个名为Goods的类Class clazz1 Class.forName("com.ln1.Goo…

VR赋能红色教育,让爱国主义精神永放光彩

昨天的918防空警报长鸣&#xff0c;人们默哀&#xff0c;可见爱国主义精神长存。为了贯彻落实“把红色资源利用好、红色传统发扬好、红色基因传承好”的指示精神&#xff0c;许多红色景点开始引入VR全景展示技术&#xff0c;为游客提供全方位720度无死角的景区展示体验。 VR全…

【电源专题】什么是充电芯片的Shipping Mode(船运模式)

现在越来越多电子产品小型化,手持化,这样就需要电池来为产品供电。但电池供电造成的另一个难题就是产品的续航能力的强与弱。 如果想提升续航能力,有一种方法是提高电池容量。如果电池体积没有变化的情况下,可能使用了新型材料、高级技术来增加电池容量,但这势必会增加电池…

Webpack设置代码映射,可调试打包后的代码

当我们的代码打包过后再看源码就会变成下面这个样子&#xff1a; 这时候我们就调试不了我们的代码 解决方式&#xff1a; 在webpack.config.js中添加如下代码&#xff1a; module.exports {mode: "development", // 设置打包的模式&#xff1a;production生产模式…

2000-2021年上市公司劳动投资效率测算数据:劳动投资效率、冗余雇佣、雇佣不足(含原始数据和计算代码do文档)

2000-2021 年上市公司劳动投资效率测算数据&#xff1a;劳动投资效率、冗余雇佣、雇佣不足 &#xff08;含计算代码do文档&#xff09; 1、时间&#xff1a;2000-2021 年 2、范围&#xff1a;沪深A 股上市公司 3、指标&#xff1a;code、year、证券代码、货币资金、短期投资…

TexStudio报错 Class: No Found

\classdocument[preprint,review,fleqn,sort&compress,3p]{elsarticle}这里常见导入的类&#xff08;class&#xff09;文件有article.cls&#xff0c;elsarticle.cls&#xff0c;sn-jnl.cls等 一般来说这些文件都应该和我们的源文件document.tex在同一个目录下。如果不在…

Vue复选框批量删除示例

Vue复选框批量删除 通过使用v-model指令绑定单个复选框 例如<input type"checkbox" id"checkbox" v-model"checked"> 而本次我们要做的示例大致是这样的&#xff0c;首先可以增加内容&#xff0c;然后通过勾选来进行单独或者批量删除&…

chk文件怎么恢复?chk文件恢复软件哪个好?

电脑中的每个文件都有其不同的后缀名&#xff0c;如.txt、.png等等&#xff0c;那么你知道.chk后缀的文件是什么吗&#xff1f;下面我们就来一起了解一下吧。 chk文件的含义 chk文件是用户在使用磁盘碎片整理程序后所产生的丢失簇的恢复文件&#xff0c;磁盘中的原文件并没有丢…

0基础学three.js环境搭建(2)

这是0基础学three.js系列中的第二篇&#xff0c;在这篇里面我会带着大家把开发环境搭建起来&#xff0c;关于开发环境&#xff0c;方式很多&#xff0c;如果你没有基础&#xff0c;就跟着我的步骤一步一步来&#xff0c;保你不出错。 首先安装node环境&#xff0c;关于node是干…

操作系统、进程和线程

目录 一、操作系统 二、进程/任务&#xff08;Process/Task&#xff09; 1. 什么是进程/任务 2. 进程控制块抽象&#xff08;PCB Process control Block&#xff09; 3. CPU分配 —— 进程调度&#xff08;Process Scheduling&#xff09; 4. 内存分配 —— 内存管理&…

【Redis】第5讲 Redis的下载并安装

下载Redis中文网https://www.redis.net.cn/ 百度网盘下载&#xff1a; 百度网盘 请输入提取码百度网盘为您提供文件的网络备份、同步和分享服务。空间大、速度快、安全稳固&#xff0c;支持教育网加速&#xff0c;支持手机端。注册使用百度网盘即可享受免费存储空间https://p…