[SpringBoot3]博客管理系统(源码放评论区了)

八、博客管理系统

  • 创建新的SpringBoot项目,综合运用以上知识点,做一个文章管理的后台应用。
  • 依赖:
    • Spring Web
    • Lombok
    • Thymeleaf
    • MyBatis Framework
    • MySQL Driver
    • Bean Validation
    • hutool
  • 需求:文章管理工作,发布新文章,编辑文章,查看文章内容等

8.1配置文件

1.组织配置文件

app-base.yml

article:#最低阅读数low-read: 10#首页显示记录的数量top-read: 20

db.properties(一定要用properties)

#配置数据源
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/springboot?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=030522
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=10
#获取连接时,检测语句
spring.datasource.hikari.connection-test-query=select 1
spring.datasource.hikari.connection-timeout=20000
#其他属性
spring.datasource.hikari.data-source-properties.cachePrepStmts=true
spring.datasource.hikari.data-source-properties.dataSource.cachePrepStmtst=true
spring.datasource.hikari.data-source-properties.dataSource.prepStmtCacheSize=250
spring.datasource.hikari.data-source-properties.dataSource.prepStmtCacheSqlLimit=2048
spring.datasource.hikari.data-source-properties.dataSource.useServerPrepStmts=true

<img src=“C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20230902103338099.png” alt="image-20230902103338099" style="zoom:80%;" />

8.2视图文件

2.logo文件

  • favicon.ico 放在 static/ 根目录下

3.创建模板页面

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

articleList.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>Title</title><link rel="icon" th:href="@{/favicon.ico}" type="image/x-icon"/><script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div style="margin-left: 200px"><h3>阅读最多的20篇文章</h3><table border="1px" cellpadding="0px" cellspacing="0px"><thead><th>选择</th><th>序号</th><th>标题</th><th>副标题</th><th>已读数</th><th>发布时间</th><th>最后修改时间</th><th>操作</th></thead><tbody><tr th:each="article , loopStatus : ${articleList}"><td><input type="checkbox" th:value="${article.id}"></td><td th:text="${loopStatus.index + 1}"></td><td th:text="${article.title}"></td><td th:text="${article.summary}"></td><td th:text="${article.readCount}"></td><td th:text="${article.createTime}"></td><td th:text="${article.updateTime}"></td><td><a th:href="@{/article/get(id=${article.id})}">编辑文章</a> </td></tr><tr><td colspan="8"><table width="100%"><tr><td><button id="add" onclick="addArticle()">发布新文章</button></td><td><button id="del" onclick="deleteArticle()">删除文章</button></td><td><button id="view" onclick="overView()">文章概览</button></td></tr></table></td></tr></tbody></table><form id="frm" th:action="@{/view/addArticle}" method="get"></form><form id="delFrm" th:action="@{/article/remove}" method="post"><input type="hidden" name="ids" id="ids" value=""></form>
</div>
<script>function addArticle(){$("#frm").submit();}function deleteArticle(){var ids=[];$("input[type='checkbox']:checked").each((index,item)=>{ids.push(item.value);})if (ids.length==0){alert("请选择文章");return;}$("#ids").val(ids);$("#delFrm").submit();}function overView(){var ids = [];$("input[type='checkbox']:checked").each( (index,item) =>{ids.push(item.value);})if( ids.length != 1){alert("请选择一个文章查看");return;}$.get("../article/detail/overview",{id: ids[0]}, (data,status)=>{alert(data);})}
</script>
</body>
</html>

addArticle.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>Title</title><link rel="icon" th:href="@{/favicon.ico}" type="image/x-icon"/>
</head>
<body>
<div style="margin-left: 200px"><h3>发布新的文章</h3><form th:action="@{/article/add}" method="post"><table><tr><td>标题</td><td><input type="text" name="title"></td></tr><tr><td>副标题</td><td><input type="text" name="summary" size="50"></td></tr><tr><td>内容</td><td><textarea name="content" cols="60" rows="20"></textarea></td></tr></table><br/><input type="submit" value="发布新文章" style="margin-left: 200px"></form>
</div>
</body>
</html>

