当前位置: 首页 > news >正文

iis网站伪静态网站/推广找客户平台

iis网站伪静态网站,推广找客户平台,怎样在百度上注册自己的公司,免费奖励代码网站八、博客管理系统 创建新的SpringBoot项目,综合运用以上知识点,做一个文章管理的后台应用。依赖: Spring WebLombokThymeleafMyBatis FrameworkMySQL DriverBean Validationhutool 需求:文章管理工作,发布新文章&…

八、博客管理系统

  • 创建新的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界面展示

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

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

相关文章:

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

八、博客管理系统 创建新的SpringBoot项目&#xff0c;综合运用以上知识点&#xff0c;做一个文章管理的后台应用。依赖&#xff1a; Spring WebLombokThymeleafMyBatis FrameworkMySQL DriverBean Validationhutool 需求&#xff1a;文章管理工作&#xff0c;发布新文章&…...

C语言——指针基本语法

概述 内存地址 在计算机内存中&#xff0c;每个存储单元都有一个唯一的地址(内存编号)。 通俗理解&#xff0c;内存就是房间&#xff0c;地址就是门牌号 指针和指针变量 指针&#xff08;Pointer&#xff09;是一种特殊的变量类型&#xff0c;它用于存储内存地址。 指针的实…...

elementui table 在浏览器分辨率变化的时候界面异常

异常点&#xff1a; 界面显示不完整&#xff0c;表格卡顿&#xff0c;界面已经刷新完成&#xff0c;但是表格的宽度还在一点一点变化&#xff0c;甚至有无线延伸的情况 思路&#xff1a; 1. 使用doLayout 这里官方文档有说明&#xff0c; 所以我的想法是&#xff0c;监听浏览…...

六、Kafka-Eagle监控

目录 6.1 MySQL 环境准备6.2 Kafka 环境准备6.3 Kafka-Eagle 安装 6.1 MySQL 环境准备 Kafka-Eagle 的安装依赖于 MySQL&#xff0c;MySQL 主要用来存储可视化展示的数据 6.2 Kafka 环境准备 修改/opt/module/kafka/bin/kafka-server-start.sh 命令 vim bin/kafka-server-sta…...

DBeaver 23.1.5 发布

导读DBeaver 是一个免费开源的通用数据库工具&#xff0c;适用于开发人员和数据库管理员。DBeaver 23.1.5 现已发布&#xff0c;更新内容如下. Data editor 重新设计了词典查看器面板 UI 空间数据类型&#xff1a;曲线几何线性化已修复 数据保存时结果选项卡关闭的问题已解决…...

三种垃圾收集算法,优缺点分析,设计垃圾收集

文章目录 垃圾收集算法标记-清除&#xff08;基础收集算法&#xff09;标记-复制&#xff08;新生代&#xff09;标记-整理&#xff08;老年代&#xff09; 垃圾收集算法 标记-清除&#xff08;基础收集算法&#xff09; 首先标记出所有需要回收的对象&#xff0c;在标记完成后…...

【链表OJ 10】环形链表Ⅱ(求入环节点)

前言: &#x1f4a5;&#x1f388;个人主页:​​​​​​Dream_Chaser&#xff5e; &#x1f388;&#x1f4a5; ✨✨刷题专栏:http://t.csdn.cn/UlvTc ⛳⛳本篇内容:力扣上链表OJ题目 目录 leetcode142. 环形链表 II 1.问题描述 2.代码思路 3.问题分析 leetcode142. 环形链…...

RT-Thread在STM32硬件I2C的踩坑记录

RT-Thread在STM32硬件I2C的踩坑记录 0.前言一、软硬件I2C区别二、RT Thread中的I2C驱动三、尝试适配硬件I2C四、i2c-bit-ops操作函数替换五、Attention Please!六、总结 参考文章&#xff1a; 1.将硬件I2C巧妙地将“嫁接”到RTT原生的模拟I2C驱动框架 2.基于STM32F4平台的硬件I…...

小白学Go基础01-Go 语言的介绍

