
天天吃货
学习笔记
qingwenc
这个作者很懒,什么都没留下…
展开
-
keepalived命令
1;systemctl daemon-reload 重新加载2:systemctl enable keepalived.service 设置开机自动启动3:systemctl disable keepalived.service 取消开机自动启动4:systemctl start keepalived.service 启动5:systemctl stop keepalived.service停止原创 2021-04-03 17:42:55 · 1176 阅读 · 0 评论 -
Springboot项目启动Flowable工作流的问题
项目启动出错,相关工作流的表会创建不完整Error:Using a TIMESTAMP data type with a fractional precision of 6 is not supported on mariadb: A timestamp datatype with 6 fractional digits was requested, but MySQL only supports 0 digits.因为MySQL版本不支持Timestamp(n)的写法,需更新MySQL版本。在MyS原创 2021-03-20 11:09:17 · 491 阅读 · 0 评论 -
Nginx日志切割-手动
1.在sbin目录下创建可执行文件cut_my_log.sh,内容如下:以分钟创建日志#!/bin/bashLOG_PATH="/usr/local/nginx/logs"RECORD_TIME=$(date -d "yesterday" +%Y-%m-%d+%H:%M)PID=${LOG_PATH}/nginx.pidmv ${LOG_PATH}/access.log ${LOG_PATH}/access.${RECORD_TIME}.logmv ${LOG_PATH}/error.log原创 2021-03-13 01:41:40 · 197 阅读 · 0 评论 -
后台数据校验
1.在方法参数中对实体进行声明@Valid和BindingResult result2.通过解析BindingResult 并封装到map中,然后返回输出3.实体的数据校验 @NotBlank(message = "用户昵称不能为空") @Length(max = 12, message = "用户昵称不能超过12位") @ApiModelProperty(value="用户昵称", name="nickname", example="杰森", required = false)原创 2021-02-24 00:00:30 · 361 阅读 · 0 评论 -
头像上传
1.controller代码 @ApiOperation(value = "用户头像修改", notes = "用户头像修改", httpMethod = "POST") @PostMapping("uploadFace") public IMOOCJSONResult uploadFace( @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam S原创 2021-02-23 23:26:57 · 188 阅读 · 0 评论 -
Mybatis代码生成工具
1.修改配置文件 generatorConfig.xml<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">原创 2021-01-08 16:58:02 · 90 阅读 · 0 评论 -
java中枚举的创建和使用
创建/** * @Desc: 性别 枚举 */public enum Sex { woman(0, "女"), man(1, "男"), secret(2, "保密"); public final Integer type; public final String value; Sex(Integer type, String value) { this.type = type; this.value = value原创 2021-01-08 15:38:12 · 232 阅读 · 0 评论 -
BeanUtils使用
BeanUtils.copyProperties(addressBO,pendingAddress);原创 2021-01-22 12:08:07 · 90 阅读 · 0 评论 -
提交订单微信付款逻辑
1.提交订单后,对应生成服务端三个表的数据,订单表order,订单商品表,订单状态表order_items规格表items_spec要扣除库存2.调用商户后台系统,创建订单3.商户后台系统调用(统一下单api)微信支付系统生成二维码4.用户支付后,微信异步通知商户系统支付结果,商户系统告知微信接收情况(不告知接收情况,微信会连续发送支付结果)4.商户系统修改订单状态,并调用远程接口通知服务器后台,修改订单状态支付流程图在这里插入图片描述...原创 2021-01-22 12:03:19 · 726 阅读 · 0 评论 -
RestTemplate跨域调用
1.设置配置类@Configurationpublic class WebMvcConfig implements WebMvcConfigurer { @Bean public RestTemplate restTemplate(RestTemplateBuilder builder) { return builder.build(); }}2.Controller调用@Autowired private RestTemplate restTempl原创 2021-01-22 11:42:09 · 1001 阅读 · 0 评论 -
读取properties资源文件装载在类中
1.类中的定义@Component@ConfigurationProperties(prefix="wxpay")@PropertySource("classpath:wxpay.properties")public class WXPayResource { private String qrcodeKey; private long qrcodeExpire; public String getQrcodeKey() { return qrcodeKey; } public原创 2021-01-22 11:28:45 · 122 阅读 · 0 评论 -
mybatis配置文件foreach等应用
<select id="queryItemComments" parameterType="Map" resultType="com.imooc.pojo.vo.ItemCommentVO"> SELECT ic.comment_level as commentLevel, ic.content as content, ic.sepc_name as specName, ic.created_time as createdT原创 2021-01-09 17:24:41 · 329 阅读 · 0 评论 -
添加商品到购物车逻辑
1.先判断cookie中是否有购物车,没有就把对象存到数组中,再存到cookie中,2.如果cookie中有购物车,就通过规格Id判断cookie中的对象数组是否存在此规格Id的对象,存在就购买数量加一,不存在就把当前规格Id的对象插入到cookie对象数组中相关前端代码// 由于cookie大小限制为4k,另外课程第一阶段是没有redis的,所以相关暂存性内容会存入到cookie中 var shopcartCounts = app.getShopcartItemCounts();原创 2021-01-08 15:20:33 · 2014 阅读 · 1 评论 -
log4j日志的实现
1.添加依赖把spring-boot-starter-logging的依赖排除掉,只使用slf4j-log4j12 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <exclusions> <exclusion> <gro原创 2020-12-30 18:06:42 · 202 阅读 · 0 评论 -
前后端跨域Cors的解决
1.添加配置类:package com.imooc.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.cors.CorsConfiguration;import org.springframework.web.cors.UrlBasedCorsConf原创 2020-12-30 17:53:52 · 172 阅读 · 0 评论 -
面向切面AOP的使用
1.添加依赖:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId></dependency>2.添加配置类:import org.aspectj.lang.ProceedingJoinPoint;import org.aspectj.lang.annota原创 2020-12-30 17:43:08 · 113 阅读 · 0 评论 -
Swagger2的使用
Swagger2的使用1.添加依赖<!-- swagger2 配置 --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.4.0</version> </dependency> <dependency>原创 2020-12-30 17:29:02 · 119 阅读 · 1 评论 -
Git的使用--如何将本地项目上传到Github
Git的使用–如何将本地项目上传到Github转载 2020-08-13 09:55:28 · 87 阅读 · 0 评论