editArticle.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>Title</title><link rel="icon" th:href="@{/favicon.ico}" type="image/x-icon"/>
</head>
<body>
<div style="margin-left: 200px"><h3>修改文章</h3><form th:action="@{/article/edit}" method="post"><table><tr><td>标题</td><td><input type="text" name="title" th:value="${article.title}"></td></tr><tr><td>副标题</td><td><input type="text" name="summary" size="50" th:value="${article.summary}"></td></tr><tr><td>内容</td><td><textarea name="content" cols="60" rows="20" th:text="${article.content}"></textarea></td></tr></table><br/><input type="hidden" th:value="${article.id}" name="id"><input type="submit" value="确认修改" style="margin-left: 200px"></form>
</div>
</body>
</html>

bind.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>Title</title><link rel="icon" th:href="@{/favicon.ico}" type="image/x-icon"/>
</head>
<body>
<h3>输入异常</h3>
<table border="1px"><thead><th>字段</th><th>描述</th></thead><tbody><tr th:each="err:${errors}"><td th:text="${err.field}"></td><td th:text="${err.defaultMessage}"></td></tr></tbody>
</table>
</body>
</html>

error.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>Title</title><link rel="icon" th:href="@{/favicon.ico}" type="image/x-icon"/>
</head>
<body>
<h3>请求错误</h3>
<h3 th:text="${msg}"></h3>
</body>
</html>

8.3Java代码

4.java代码

model包

ArticleDTO

package com.hhb.blog.model.dto;import lombok.Data;@Data
public class ArticleDTO {private Integer id;private String title;private String summary;private String content;
}

ArticleAndDetailMap

package com.hhb.blog.model.map;import lombok.Data;@Data
public class ArticleAndDetailMap {private Integer id;private String title;private String summary;private String content;
}

ArticleParam