Go 语言对传统的面向对象开发进行了重新思考&#xff0c;并且提供了更高效的复用代码的手段。Go 语言还让用户能更高效地利用昂贵服务器上的所有核心&#xff0c;而且它编译大型项目的速度也很快。 用 Go 解决现代编程难题 Go 语言开发团队花了很长时间来解决当今软件开发人员…...

Spring工具类--Assert的使用

原文网址&#xff1a;Spring工具类--Assert的使用_IT利刃出鞘的博客-CSDN博客 简介 说明 本文介绍Spring的Assert工具类的用法。 Assert工具类的作用&#xff1a;判断某个字段&#xff0c;比如&#xff1a;断定它不是null&#xff0c;如果是null&#xff0c;则此工具类会报…...

无涯教程-Android - Absolute Layout函数

Absolute Layout 可让您指定其子级的确切位置(x/y坐标)&#xff0c;绝对布局的灵活性较差且难以维护。 Absolute Layout - 属性 以下是AbsoluteLayout特有的重要属性- Sr.NoAttribute & 描述1 android:id 这是唯一标识布局的ID。 2 android:layout_x 这指定视图的x坐标…...

2018ECCV Can 3D Pose be Learned from2D Projections Alone?

摘要 在计算机视觉中&#xff0c;从单个图像的三维姿态估计是一个具有挑战性的任务。我们提出了一种弱监督的方法来估计3D姿态点&#xff0c;仅给出2D姿态地标。我们的方法不需要2D和3D点之间的对应关系来建立明确的3D先验。我们利用一个对抗性的框架&#xff0c;强加在3D结构…...

干旱演变研究:定义及研究方法

在水文系统中,每个组分之间互相关联,包气带水、地下水和河川径流相互响应,水文循环处于动态平衡的状态。 降水作为水文系统的输入量,对水文循环具有重要的影响。降水短缺通过水文循环导致水文系统不同组分(包气带、地下水和地表水)发生干旱,降水不足导致土壤含水量减少,…...

【LeetCode-中等题】114. 二叉树展开为链表

文章目录 题目方法一&#xff1a;前序遍历&#xff08;构造集合&#xff09; 集合&#xff08;构造新树&#xff09;方法二&#xff1a;原地构建方法三&#xff1a;前序遍历--迭代&#xff08;构造集合&#xff09; 集合&#xff08;构造新树&#xff09; 题目 方法一&#x…...

【题解】JZOJ6645 / 洛谷P4090 [USACO17DEC] Greedy Gift Takers P

洛谷 P4090 [USACO17DEC] Greedy Gift Takers P 题意 n n n 头牛排成一列&#xff0c;队头的奶牛 i i i 拿一个礼物并插到从后往前数 c i c_i ci​ 头牛的前面&#xff0c;重复无限次&#xff0c;问多少奶牛没有礼物。 题解 发现若一头牛无法获得礼物&#xff0c;那么它后…...

Vue 项目中的错误如何处理的?

1、 组件中的处理&#xff1a;使用 errorCaptured 钩子 作用&#xff1a;可以捕获来自后代组件的错误 父组件(errorCaptured) -> 子组件 (errorCaptured) -> 当孙子组件出错时&#xff0c;错误会一直向上抛&#xff0c;也就是先触发子组件的 errorCaptured&#xff0c;…...

网络分层的真实含义

复杂的程序都要分层&#xff0c;这是程序设计的要求。比如&#xff0c;复杂的电商还会分数据库层、缓存层、Compose 层、Controller 层和接入层&#xff0c;每一层专注做本层的事情。 当一个网络包从一个网口经过的时候&#xff0c;你看到了&#xff0c;首先先看看要不要请进来…...

RT-Thread 线程间同步

线程间同步 在多线程实时系统中&#xff0c;一项工作的完成往往可以通过多个线程协调的方式共同来完成&#xff0c;那么多个线程之间如何 “默契” 协作才能使这项工作无差错执行&#xff1f;下面举个例子说明。 例如一项工作中的两个线程&#xff1a;一个线程从传感器中接收…...

Python元类再解释

Python元类再解释 元类是什么&#xff1f; 你可以把元类看作是“生产类的工厂”。就像类是用来生产对象的&#xff0c;元类是用来生产类的。 为什么需要元类&#xff1f; 考虑一个场景&#xff1a;假设你正在编写一个框架&#xff0c;你希望框架中的所有类都有某些特定的方…...

