开发前期准备工作
开发前期准备工作
文章目录
- 开发前期准备工作
- 0 代码规范
- 0.1 强制
- 0.2 推荐
- 0.3 参考
- `dao`:跟数据库打交道
- `service`:业务层,人类思维解决
- `controller`:抽象化
- 0.4 注释规范
- 0.5 日志规范
- 0.6 专有名词
- 0.7 控制层
- 统一异常
- 统一结构体
- 控制层
- 提示信息
- 0.8 控制语句
- 1 `idea`配置
- 2 `swagger`配置,`knife4j`
- 3 `jrebel`配置
- 4 常用账号汇总
- 5 集成单元测试
- 6 新建个人项目
- 7 断言
0 代码规范
0.1 强制
避免在子父类的成员变量之间、或者不同代码块的局部变量之间采用完全相同的命名,使可理解性降低。
0.2 推荐
好的命名、代码结构是自解释的,注释力求精简准确、表达到位
0.3 参考
dao
:跟数据库打交道
[增加]
insert
:插入
batchInsert
:批量插入
insertSelective
:条件插入
insertUseGeneratedKeys
:
[删除]
delete
:删除
delete*ById
:根据主键删除
[修改]
update
:更新
update*ById
:根据主键更新
[查询]
service
:业务层,人类思维解决
add
:添加
find*ById
:根据主键查询
find*By**
:根据条件查询
find*ByList
:多条件查询
modify
:修改
modify*ById
:根据主键修改
remove
:删除
remove*ById
:根据主键删除
controller
:抽象化
insert
:插入
batchInsert
:批量插入
queryOne
:查询单个
queryById
:根据主键查询
queryByList
:多条件查询
count
:计数
update
:更新
update*ById
:根据主键更新
delete
:删除
delete*ById
:根据主键删除
0.4 注释规范
1 方法内部单行注释,在被注释语句上方另起一行,使用//注释。方法内部多行注释使用/* */注释,注意与代码对齐
2 所有的类都必须添加创建者和创建日期,而日期的设置统一为 yyyy/MM/dd
的格式
/*** @author pingmingbo* @date 2022/11/11*/
3 代码修改的同时,注释也要进行相应的修改,尤其是参数、返回值、异常、核心逻辑等的修改
4 好的命名、代码结构是自解释的,注释力求精简准确、表达到位
5 特殊注释标记,请注明标记人与标记时间。注意及时处理这些标记,通过标记扫描,经常清理此类标记
// TODO pingmingbo 20221112 20221211
0.5 日志规范
1【强制】在日志输出时,字符串变量之间的拼接使用占位符的方式。
说明:因为 String
字符串的拼接会使用 StringBuilder
的 append
()方式,有一定的性能损耗。使用占位符仅是替换动作,可以有效提升性能。
正例:logger.debug("Processing trade with id: {} and symbol: {}", id, symbol);
2 敏感信息不能记录在日志里面,比如用户名和密码
3 日志打印禁止直接使用JSON
工具将对象转换String
4 使用warn
级别日志记录用户输入参数错误情况,避免用户投诉时候,无所适从;注意日志输出级别,
error
级别只记录系统逻辑错误、异常等重要错误信息,如非必要,请不要在此场景打出error
级别日志
5 日志输出时候,字符串之间的拼接使用占位符方式
logger.info("traceId:[{}],and symbol:[{}]",id,symbol);
说明:因为String字符串的拼接会使用StringBuilder的append方式,有一定的性能损耗,使用占位符只是替换动作,可以有效提升性能
6 如果循环体次数过多,避免打印不必要的日志
7 打印日志的时机
- 当遇到问题,只能通过
debug
定位 - 碰到
if else
或者Switch
分支语句,需要在各自分支首行打印日志,确定进入哪个分支 - 经常以功能为核心进行开发,提交代码之前,可以确定通过日志看到整个流程
8 日志占位符基本格式,通过[]进行参数变量隔离
logger.info("traceId:[{}],and symbol:[{}]",id,symbol);
9 线上禁止使用System.out,System.err
10 谨慎使用e.printStackTrace(),
否则出现锁死,服务挂掉问题
短时间大量请求访问该接口,代码异常,进入catch,打印e.printStackTrace()异常信息到控制台,
这些错误堆栈字符串存储字符串缓存池内存空间,该内存空间一下子撑爆了,其他线程进行相互等待,
堆积一定程度,整个应用就挂掉了。
11 异常日志打印规范
logger.error("异常信息 ",e);
/*** 处理异常几种方式*/@Testpublic void testHandleCatch() {int num = 0;try {num = 3 / 0;logger.info("num : [{}]", num);} catch (Exception e) {logger.error("异常信息 ",e);}}
0.6 专有名词
DO
:数据库表对应的pojo
实体类,字段一一对应,通过DAO
向上传输
DTO
:数据传输对象,service
或者manager
向外传输
BO
:业务对象,service
层
Query
:数据查询对象,各层接收上层查询请求,注意超过两个参数进行封装,禁止使用map
传递
VO
:通常是web
层向模板引擎传输对象
0.7 控制层
统一异常
package com.geekmice.springbootselfexercise.exception;/*** @BelongsProject: spring-boot-self-exercise* @BelongsPackage: com.geekmice.springbootselfexercise.exception* @Author: pingmingbo* @CreateTime: 2023-08-10 23:07* @Description: 自定义异常* @Version: 1.0*/
public class BusinessException extends RuntimeException {private String message;public BusinessException(String message) {super(message);}
}
package com.geekmice.springbootselfexercise.exception;import com.geekmice.springbootselfexercise.utils.AjaxResult;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.validation.BindException;
import org.springframework.validation.ObjectError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import java.util.List;
import java.util.Set;/*** @BelongsProject: spring-boot-self-exercise* @BelongsPackage: com.geekmice.springbootselfexercise* @Author: pingmingbo* @CreateTime: 2023-08-10 22:34* @Description: 统一异常处理* @Version: 1.0*/
@RestControllerAdvice(annotations = {Validated.class})
public class CommonExceptionHandler {/*** 用于捕获@RequestBody类型参数触发校验规则抛出的异常** @param e* @return*/@ExceptionHandler(value = MethodArgumentNotValidException.class)public AjaxResult handleValidException(MethodArgumentNotValidException e) {StringBuilder sb = new StringBuilder();List<ObjectError> allErrors = e.getBindingResult().getAllErrors();if (!CollectionUtils.isEmpty(allErrors)) {for (ObjectError error : allErrors) {sb.append(error.getDefaultMessage()).append(";");}}return AjaxResult.error(sb.toString());}/*** 用于捕获@RequestParam/@PathVariable参数触发校验规则抛出的异常** @param e* @return*/@ExceptionHandler(value = ConstraintViolationException.class)public AjaxResult handleConstraintViolationException(ConstraintViolationException e) {StringBuilder sb = new StringBuilder();Set<ConstraintViolation<?>> conSet = e.getConstraintViolations();for (ConstraintViolation<?> con : conSet) {String message = con.getMessage();sb.append(message).append(";");}return AjaxResult.error(sb.toString());}@ExceptionHandler(value = BindException.class)public AjaxResult handleConstraintViolationException(BindException e) {StringBuilder sb = new StringBuilder();List<ObjectError> allErrors = e.getAllErrors();for (ObjectError allError : allErrors) {String defaultMessage = allError.getDefaultMessage();sb.append(defaultMessage).append(";");}return AjaxResult.error(sb.toString());}@ExceptionHandler(value = Exception.class)public AjaxResult exception(Exception e) {return AjaxResult.error(e.getMessage());}/*** 自定义业务异常** @param e* @return*/@ExceptionHandler(value = BusinessException.class)public AjaxResult exception(BusinessException e) {return AjaxResult.error(e.getMessage());}
}
统一结构体
package com.geekmice.springbootselfexercise.utils;/*** @BelongsProject: spring-boot-scaffold* @BelongsPackage: com.geekmice.sbparamsvalidated.util* @Author: pingmingbo* @CreateTime: 2023-04-19 11:34* @Description: 自定义统一返回结果* @Version: 1.0*/import org.apache.commons.lang3.ObjectUtils;
import org.springframework.http.HttpStatus;import java.util.HashMap;/*** 操作消息提醒** @author ruoyi*/
public class AjaxResult extends HashMap<String, Object> {private static final long serialVersionUID = 1L;/*** 状态码*/public static final String CODE_TAG = "code";/*** 返回内容*/public static final String MSG_TAG = "msg";/*** 数据对象*/public static final String DATA_TAG = "data";/*** 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。*/public AjaxResult() {}/*** 初始化一个新创建的 AjaxResult 对象** @param code 状态码* @param msg 返回内容*/public AjaxResult(int code, String msg) {super.put(CODE_TAG, code);super.put(MSG_TAG, msg);}/*** 初始化一个新创建的 AjaxResult 对象** @param code 状态码* @param msg 返回内容* @param data 数据对象*/public AjaxResult(int code, String msg, Object data) {super.put(CODE_TAG, code);super.put(MSG_TAG, msg);if (ObjectUtils.isNotEmpty(data)) {super.put(DATA_TAG, data);}}/*** 返回成功消息** @return 成功消息*/public static AjaxResult success() {return AjaxResult.success("操作成功");}/*** 返回成功数据** @return 成功消息*/public static AjaxResult success(Object data) {return AjaxResult.success("操作成功", data);}/*** 返回成功消息** @param msg 返回内容* @return 成功消息*/public static AjaxResult success(String msg) {return AjaxResult.success(msg, null);}/*** 返回成功消息** @param msg 返回内容* @param data 数据对象* @return 成功消息*/public static AjaxResult success(String msg, Object data) {return new AjaxResult(HttpStatus.OK.value(), msg, data);}/*** 返回错误消息** @return*/public static AjaxResult error() {return AjaxResult.error("操作失败");}/*** 返回错误消息** @param msg 返回内容* @return 警告消息*/public static AjaxResult error(String msg) {return AjaxResult.error(msg, null);}/*** 返回错误消息** @param msg 返回内容* @param data 数据对象* @return 警告消息*/public static AjaxResult error(String msg, Object data) {return new AjaxResult(HttpStatus.INTERNAL_SERVER_ERROR.value(), msg, data);}/*** 返回错误消息** @param code 状态码* @param msg 返回内容* @return 警告消息*/public static AjaxResult error(int code, String msg) {return new AjaxResult(code, msg, null);}/*** 方便链式调用** @param key 键* @param value 值* @return 数据对象*/@Overridepublic AjaxResult put(String key, Object value) {super.put(key, value);return this;}
}
控制层
package com.geekmice.springbootselfexercise.controller;import com.geekmice.springbootselfexercise.annotation.MethodExporter;
import com.geekmice.springbootselfexercise.utils.AjaxResult;
import com.geekmice.springbootselfexercise.vo.ParamVO;
import com.geekmice.springbootselfexercise.vo.UserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;import javax.validation.Valid;/*** @BelongsProject: spring-boot-self-exercise* @BelongsPackage: com.geekmice.springbootselfexercise.controller* @Author: pingmingbo* @CreateTime: 2023-08-10 22:29* @Description: TODO* @Version: 1.0*/
@RestController
@RequestMapping(value = "param")
@Slf4j
@Validated
public class ParamController {@GetMapping(value = "getMethod")public AjaxResult getMethod(@Valid ParamVO paramVO) {return AjaxResult.success();}@PostMapping(value = "postMethod")public AjaxResult postMethod(@Valid @RequestBody ParamVO paramVO) {return AjaxResult.success();}
}
package com.geekmice.springbootselfexercise.vo;import lombok.Data;import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;/*** @BelongsProject: spring-boot-self-exercise* @BelongsPackage: com.geekmice.springbootselfexercise.vo* @Author: pingmingbo* @CreateTime: 2023-08-10 22:28* @Description: 入参VO* @Version: 1.0*/
@Data
public class ParamVO {/*** 用户名*/@NotBlank(message = "用户名不能为空")private String userName;/*** 生日*/@NotNull(message = "生日不为空")private Date birthday;/*** 性别*/@NotBlank(message = "性别不为空")private String sex;/*** 地址*/private String address;/*** 分数*/private Integer score;}
提示信息
{
“msg”: “生日不为空;性别不为空;用户名不能为空;”,
“code”: 500
}
0.8 控制语句
1 在一个 switch 块内,每个 case 要么通过 continue/break/return 等来终止,要么注释说明程序将继续执行到哪一个 case 为止;在一个 switch 块内,都必须包含一个 default语句并且放在最后,即使它什么代码也没有。
说明:注意 break 是退出 switch 语句块,而 return 是退出方法体。
switch(str){case str1:// 业务代码break;case str2:// 业务代码breakdefault:break;
}
2 三目运算符 condition? 表达式 1 : 表达式 2
中,高度注意表达式 1 和 2 在类型对齐时,可能抛出因自动拆箱导致的 NPE 异常
说明:以下两种场景会触发类型对齐的拆箱操作:
1) 表达式 1 或表达式 2 的值只要有一个是原始类型。
2) 表达式 1 或表达式 2 的值的类型不一致,会强制拆箱升级成表示范围更大的那个类型
3 当某个方法的代码总行数超过 10 行时,return / throw 等中断逻辑的右大括号后均需要加一个空行。
说明:这样做逻辑清晰,有利于代码阅读时重点关注。
4 除常用方法(如 getXxx/isXxx)等外,不要在条件判断中执行其它复杂的语句,将复杂逻辑判断的结果赋值给一个有意义的布尔变量名,以提高可读性。
说明:很多 if 语句内的逻辑表达式相当复杂,与、或、取反混合运算,甚至各种方法纵深调用,理解成本非常高。如果赋值一个非常好理解的布尔变量名字,则是件令人爽心悦目的事情。
5 循环体中的语句要考量性能,以下操作尽量移至循环体外处理,如定义对象、变量、获取数据库连接,进行不必要的 try-catch 操作(这个 try-catch 是否可以移至循环体外)
6 避免采用取反逻辑运算符
1 idea
配置
博客地址
2 swagger
配置,knife4j
<dependency><groupId>com.github.xiaoymin</groupId><artifactId>knife4j-spring-boot-starter</artifactId><version>2.0.7</version>
</dependency>
<!--接口平台-->
<dependency><groupId>io.springfox</groupId><artifactId>springfox-boot-starter</artifactId><version>3.0.0</version>
</dependency>
配置类
package com.geekmice.springbootselfexercise.config;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;/*** @BelongsProject: spring-boot-scaffold* @BelongsPackage: com.geekmice.sbhelloworld.com.geekmice.sbpagehelper.config* @Author: pingmingbo* @CreateTime: 2023-07-30 15:45* @Description: TODO* @Version: 1.0*/
@Configuration
public class Knife4jConfig {@Bean(value = "defaultApi2")public Docket customDocket() {return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.basePackage("com.geekmice.springbootselfexercise.controller")).build();}/*** 构建 api文档的详细信息函数* @return*/private ApiInfo apiInfo() {return new ApiInfoBuilder().title("现货交易").version("1.0.0").description("现货交易详情").contact(new Contact("geekmice","http://geekmice.cn","2437690868@qq.com")).build();}
}
控制层
package com.geekmice.springbootselfexercise.controller;import com.geekmice.springbootselfexercise.injector.EasySqlInjector;
import com.geekmice.springbootselfexercise.utils.AjaxResult;
import com.geekmice.springbootselfexercise.utils.SpringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;/*** @BelongsProject: spring-boot-self-exercise* @BelongsPackage: com.geekmice.springbootselfexercise.controller* @Author: pingmingbo* @CreateTime: 2023-08-09 21:52* @Description: bean操作* @Version: 1.0*/
@RestController
@RequestMapping(value = "bean")
@Api(tags = "3.获取bean操作")
@Slf4j
public class BeanController {@GetMapping(value = "getBean")@ApiOperation(value = "获取bean")public AjaxResult getBean() {// 根据class获取beanEasySqlInjector bean = SpringUtil.getBean(EasySqlInjector.class);// 根据name获取beanEasySqlInjector easySqlInjector = (EasySqlInjector)SpringUtil.getBean("easySqlInjector");// 根据name和class获取beanEasySqlInjector easySqlInjectorSecond = SpringUtil.getBean("easySqlInjector", EasySqlInjector.class);log.info("easySqlInjectorSecond : [{}]" , easySqlInjectorSecond);log.info("easySqlInjector : [{}]", easySqlInjector);log.info("bean : [{}]", bean);return AjaxResult.success();}
}
3 jrebel
配置
4 常用账号汇总
git账号
系统用户账号
开发环境 MySQL
5 集成单元测试
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope><exclusions><exclusion><groupId>org.junit.vintage</groupId><artifactId>junit-vintage-engine</artifactId></exclusion></exclusions>
</dependency>
<dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version><scope>test</scope>
</dependency>
与事务相关的测试类
package com.geekmice.springbootselfexercise;import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.geekmice.springbootselfexercise.config.DataSourceProperties;
import com.geekmice.springbootselfexercise.dao.UserDao;
import com.geekmice.springbootselfexercise.domain.UserDomain;
import com.geekmice.springbootselfexercise.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.Environment;
import org.springframework.test.context.junit4.SpringRunner;import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;/*** @description 测试类,需要调用dao*/
@Slf4j
@SpringBootTest(classes = SpringBootSelfExerciseApplication.class)
@RunWith(SpringRunner.class)
class DaoTest {private String port;private static String newPort;@Value("${server.port}")public void setPort(String port){newPort=port;}@Autowiredprivate DataSourceProperties dataSourceProperties;@Autowiredprivate Environment environment;@Resourceprivate UserService userService;@Resourceprivate UserDao userDao;@Testvoid contextLoads() {// log.info("端口号:【{}】",port);String username = dataSourceProperties.getUsername();String password = dataSourceProperties.getPassword();String url = dataSourceProperties.getUrl();String driverClassName = dataSourceProperties.getDriverClassName();log.info("用户名:【{}】",username);log.info("密码:【{}】",password);log.info("地址URL:【{}】",url);log.info("驱动类:【{}】",driverClassName);}}
与事务无关的测试类
package com.geekmice.springbootselfexercise;import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.geekmice.springbootselfexercise.domain.TempData;
import com.geekmice.springbootselfexercise.domain.UserDomain;
import com.geekmice.springbootselfexercise.utils.BigDecimalUtil;
import com.geekmice.springbootselfexercise.utils.DateUtil;
import com.geekmice.springbootselfexercise.utils.FileUtil;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.Environment;
import org.springframework.util.Assert;import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;/*** @BelongsProject: spring-boot-self-exercise* @BelongsPackage: com.geekmice.springbootselfexercise* @Author: pingmingbo* @CreateTime: 2023-08-06 09:27* @Description: 无事务* @Version: 1.0*/
@Slf4j
@SpringBootTest
public class NoDaoTest {/*** 解决map修改key问题*/@Testpublic void testSetMapKey() {log.info("需求:k1变为k2,value不变");Map<String, Object> map = new HashMap<>();map.put("k1", "v1");log.info("修改前");for (Map.Entry<String, Object> entry : map.entrySet()) {log.info("key:【{}】,value:【{}】", entry.getKey(), entry.getValue());}String pendingItem = map.get("k1").toString();map.remove("k1");map.put("k2", pendingItem);log.info("修改后");for (Map.Entry<String, Object> entry : map.entrySet()) {log.info("key:【{}】,value:【{}】", entry.getKey(), entry.getValue());}}}
6 新建个人项目
工具类,配置类,切面,过滤器,监听器,常量,统一异常,统一结构体,文件解析类,自定义注解,反射
7 断言
处理抛异常情况,简单场景可以使用
逻辑复杂使用iflese,throw抛异常
// 对象
Assert.notNull(null, "对象不为空");
Assert.isNull(new Object(), "对象为空");// 集合
Assert.notEmpty((Map)null, "集合不为空");
Assert.isTrue(CollectionUtils.isEmpty(testBuildData()), "集合必须空");// 字符串包含
Assert.isTrue(StringUtils.contains("abc", "e"), "不能包含");
Assert.isTrue(!StringUtils.contains("abc", "a"), "必须包含");// 表达式
Assert.isTrue(1>2, "条件表达式为false");
相关文章:
![](https://img-blog.csdnimg.cn/212aa4e18fbb42e09b1e64848e892753.png)
开发前期准备工作
开发前期准备工作 文章目录 开发前期准备工作0 代码规范0.1 强制0.2 推荐0.3 参考dao:跟数据库打交道service:业务层,人类思维解决controller:抽象化 0.4 注释规范0.5 日志规范0.6 专有名词0.7 控制层统一异常统一结构体控制层提示…...
![](https://www.ngui.cc/images/no-images.jpg)
k8s deployment服务回滚,设置节点为不可调度
服务回滚 通过滚动升级的策略可以平滑的升级Deployment,若升级出现问题,需要最快且最好的方式回退到上一次能够提供正常工作的版本。为此K8S提供了回滚机制。 revision:更新应用时,K8S都会记录当前的版本号,即为revi…...
![](https://img-blog.csdnimg.cn/img_convert/33b82acec32fd5b5cc0c8c8a63340e85.png)
信息系统安全运维和管理指南
声明 本文是学习 信息系统安全运维管理指南. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 安全运维支撑系统 信息系统安全服务台 目的 对信息系统安全事件进行统一监控与处理。 要求 建立一个集中的信息系统运行状态收集、处理、显示及报警的系…...
![](https://img-blog.csdnimg.cn/d4ef0394fc034d09be12e204e7b2aa6c.jpeg)
现货黄金代理好吗?
做黄金代理这个职业好吗?从目前的市场现状来看,其实做黄金代理很不错的。在股票市场中,投资者只能通过买涨进盈利,所以当市场行情不好的时候,股票经纪人的业务将很难展开,而现货黄金投资者不一样࿰…...
![](https://img-blog.csdnimg.cn/eb4b95271e92478e9d8b8c16284c4994.png)
BCSP-玄子Share-Java框基础_双系统Redis安装与基础语法
四、Redis 4.1 Redis 简介 Redis 是开源、高性能的key-value数据库,属于 NoSQL 数据库 NoSQL 数据库与关系型数据库 关系型数据库:采用关系模型来组织数据,主要用于存储格式化的数据结构NoSQL 数据库:泛指非关系型数据库&…...
![](https://www.ngui.cc/images/no-images.jpg)
android system_server WatchDog简介
简介 android系统中SystemServer WatchDog的主要作用是监控SystemServer进程的运行状态,防止其卡住或者死锁。 具体来说,watchDog线程会定期去检查SystemServer线程的运行情况。如果发现SystemServer线程超过一定时间未有响应,watchDog会认为SystemServer进程发生了问题,这时…...
![](https://img-blog.csdnimg.cn/ec6e317e30de41568c423836edf84aea.png)
华为---OSPF协议优先级、开销(cost)、定时器简介及示例配置
OSPF协议优先级、开销、定时器简介及示例配置 路由协议优先级:由于路由器上可能同时运行多种动态路由协议,就存在各个路由协议之间路由信息共享和选择的问题。系统为每一种路由协议设置了不同的默认优先级,当在不同协议中发现同一条路由时&am…...
![](https://www.ngui.cc/images/no-images.jpg)
MEMORY-VQ: Compression for Tractable Internet-Scale Memory
本文是深度学习相关文章,针对《MEMORY-VQ: Compression for Tractable Internet-Scale Memory》的翻译。 MEMORY-VQ:可追溯互联网规模存储器的压缩 摘要1 引言2 背景3 MEMORY-VQ4 实验5 相关工作6 结论 摘要 检索增强是一种强大但昂贵的方法࿰…...
![](https://img-blog.csdnimg.cn/08fad1b3b9a44319956996a3b8233a22.png)
Netty—ChannelHandler
文章目录 一、Channel、ChannelPipeline 以及ChannelHandler 三者的关系❓二、ChannelHandler 是什么?🤔️三、ChannelInboundHandler四、ChannelOutboundHandler 一、Channel、ChannelPipeline 以及ChannelHandler 三者的关系❓ 通过以上对Channel和Ch…...
![](https://www.ngui.cc/images/no-images.jpg)
Android 集成onenet物联网平台
一,在Android应用程序中集成OneNet物联网平台,您可以按照以下步骤进行操作: 注册OneNet账户:首先,您需要在OneNet官方网站上注册一个账户。访问OneNet网站(https://open.iot.10086.cn/ ↗)&…...
![](https://img-blog.csdnimg.cn/a4a4ac9fbf4641c18bf2ba6f0802b8ce.png)
java八股文面试[JVM]——如何打破双亲委派模型
双亲委派模型的第一次“被破坏”是重写自定义加载器的loadClass(),jdk不推荐。一般都只是重写findClass(),这样可以保持双亲委派机制.而loadClass方法加载规则由自己定义,就可以随心所欲的加载类,典型的打破双亲委派模型的框架和中间件有tomc…...
![](https://img-blog.csdnimg.cn/img_convert/5cc6b557ae76731cc7338d9e64225979.jpeg)
一加11/Ace2/10Pro手机如何实现全局120HZ高刷-游戏超级流畅效果
已经成功root啦。安卓13目前也一样支持LSPosed框架,如果你对LSP框架有需求,也可以使 自测120HZ刷新率诞生以后,很多小伙伴用上了就很难回来啦,一加11/Ace2/10Pro/9pro手 机厂商也对新机做了很多的适配,让我们日常使用起…...
![](https://img-blog.csdnimg.cn/20210404234818963.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3hpYW1hb2NoZW5n,size_16,color_FFFFFF,t_70#pic_center)
微服务主流框架概览
微服务主流框架概览 目录概述需求: 设计思路实现思路分析1.HSF2.Dubbo 3.Spring Cloud5.gRPC Service mesh 参考资料和推荐阅读 Survive by day and develop by night. talk for import biz , show your perfect code,full busy,skip hardness,make a be…...
![](https://img-blog.csdnimg.cn/d795c19411934e629a59ad15e0472b5b.png)
Python Flask Web开发二:数据库创建和使用
前言 数据库在 Web 开发中起着至关重要的作用。它不仅提供了数据的持久化存储和管理功能,还支持数据的关联和连接,保证数据的一致性和安全性。通过合理地设计和使用数据库,开发人员可以构建强大、可靠的 Web 应用程序,满足用户的…...
![](https://img-blog.csdnimg.cn/238ea02eba1746e28df1645c203e1fd2.png)
快速学会git版本管理——上传gitee仓库
首先在gitee右上角有一个新建仓库 创建之后打开自己想要上传的文件 右键打开 Git Bash Here 接下来会弹出git的窗口 首先先初始化仓库 用git命令 git init 然后用git add . 上传所有文件上传到暂存区(上一篇文章说过add是单个文件,add . 是所有文件) 没有显示错误 …...
![](https://img-blog.csdnimg.cn/55a0fd4ab2c5467a973786aade84b643.jpeg#pic_center)
应用在智能洗衣机触摸屏上的电容式触摸芯片
智能型全自动洗衣机可以自动判断水温、水位、衣质衣量、衣物的脏污情况,决定投放适量的洗涤剂和的洗涤程序。当洗衣桶内衣物的多少和质地不同,而注入水使其达到相同的水位时,其总重量是不同的。利用这一点,通过对洗衣电动机低速转…...
![](https://img-blog.csdnimg.cn/7087c8f3381446ffbffdfc81e8da06bb.png)
npm版本升级报错
解决方法: 执行npm install --legacy-peer-deps依赖对等 npm install xxx --legacy-peer-deps命令用于绕过peerDependency里依赖的自动安装;它告诉npm忽略项目中引入的各个依赖模块之间依赖相同但版本不同的问题,以npm v4-v6的方式去继续执行…...
![](https://img-blog.csdnimg.cn/f46fcfe126a142b6a43b0b811dabb620.png)
Vue+Element-ui+SpringBoot搭建后端汽车租赁管理系统
最近在做项目,花了一周的时间搭建了一个十分完备的汽车租赁后端管理系统。页面采用纯Vue2Element-ui搭建,后端采用SpringbootMybatis搭建,数据库采用Mysql。包括了登录验证,根据不同权限进入不同界面、数据增删改查、表格分页、表…...
![](https://www.ngui.cc/images/no-images.jpg)
PKU校园网连接失败
校园网连接失败 连上校园网,显示已经连接但是没有网络,手动输入校园网门户( its.pku.edu.cn )也没有用。 使用 windows自带的疑难解答,分析发现dns解析异常。 解决方案 手动配置IPV4的dns。 同学的电脑可以正常连接dns,将同学…...
![](https://img-blog.csdnimg.cn/597f25b84fb743cebd49e7a9e3786216.jpeg)
STM32存储左右互搏 I2C总线读写FRAM MB85RC16
STM32存储左右互搏 I2C总线读写FRAM MB85RC16 在较低容量存储领域,除了EEPROM的使用,还有铁电存储器FRAM的使用,相对于EEPROM, 同样是非易失性存储单元,FRAM支持更高的访问速度, 其主要优点为没有EEPROM持续写操作跨页…...
![](https://www.ngui.cc/images/no-images.jpg)
【typeof instanceof Object.prototype.toString constructor区别】
几个数据类型判断区别 typeofinstanceofObject.prototype.toStringconstructor typeof 它返回的是一个字符串,表示未经过计算的操作数的类型 typeof(undefined) //"undefined"typeof(null) //"object"typeof(100) //"number"typeof…...
![](https://www.ngui.cc/images/no-images.jpg)
ARM Codec要求
文章目录 前言一、驱动1. linux kernel driver (非V4L2驱动)1.1 porting guide1.2 programing guide1.3 CPU占用率统计1.4 memory使用统计(不包含input/output/working buffer) 2. freeRTOS driver2.1 porting guide,驱动所支持freeRTOS版本列表2.2 programing guid…...
![](https://img-blog.csdnimg.cn/f486eebdb4e84adba4343a642d4f23f3.png)
QT多线程
1.QT4.7以前的版本-----线程处理方式 1. 出现的警告 直接使用从UI—>转到槽,就会出现警告 2. 出现的错误 error: invalid operands of types QTimer* and void (QTimer::*)(QTimer::QPrivateSignal) to binary operator& 错误:无效的操作数类型’QTimer…...
![](https://www.ngui.cc/images/no-images.jpg)
【linux命令讲解大全】059.命令行利器:快速执行指定命令的command命令
文章目录 command补充说明语法参数实例 从零学 python command 调用并执行指定的命令。 补充说明 command 命令用于调用指定的命令并执行,命令执行时不查询 shell 函数。command 命令只能执行 shell 内部的命令。 语法 command [参数]参数 指令:需…...
![](https://img-blog.csdnimg.cn/92203814c8904c63b51aa7b5acaecc21.png)
opencv-4.5.2-android-sdk.zip安装教程
opencv-4.5.2-android-sdk.zip: 下载链接:百度网盘 请输入提取码 提取码:s0p2 导入模块的方法: ①、导入模块 ②、定位到sdk目录 点击ok就行,就导入成功了。导入成功后会多出一个可展开的opencv文件夹(自己命名的),一定要能展…...
![](https://img-blog.csdnimg.cn/59f42ca07761400f8ac9d7fd4170ff57.png)
接口自动化测试系列-excel管理测试用例
代码源码: 框架结构 核心代码 excel数据处理 from configureUtil.LogUtil import getlog logger getlog(targetNameHandleData) import xlrd from openpyxl import load_workbook,workbook from openpyxl.styles import Font, colors import openpyxl import o…...
![](https://img-blog.csdnimg.cn/448c1653aa5441328613beab12864c55.png)
Spring——Spring的控制反转IOC
摘要 IoC 不是一种技术,只是一种思想,一个重要的面向对象编程的法则,它能指导我们如何设计出松耦合、更优良的程序。传统应用程序都是由我们在类内部主动创建依赖对象,从而导致类与类之间高耦合,难于测试;…...
![](https://www.ngui.cc/images/no-images.jpg)
基于CentOS7.5构建LVS-DR 群集,并启用Nginx负载均衡,一键完成。
在两台服务器上的步骤: 安装必要软件:在两台服务器上,安装必要的软件,包括ipvsadm和keepalived。使用以下命令安装软件: sudo yum install ipvsadm keepalived -y 禁用防火墙或配置规则:禁用防火墙或根据实…...
![](https://img-blog.csdnimg.cn/img_convert/20328e37cbd463dbb0736c38293cee06.png)
redis 数据结构(二)
整数集合 整数集合是 Set 对象的底层实现之一。当一个 Set 对象只包含整数值元素,并且元素数量不时,就会使用整数集这个数据结构作为底层实现。 整数集合结构设计 整数集合本质上是一块连续内存空间,它的结构定义如下: typed…...
![](https://img-blog.csdnimg.cn/0f7e7bee35694716b9c602299ca34373.png)
Hadoop依赖环境配置与安装部署
目录 什么是Hadoop?一、Hadoop依赖环境配置1.1 设置静态IP地址1.2 重启网络1.3 再克隆两台服务器1.4 修改主机名1.5 安装JDK1.6 配置环境变量1.7 关闭防火墙1.8 服务器之间互传资料1.9 做一个host印射1.10 免密传输 二、Hadoop安装部署2.1 解压hadoop的tar包2.2 切换…...
![](https://img-blog.csdnimg.cn/img_convert/0448f930dca3348c244133f6c93acadf.png)
计算机毕业论文网站开发总结/吉林seo管理平台
1910年,近铁日本铁路株式会社在日本西部地区成立,渐渐发展为日本最大的私营铁路公司,成为拥有超过150家子公司的综合性财团。1996年11月近铁集团(以下简称“KWE”)在中国设立子公司,苹果、三星、惠普、通用…...
![](/images/no-images.jpg)
国际网站怎么做/app拉新推广平台渠道
由于种种原因,决定今天开始从centos7转为ubuntu14.0.但是一开始就遇到了一个问题。ubuntu的源貌似被墙了。没有办法,只好换源。如是参考了下面的帖子。 换源参考链接 但是又出现了一个问题,百度了好久才找到 zhaoubuntu:~$ sudo apt-get -f install gcc …...
![](https://img-blog.csdnimg.cn/img_convert/ef52a77de67e1fc06b22b937e20e3a6d.png)
查公司查企业用什么网站/小学生班级优化大师
原题 | Generating a PEG Parser作者 | Guido van Rossum(Python之父)译者 | 豌豆花下猫(“Python猫”公众号作者)声明 | 本翻译是出于交流学习的目的,基于 CC BY-NC-SA 4.0 授权协议。为便于阅读,内容略有…...
![](/images/no-images.jpg)
科讯cms网站管理系统kesioncms/云服务器
LeetCode每日一题(2020/3/5) LeetCode这个月推出了每日一题打卡刷题计划,正好每天利用空闲时间打个卡,也在此记录总结一下。 这些题目都没有用数学方法求解,数学方法可以看LeetCode上的题解,讲的都非常详细…...
![](https://s5.51cto.com/wyfs02/M02/A7/42/wKioL1nkUeezxrSsAABYQimElsU037.png-wh_500x0-wm_3-wmp_4-s_4030169030.png)
徐州免费网站建设/空间刷赞网站推广
最近公司申请了华为云的资源做测试。在丢了一个小项目上去测试之后,发现系统CPU异常繁忙,系统重启之后情况依旧,连接服务器异常缓慢。这时也接到华为云的客服电话说测试服务器同***服务器之间有通信,让我们确认是不是正常的情况。…...
![](/images/no-images.jpg)
拖拽响应式网站建设公司/百度网址大全简单版
限时特惠,新购低至 0.019 元/条,最高立减 21600 元 https://www.ucloud.cn/site/active/usms.html 转载于:https://www.cnblogs.com/jenasy/p/11453933.html...