package com.hhb.blog.model.param;import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;@Data
public class ArticleParam {//使用JSR303注解public static interface AddArticle{};public static interface EditArticle{};@NotNull(message = "修改时必须有id",groups = {EditArticle.class})@Min(value = 1,message = "文章id大于{value}",groups = {EditArticle.class})private Integer id;@NotBlank(message = "请输入文章标题",groups = {AddArticle.class,EditArticle.class})@Size(min = 2,max = 20,message = "文章标题在{min}-{max}",groups = {AddArticle.class,EditArticle.class})private String title;@NotBlank(message = "请输入文章副标题",groups = {AddArticle.class,EditArticle.class})@Size(min = 10,max=30,message = "文章副标题在{min}-{max}",groups = {AddArticle.class,EditArticle.class})private String summary;@NotBlank(message = "请输入文章内容",groups = {AddArticle.class,EditArticle.class})@Size(min = 20,max = 8000,message = "文章内容至少{min}字,最多{max}字",groups = {AddArticle.class,EditArticle.class})private String content;}

ArticleDeatilPO

package com.hhb.blog.model.po;import lombok.Data;@Data
public class ArticleDetailPO {private Integer id;private Integer articleId;private String content;
}

ArticlePO

package com.hhb.blog.model.po;import lombok.Data;import java.time.LocalDateTime;@Data
public class ArticlePO {private Integer id;private Integer userId;private String title;private String summary;private Integer readCount;private LocalDateTime createTime;private LocalDateTime updateTime;
}

ArticleVO

package com.hhb.blog.model.po;import lombok.Data;import java.time.LocalDateTime;@Data
public class ArticlePO {private Integer id;private Integer userId;private String title;private String summary;private Integer readCount;private LocalDateTime createTime;private LocalDateTime updateTime;
}

mapper包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

ArticleMapper

package com.hhb.blog.mapper;import com.hhb.blog.model.dto.ArticleDTO;
import com.hhb.blog.model.map.ArticleAndDetailMap;
import com.hhb.blog.model.po.ArticleDetailPO;
import com.hhb.blog.model.po.ArticlePO;
import org.apache.ibatis.annotations.*;import java.util.List;public interface ArticleMapper {//查询首页需要的文章列表@Select("""select id,user_id ,title,summary, read_count , create_time, update_timefrom articlewhere read_count >= #{lowRead}order by read_count desc limit #{topRead}""")List<ArticlePO> topSortByReadCount(Integer lowRead, Integer topRead);//添加文章@Insert("""insert into article(user_id, title, summary, read_count, create_time, update_time)values(#{userId},#{title},#{summary},#{readCount},#{createTime},#{updateTime})""")//主键自增@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")int insertArticle(ArticlePO articlePO);//添加文章内容@Insert("""insert into article_detail(article_id, content) values(#{articleId},#{content})""")int insertArticleDetail(ArticleDetailPO articleDetailPO);//两表连接,根据主键查询文章@Select("""select article.id,title,summary,contentfrom article,article_detailwhere article.id=article_detail.article_id and article_id=#{id}""")ArticleAndDetailMap selectArticleAndDetail(Integer id);//修改文章属性@Update("""update article set title=#{title},summary=#{summary},update_time=#{updateTime}where id=#{id}""")int updateArticle(ArticlePO articlePO);//更新文章内容@Update("""update article_detail set content=#{content} where article_id=#{articleId}""")int updateArticleDetail(ArticleDetailPO articleDetailPO);//删除文章@Delete("""<script>delete from article where id in <foreach item="id" collection="idList" open="(" separator="," close=")">#{id}</foreach></script>""")int deleteArticle(List<Integer> idList);//删除文章内容@Delete("""<script>delete from article_detail where article_id in <foreach item="id" collection="idList" open="(" separator="," close=")">#{id}</foreach></script>""")int deleteDetail(List<Integer> idList);//根据id查询内容@Select("""select id,article_id,content from article_detailwhere article_id = #{articleId}""")ArticleDetailPO selectArticleDetailByArticleId(Integer articleId);
}

service包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

ArticleService

package com.hhb.blog.service;import com.hhb.blog.model.dto.ArticleDTO;
import com.hhb.blog.model.po.ArticlePO;import java.util.List;public interface ArticleService {//获取首页文章列表List<ArticlePO> queryTopArticle();//发布文章(article,article_detail)boolean addArticle(ArticleDTO articleDTO);//根据主键查询文章ArticleDTO queryByArticleId(Integer id);//修改文章属性和内容boolean modifyArticle(ArticleDTO articleDTO);//删除文章boolean removeArticle(List<Integer> idList);//查询文章内容前20个字符String queryTop20Content(Integer id);
}

ArticleServiceImpl

package com.hhb.blog.service.impl;import cn.hutool.core.bean.BeanUtil;
import com.hhb.blog.mapper.ArticleMapper;
import com.hhb.blog.model.dto.ArticleDTO;
import com.hhb.blog.model.map.ArticleAndDetailMap;
import com.hhb.blog.model.po.ArticleDetailPO;
import com.hhb.blog.model.po.ArticlePO;
import com.hhb.blog.service.ArticleService;
import com.hhb.blog.settings.ArticleSettings;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;import java.time.LocalDateTime;
import java.util.List;
import java.util.Random;@Service
@RequiredArgsConstructor
public class ArticleServiceImpl implements ArticleService {private final ArticleMapper articleMapper;private final ArticleSettings articleSettings;//构造注入/* public ArticleServiceImpl(ArticleMapper articleMapper) {this.articleMapper = articleMapper;}*/@Overridepublic List<ArticlePO> queryTopArticle() {Integer lowRead = articleSettings.getLowRead();Integer topRead = articleSettings.getTopRead();return articleMapper.topSortByReadCount(lowRead, topRead);}//发布文章@Transactional(rollbackFor = Exception.class)@Overridepublic boolean addArticle(ArticleDTO articleDTO) {//文章ArticlePO articlePO = new ArticlePO();articlePO.setTitle(articleDTO.getTitle());articlePO.setSummary(articleDTO.getSummary());articlePO.setCreateTime(LocalDateTime.now());articlePO.setUpdateTime(LocalDateTime.now());articlePO.setReadCount(new Random().nextInt(1000));articlePO.setUserId(new Random().nextInt(5000));int addArticle = articleMapper.insertArticle(articlePO);//文章内容ArticleDetailPO articleDetailPO = new ArticleDetailPO();articleDetailPO.setArticleId(articlePO.getId());articleDetailPO.setContent(articleDTO.getContent());int addDetail = articleMapper.insertArticleDetail(articleDetailPO);return (addDetail + addArticle) == 2 ? true : false;}@Overridepublic ArticleDTO queryByArticleId(Integer id) {//文章属性,内容ArticleAndDetailMap mapper = articleMapper.selectArticleAndDetail(id);//转为DTO,两种方式/*ArticleDTO articleDTO = new ArticleDTO();articleDTO.setTitle(mapper.getTitle());articleDTO.setContent(mapper.getContent());articleDTO.setSummary(mapper.getSummary());articleDTO.setId(mapper.getId());*/ArticleDTO articleDTO = BeanUtil.copyProperties(mapper, ArticleDTO.class);return articleDTO;}@Transactional(rollbackFor = Exception.class)@Overridepublic boolean modifyArticle(ArticleDTO articleDTO) {//修改文章属性ArticlePO articlePO = new ArticlePO();articlePO.setTitle(articleDTO.getTitle());articlePO.setSummary(articleDTO.getSummary());articlePO.setUpdateTime(LocalDateTime.now());articlePO.setId(articleDTO.getId());int article = articleMapper.updateArticle(articlePO);//修改文章内容ArticleDetailPO articleDetailPO = new ArticleDetailPO();articleDetailPO.setArticleId(articleDTO.getId());articleDetailPO.setContent(articleDTO.getContent());int detail = articleMapper.updateArticleDetail(articleDetailPO);return (article + detail) == 2 ? true : false;}//删除文章属性、内容@Transactional(rollbackFor = Exception.class)@Overridepublic boolean removeArticle(List<Integer> idList) {int article = articleMapper.deleteArticle(idList);int detail = articleMapper.deleteDetail(idList);return article == detail ? true : false;}//查询文章内容前20个字符@Overridepublic String queryTop20Content(Integer id) {ArticleDetailPO articleDetailPO = articleMapper.selectArticleDetailByArticleId(id);String content = "无内容";if( articleDetailPO != null ){content = articleDetailPO.getContent();if(StringUtils.hasText(content)){//content = content.substring(0, content.length() >= 20 ? 20 : content.length() );content = content.substring(0, 20 );}}return content;}
}

controller包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

ArticleController

package com.hhb.blog.controller;import cn.hutool.core.bean.BeanUtil;
import com.hhb.blog.format.IdType;
import com.hhb.blog.handler.exp.IdTypeException;
import com.hhb.blog.model.dto.ArticleDTO;
import com.hhb.blog.model.param.ArticleParam;
import com.hhb.blog.model.po.ArticlePO;
import com.hhb.blog.model.vo.ArticleVO;
import com.hhb.blog.service.ArticleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;import java.util.List;@RequiredArgsConstructor
@Controller
public class ArticleController {private final ArticleService articleService;@GetMapping(value = {"/", "/article/hot"})public String showHotArticle(Model model) {List<ArticlePO> articlePOList = articleService.queryTopArticle();//转为VO  .hutool工具类List<ArticleVO> articleVOList = BeanUtil.copyToList(articlePOList, ArticleVO.class);//添加数据model.addAttribute("articleList", articleVOList);//视图return "/blog/articleList";}//发布新文章@PostMapping("/article/add")//接收对象类型参数public String addArticle(@Validated(ArticleParam.AddArticle.class) ArticleParam param) {ArticleDTO articleDTO = new ArticleDTO();articleDTO.setContent(param.getContent());articleDTO.setSummary(param.getSummary());articleDTO.setTitle(param.getTitle());boolean add = articleService.addArticle(articleDTO);return "redirect:/article/hot";}//查询文章内容@GetMapping("/article/get")public String queryById(Integer id, Model model) {if (id != null && id > 0) {ArticleDTO articleDTO = articleService.queryByArticleId(id);//DTO-VOArticleVO articleVO = BeanUtil.copyProperties(articleDTO, ArticleVO.class);//添加数据model.addAttribute("article", articleVO);//视图return "/blog/editArticle";} else {return "/blog/error/error";}}//更新文章@PostMapping("/article/edit")public String modifyArticle(@Validated(ArticleParam.EditArticle.class) ArticleParam param) {/*ArticleDTO articleDTO = new ArticleDTO();articleDTO.setId(param.getId());articleDTO.setTitle(param.getTitle());articleDTO.setSummary(param.getSummary());articleDTO.setContent(param.getContent());*/ArticleDTO articleDTO = BeanUtil.copyProperties(param, ArticleDTO.class);boolean edit = articleService.modifyArticle(articleDTO);return "redirect:/article/hot";}//删除文章@PostMapping("/article/remove")//public String removeArticle(Integer ids[])public String removeArticle(@RequestParam("ids") IdType idType) {if (idType == null) {throw new IdTypeException("ID为空");}boolean delete = articleService.removeArticle(idType.getIdList());return "redirect:/article/hot";}//预览文章@GetMapping("/article/detail/overview")@ResponseBodypublic String queryDetail(Integer id) {String top20Content = "无ID";if (id != null) {top20Content = articleService.queryTop20Content(id);}return top20Content;}
}

异常处理包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

GlobalExceptionHandler

package com.hhb.blog.handler;import java.util.List;import com.hhb.blog.handler.exp.IdTypeException;
import org.springframework.ui.Model;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;@ControllerAdvice
public class GlobalExceptionHandler {//处理JSR303@ExceptionHandler({BindException.class})public String handlerBindException(BindException bindException, Model model) {BindingResult bindingResult = bindException.getBindingResult();List<FieldError> fieldErrors = bindingResult.getFieldErrors();model.addAttribute("errors", fieldErrors);return "/blog/error/bind";}@ExceptionHandler({IdTypeException.class})public String handleIdTypeException(IdTypeException idTypeException, Model model) {model.addAttribute("msg", idTypeException.getMessage());return "/blog/error/error";}@ExceptionHandler({Exception.class})public String handleDefaultException(Exception e, Model model) {model.addAttribute("msg", "请稍后重试!");return "/blog/error/error";}
}

BlogRootException

package com.hhb.blog.handler.exp;public class BlogRootException extends RuntimeException{public BlogRootException() {}public BlogRootException(String message) {super(message);}
}

IdTypeException

package com.hhb.blog.handler.exp;public class IdTypeException extends BlogRootException {public IdTypeException() {}public IdTypeException(String message) {super(message);}
}

数据格式化包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

IdType

package com.hhb.blog.format;import lombok.Data;import java.util.List;@Data
public class IdType {private List<Integer> idList;
}

IdTypeFormatter

package com.hhb.blog.format;import org.springframework.format.Formatter;
import org.springframework.util.StringUtils;import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;public class IdTypeFormatter implements Formatter<IdType> {@Overridepublic IdType parse(String text, Locale locale) throws ParseException {IdType idType = null;if (StringUtils.hasText(text)) {List<Integer> ids = new ArrayList<>();for (String id : text.split(",")) {ids.add(Integer.parseInt(id));}idType = new IdType();idType.setIdList(ids);}return idType;}@Overridepublic String print(IdType object, Locale locale) {return null;}
}

设置包

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

ArticleSettings

package com.hhb.blog.settings;import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;@Data
@ConfigurationProperties(prefix = "article")
public class ArticleSettings {private Integer lowRead;private Integer topRead;
}

MvcSettings

package com.hhb.blog.settings;import com.hhb.blog.format.IdTypeFormatter;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;@Configuration
public class MvcSettings implements WebMvcConfigurer {@Overridepublic void addViewControllers(ViewControllerRegistry registry) {registry.addViewController("/view/addArticle").setViewName("/blog/addArticle");}@Overridepublic void addFormatters(FormatterRegistry registry) {registry.addFormatter(new IdTypeFormatter());}
}

启动类

package com.hhb.blog;import com.hhb.blog.settings.ArticleSettings;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.transaction.annotation.EnableTransactionManagement;@EnableTransactionManagement
@MapperScan(basePackages = "com.hhb.blog.mapper")
@EnableConfigurationProperties({ArticleSettings.class})
@SpringBootApplication
public class Springboot20BlogAdminApplication {public static void main(String[] args) {SpringApplication.run(Springboot20BlogAdminApplication.class, args);}}

8.4界面展示

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

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

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

相关文章

(数字图像处理MATLAB+Python)第十一章图像描述与分析-第五、六节:边界描述和矩描述

文章目录 一&#xff1a;边界描述&#xff08;1&#xff09;边界链码A&#xff1a;概述B&#xff1a;边界链码改进C&#xff1a;程序 &#xff08;2&#xff09;傅里叶描绘子A&#xff1a;概述B&#xff1a;程序 二&#xff1a;矩描述&#xff08;1&#xff09;矩A&#xff1a;…

SpringBoot-学习笔记(基础)

文章目录 1. 概念1.1 SpringBoot快速入门1.2 SpringBoot和Spring对比1.3 pom文件坐标介绍1.4 引导类1.5 修改配置1.6 读取配置1.6.1 读取配置信息1.6.2 读取配置信息并创建类进行封装 1.7 整合第三方技术1.7.1 整合JUnit1.7.1 整合Mybatis1.7.1 整合Mybatis-Plus1.7.1 整合Drui…

又一关键系统上线,理想车云和自动驾驶系统登陆OceanBase

8 月 1 日&#xff0c;理想汽车公布 7 月交付数据&#xff0c;理想汽车 2023 年 7 月共交付新车 34,134 辆&#xff0c;同比增长 227.5%&#xff0c;并已连续两个月交付量突破三万。至此&#xff0c;理想汽车 2023 年累计交付量已经达到 173,251 辆&#xff0c;远超 2022 年全年…

K8S最新版本集群部署(v1.28) + 容器引擎Docker部署(下)

温故知新 &#x1f4da;第三章 Kubernetes各组件部署&#x1f4d7;安装kubectl&#xff08;可直接跳转到安装kubeadm章节&#xff0c;直接全部安装了&#xff09;&#x1f4d5;下载kubectl安装包&#x1f4d5;执行kubectl安装&#x1f4d5;验证kubectl &#x1f4d7;安装kubead…

FLASH读写数据

目录 嵌入式 Flash大概了解 数据手册2.3.2章节 结构图f407 等待周期 Flash 控制寄存器解锁 编程/擦除并行位数 擦除 编程&#xff08;写入&#xff09; 工程程序 嵌入式 Flash大概了解 可以从flash区域启动程序&#xff1b;大概是程序区可以在flash&#xff0c;所以是可以…

JavaScript实现系统级别的取色器、EyeDropper、try、catch、finally

文章目录 效果图htmlJavaScript关键代码EyeDroppertry...catch颜色值相减(色差)的传送门 效果图 html <div class"d_f fd_c ai_c"><button id"idBtn" class"cursor_pointer">开始取色</button><div id"idBox" c…

PocketMiner:基于深度学习发现蛋白的隐式口袋

文章目录 1. 文章简介2. 前言3. 方法3.1 模型框架 4. 结果4.1 已知隐式口袋在分子动力学模拟分析迅速打开4.2 图神经网络模型能够准确预测模拟中口袋的动态变化4.3 隐式口袋数据集数据集揭示了新的隐式口袋形成的模式4.4 PocketMiner能够从无配体的蛋白结构中精准预测预测口袋4…

TBOX开发需求说明

TBOX功能需求&#xff1a; 支持4G上网功能&#xff0c;可获取外网IP&#xff0c;可和云端平台连通支持路由功能&#xff0c;支持计算平台、网关和云端平台建立网络连接支持USB转网口&#xff0c;智能座舱会通过USB连接AG35建立网络连接&#xff08;类似IVI通过USB口连接TBOX&a…

linux中dmesg命令用法

在Linux系统中&#xff0c;dmesg&#xff08;diagnostic message&#xff09;是一个非常有用的命令行工具&#xff0c;用于显示和控制内核环形缓冲区中的消息。这些消息通常包含系统启动时的内核生成的信息&#xff0c;例如硬件设备的状态&#xff0c;驱动程序的加载&#xff0…

浅析Linux SCSI子系统:错误恢复

文章目录 概述SCSI错误恢复处理添加错误恢复命令错误恢复线程scsi_eh_ready_devs IO超时处理相关参考 概述 IO路径是一个漫长的过程&#xff0c;从SCSI命令请求下发到请求完成返回&#xff0c;中间的任何一个环节出现问题都会导致IO请求的失败。从SCSI子系统到低层驱动&#x…

【云原生】Ansible自动化批量操作工具playbook剧本

目录 1.playbook相关知识 1.1 playbook 的简介 1.2 playbook的 各部分组成 2. 基础的playbook剧本编写实例 2.1 playbook编写Apache安装剧本&#xff08;yum方式安装&#xff09; 报错集&#xff1a; 实例2&#xff1a;playbook编写nginx 的yum安装并且能修改其监听端口的…

认识JVM的内存模型

从上一节了解到整个JVM大的内存区域&#xff0c;分为线程共享的heap&#xff08;堆&#xff09;&#xff0c;MethodArea&#xff08;方法区&#xff09;&#xff0c;和线程独享的 The pc Register&#xff08;程序计数器&#xff09;、Java Virtual Machine Stacks&#xff08;…

MVC,MVP,MVVM的理解和区别

MVC MVC &#xff0c;早期的开发架构&#xff0c;在安卓里&#xff0c;用res代表V&#xff0c;activity代表Controller层&#xff0c;Model层完成数据请求&#xff0c;更新操作&#xff0c;activity完成view的绑定&#xff0c;以及业务逻辑的编写&#xff0c;更新view&#xf…

Jenkins java8安装版本安装

一、首先准备Jenkins、Jdk8、Tomcat9安装包 根据Jenkins官网介绍&#xff0c;Jenkins支持Java8的版本如下&#xff1a; 我们选择2.164版本进行安装&#xff0c;根据版本号支持输入下载地址&#xff1a;https://archives.jenkins.io/war/2.164/jenkins.war&#xff0c;进行下载…

Mybatis 插入、修改、删除

前面几篇我们介绍了使用Mybatis查询数据&#xff0c;并且也了解了如何在Mybatis中使用JDK的日志系统打印日志&#xff1b;本篇我们继续介绍如何使用Mybatis完成数据的插入、修改和删除。 如果您对查询数据和Mybatis集成JDK日志系统不太了解&#xff0c;建议您先进行了解后再阅…

【Vue CLI】

node.js安装 https://nodejs.org/download/release/v15.14.0/ 管理员运行cmd node -v 安装npm npm install -g cnpm --registryhttps://registry.npm.taobao.org 查看是否安装成功 npm -v 注册淘宝镜像加速器 npm config set registry https://registry.npm.taobao.org/ 查看…

Vue2项目练手——通用后台管理项目第二节

Vue2项目练手——通用后台管理项目 路由限制重复跳转CommonAside.vue 顶部header组件搭建与样式修改右边用户菜单栏使用的组件图片CommonHeader.vue Vuex实现左侧折叠文件目录store/index.jsstore/tab.jsmain.jsCommonHeader.vueCommonAside.vueMain.vue 路由限制重复跳转 路由…

Qt使用Json

包含目录&#xff1a; #include <QJsonObject> #include <QJsonDocument> #include <QByteArray> #include <QFile> #include <QJsonArray>基本结构&#xff1a; 写json QJsonObject studentobj;QJsonArray arrarydata;QJsonObject subdata;…

50ETF期权开户平台(0门槛期权开户指南)

50ETF期权开户平台比较好的有&#xff1a;期权馆&#xff0c;期权科普馆&#xff0c;小熊期权&#xff0c;期权酱&#xff0c;财顺财经&#xff0c;财顺期权等&#xff0c;都是国内前十的期权分仓平台&#xff0c;下文为大家结算50ETF期权开户平台&#xff08;0门槛期权开户指南…

HTTP介绍:一文了解什么是HTTP

前言&#xff1a; 在当今数字时代&#xff0c;互联网已经成为人们生活中不可或缺的一部分。无论是浏览网页、发送电子邮件还是在线购物&#xff0c;我们都离不开超文本传输协议&#xff08;HTTP&#xff09;。HTTP作为一种通信协议&#xff0c;扮演着连接客户端和服务器的重要角…