常用的Spring Boot 注解及示例代码

简介&#xff1a;Spring Boot 是一个用于快速构建基于 Spring 框架的应用程序的工具&#xff0c;通过提供一系列的注解&#xff0c;它使得开发者可以更加轻松地配置、管理和控制应用程序的各种行为。以下是一些常用的 Spring Boot 注解&#xff0c;以及它们的功能和示例代码&am…...

react app教程

react app教程 环境准备 下载node 下载npx npm install npx创建app npx create-react-app automedia cd automedia npm start构建发布版本 npm run build安装调试工具 # .vscode/launch.json {// 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。// 欲了…...

在vue项目中用vue-watermark快捷开发屏幕水印效果

我们先引入一个第三方依赖 npm install vue-watermark然后 因为这只是个测试工具 我就直接代码写 App.vue里啦 参考代码如下 <template><div><vue-watermark :text"watermarkText"></vue-watermark><!-- 正常的页面内容 --></div…...

无涯教程-Android - Activity

Activity代表具有用户界面的单个屏幕&#xff0c;就像Java的窗口或框架一样。Android Activity 是ContextThemeWrapper类的子类。 如果您使用过C&#xff0c;C或Java编程语言&#xff0c;那么您一定已经看到您的程序从 main()函数开始。与之非常相似&#xff0c;Android系统以 …...

vue项目前端展示数学公式(在表格中渲染)

现有需求为 将实验数据录入表格中,需要表格呈现物理公式,使用Mathjax在vue2中 进行呈现 1.安装 npm i --save mathjax-vue 2.全局注册(main.js中) import MathJax, { initMathJax, renderByMathjax } from mathjax-vuefunction onMathJaxReady() {const el document.getEl…...

java八股文面试[数据库]——MySQL索引的数据结构

知识点&#xff1a; 【2023年面试】mysql索引的基本原理_哔哩哔哩_bilibili 【2023年面试】mysql索引结构有哪些&#xff0c;各自的优劣是什么_哔哩哔哩_bilibili...

python3.11教程2:基础数据类型(数字和字符串)、组合数据类型(集合、元组、列表、字典)

文章目录 五、基本数据类型5.1 整数和浮点数5.1.1 整数和浮点数的类型5.1.2 进制和进制转换5.1.3 round函数 5.2 运算符5.2.1 常用运算符、运算符函数和逻辑运算符5.2.2 位运算符5.2.3 运算符的优先级及其进阶使用 5.3 布尔类型5.4 字符串5.3.1 字符串的基本操作5.3.2 字符串函…...

剑指 Offer 44. 数字序列中某一位的数字(中等)

题目&#xff1a; class Solution { //本题单纯找规律&#xff0c;要注意通过n%digits来判断有几个位数为digits的数 public:int findNthDigit(int n) {long base 9, digits 1; //digits代表位数while(n-base*digits>0){ //该循环是为了确定目标数字所在…...

SpringBoot中HttpClient的学习

一、介绍 HttpClient是Apache Jakarta Common 下的子项目&#xff0c;可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包。 HttpClient 是一个HTTP通信库、一个工具包&#xff0c;它只提供一个通用浏览器应用程序所期望的功能子集&#xff0c;与浏览…...

JVM-内存溢出的原因、CPU占满的原因

1.内存溢出的原因 OOM的排查思路_oom排查_java排坑日记的博客-CSDN博客 每个进程的内存&#xff08;限制&#xff0c;譬如2G&#xff09;最大堆容量最大方法区容量程序计数器虚拟机栈和本地方法栈。多线程下每个线程栈越大&#xff0c;越容易OOM. 1.堆内存溢出&#xff08;OO…...

如何做好银行统一报送系统UI设计

北京蓝蓝设计公司是一支由清华美院毕业的专业团队组成的设计公司。我们的设计师们在金融银行软件领域拥有12年的工作经验和丰富的行业知识。 在工作中我们常常思考银行金融反洗钱软件用户使用痛点是什么&#xff1f;我们发现用户的使用痛点往往是&#xff1a; 1功能入口不清晰…...