知行合一

博客园 首页 新随笔 联系 订阅 管理
  371 随笔 :: 25 文章 :: 4 评论 :: 15万 阅读

03 2021 档案

摘要:微服务框架服务调用与容错 本章主要介绍服务调用的方式:同步调用、异步调用、并行调用、泛化调用等。 一、服务调用概述 简单介绍了RPC框架的调用方式:同步调用和异步调用。服务调用方式按照不同的维度区分,有不同的命名方法,抛开技术不谈,我们还可以把服务调用分为3种:OneWay模式(单向操作)、请求应答 阅读全文
posted @ 2021-03-31 10:29 callbin 阅读(294) 评论(0) 推荐(0) 编辑

摘要:ZooKeeper实现服务注册中心 ZooKeeper官网地址:https://zookeeper.apache.org/ 一、Zookeeper概述 ZooKeeper是一个开源的、分布式的应用程序协调服务。它提供的功能包括:命名服务、配置管理、集群管理、分布式锁、负载均衡、分布式队列等。 (1) 阅读全文
posted @ 2021-03-31 09:28 callbin 阅读(2738) 评论(0) 推荐(0) 编辑

摘要:介绍微服务注册中心的概念、ZooKeeper的概念、ZooKeeper的原理、ZooKeeper的安装、ZooKeeper搭建集群环境、命令行客户端ZkClient以及ZooKeeper实现服务注册与发现。 一、注册中心几个概念 服务注册中心主要用来管理服务订阅和发布。对于服务提供者来说,它需要发布 阅读全文
posted @ 2021-03-31 09:22 callbin 阅读(468) 评论(0) 推荐(0) 编辑

摘要:1、让我自己来整理: 分类好、摆整齐、 归原位、勤整理。 方便找,省时间 心情好,能力强 2、每天放学回家,先做完作业,在玩。 3、我不拖拉、今日事今日毕。 阅读全文
posted @ 2021-03-30 23:14 callbin 阅读(120) 评论(0) 推荐(0) 编辑

摘要:一、Netty概述Netty是一款异步的事件驱动的网络应用程序框架,支持快速开发可维护、高性能且面向协议的服务器和客户端。Netty主要是对Java的NIO包进行的封装。Netty特性具体如表5-1所示。 网络上有一个形象的比喻来形容Netty客户端和服务器端的交互模式。把一个人比作一个Client 阅读全文
posted @ 2021-03-29 12:24 callbin 阅读(82) 评论(0) 推荐(0) 编辑

摘要:微服务底层通信与协议 回顾Java网络通信,包括传统BIO编程、伪异步I/O编程、NIO编程 一、传统BIO编程 通信的本质其实就是I/O,Java的网络编程主要涉及的内容是Socket编程,其他还有多线程编程、协议栈等相关知识。 在JDK 1.4推出Java NIO之前,基于Java的所有Sock 阅读全文
posted @ 2021-03-29 12:04 callbin 阅读(356) 评论(0) 推荐(0) 编辑

摘要:一、序列化/反序列化概念何为序列化?把对象转换为字节序列的过程称为对象的序列化。何为反序列化?把字节序列恢复为对象的过程称为对象的反序列化。 二、常用序列化框架 1、JSON序列化框架 JSON(JavaScript Object Notation,JS对象简谱)是一种轻量级的数据交换格式。JSON 阅读全文
posted @ 2021-03-29 11:59 callbin 阅读(93) 评论(0) 推荐(0) 编辑

摘要:一、RPC框架概述 1.RPC的定义 RPC(Remote Procedure Call,远程过程调用)是一种进程间的通信方式。它允许程序调用另一个地址空间(通常是共享网络的另一台机器上)的过程或函数,而不用程序员显式地编码远程调用的细节,即程序员无论是调用本地的还是远程的函数,本质上编写的调用代码 阅读全文
posted @ 2021-03-29 09:46 callbin 阅读(493) 评论(0) 推荐(0) 编辑

摘要:1、MyCat中的配置 2、配置文件 0为支持事务,1为不支持事务 3、数据库设置 阅读全文
posted @ 2021-03-28 14:01 callbin 阅读(716) 评论(0) 推荐(0) 编辑

摘要:XA协议的两阶段提交(原理) 阅读全文
posted @ 2021-03-28 13:43 callbin 阅读(435) 评论(0) 推荐(0) 编辑

摘要:分布式事务的问题 一、由分库分表引发的事务问题 解决方法 阅读全文
posted @ 2021-03-28 13:29 callbin 阅读(101) 评论(0) 推荐(0) 编辑

摘要:一、分布式系统中的CAP原理 分布式系统的P(分区容错性)总是有效,所以只能满足AP(A:可用性)或者CP(C:一致性) 1、简介 在分布式系统中,我们经常听到CAP原理这个词,它是什么意思呢?其实和C、A、P这3个字母有关,C、A、P分别是这3个词的首字母。下面我们就看一下这3个词分别是什么意思? 阅读全文
posted @ 2021-03-28 13:19 callbin 阅读(789) 评论(0) 推荐(0) 编辑

摘要:分布式事务概述 阅读全文
posted @ 2021-03-28 13:14 callbin 阅读(66) 评论(0) 推荐(0) 编辑

摘要:分布式全局ID方案落地-订单ID生成 1、订单ID代码生成 加上初始化,保证workid在不同机器上,workid不同 阅读全文
posted @ 2021-03-28 12:59 callbin 阅读(165) 评论(0) 推荐(0) 编辑

摘要:分布式全局ID 一、分库分表引发的id问题 二、分布式主键UUID,UUID作为全局主键,保证ID唯一 三、MyCat全局id (本地文件和数据库) 统一ID序列表 四、分布式id——雪花算法生成全局主键 阅读全文
posted @ 2021-03-28 09:30 callbin 阅读(131) 评论(0) 推荐(0) 编辑

摘要:一、快速体验MyCat 1、mysql8.0 安装 官网:https://dev.mysql.com/ 2、上传 可用rz命令上传,如果没有 3、yum源 安装 mysql8.0 文档 https://dev.mysql.com/doc/refman/8.0/en/linux-installatio 阅读全文
posted @ 2021-03-27 21:18 callbin 阅读(94) 评论(0) 推荐(0) 编辑

摘要:如何选择垂直切分、水平切分 先垂直、在水平切分。 一、垂直切分 二、水平切分 阅读全文
posted @ 2021-03-27 20:50 callbin 阅读(101) 评论(0) 推荐(0) 编辑

摘要:数据库读写分离、分库分表 阅读全文
posted @ 2021-03-27 20:42 callbin 阅读(90) 评论(0) 推荐(0) 编辑

摘要:MyCat概述与基本概念 一、什么是MyCat MyCat 是什么?从定义和分类来看,它是一个开源的分布式数据库系统,前端的用户可以把它看成一个数据库代理,用MySql客户端和命令行工具都可以访问,而其后端则是用MySql原生的协议与多个MySql服务之间进行通信。MyCat的核心功能是分库分表,即 阅读全文
posted @ 2021-03-27 19:10 callbin 阅读(466) 评论(0) 推荐(0) 编辑

摘要:一、如何正确使用数据库读写分离 1、背景 在应用系统发展的初期,我们并不知道以后会发展成什么样的规模,所以一开始不会考虑复杂的系统架构,复杂的系统架构费时费力,开发周期长,与系统发展初期这样的一个定位是不吻合的。所以,我们都会采用简单的架构,随着业务不断的发展,访问量不断升高,我们再对系统进行架构方 阅读全文
posted @ 2021-03-27 19:06 callbin 阅读(1105) 评论(0) 推荐(0) 编辑

摘要:一、海量数据的存储与访问瓶颈解决方案-数据切分 1、背景 在当今这个时代,人们对互联网的依赖程度非常高,也因此产生了大量的数据,企业视这些数据为瑰宝。而这些被视为瑰宝的数据为我们的系统带来了很大的烦恼。这些海量数据的存储与访问成为了系统设计与使用的瓶颈,而这些数据往往存储在数据库中,传统的数据库存在 阅读全文
posted @ 2021-03-27 14:11 callbin 阅读(245) 评论(0) 推荐(0) 编辑

摘要:一、多种分布式锁实现方案,我将如何选择? 二、在电商落地--扣减库存 1.扣减库存对应的数据库sql update行锁,串行。大量请求数据库压力大 2、pom引入依赖 3、实例化 4、扣减库存方法修改。通过锁机制,数据库压力减轻。 阅读全文
posted @ 2021-03-27 09:16 callbin 阅读(178) 评论(0) 推荐(0) 编辑

摘要:基于redisson实现分布式锁 一、上官网 https://redisson.org/ 二、pom文件引入依赖 <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.11. 阅读全文
posted @ 2021-03-27 08:43 callbin 阅读(159) 评论(0) 推荐(0) 编辑

摘要:基于Zookeeper的curator客户端实现分布式锁 一、进入官网 http://curator.apache.org 二、引入curator 的jar包 1、进入 https://mvnrepository.com/ 搜索 curator 2.Pom文件引入找到的jar包依赖 <depende 阅读全文
posted @ 2021-03-27 07:58 callbin 阅读(88) 评论(0) 推荐(0) 编辑

摘要:1、Zookeeper的数据结构 二、zookeeper分布式锁原理 二、zookeeper分布式锁代码实现 1、maven依赖 (1)https://mvnrepository.com/ 搜索 zookeeper (2)选择安装的对应版本 (3) pom 文件 添加依赖 <dependency> 阅读全文
posted @ 2021-03-26 20:00 callbin 阅读(135) 评论(0) 推荐(0) 编辑

摘要:一、基于分布式锁解决定时任务重复问题 1、定时任务部署集群 二、利用redis分布式锁解决定时任务重复发送短信 1、启用定时任务 package com.example.distributelock; import org.mybatis.spring.annotation.MapperScan; 阅读全文
posted @ 2021-03-26 19:32 callbin 阅读(818) 评论(0) 推荐(0) 编辑

摘要:一、 redis分布式锁原理 并发 到Redis里变成了串行排队,单线程 二、基于Redis的Setnx实现分布式锁 1、pom <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star 阅读全文
posted @ 2021-03-26 11:23 callbin 阅读(2185) 评论(0) 推荐(2) 编辑

摘要:一、基于数据库悲观锁的分布式锁 代码 package com.example.distributelock.controller; import com.example.distributelock.dao.DistributeLockMapper; import com.example.distr 阅读全文
posted @ 2021-03-26 09:02 callbin 阅读(68) 评论(0) 推荐(0) 编辑

摘要:一、如何使用锁解决电商中的超卖的问题? 1、模拟5个线程并发执行。使用CyclicBarrier类 package com.example.distributedemo; import com.example.distributedemo.service.OrderService; import o 阅读全文
posted @ 2021-03-26 07:33 callbin 阅读(105) 评论(0) 推荐(0) 编辑

摘要:一 、RabbitMQ基础组件整体功能概述 二、基础组件开发 4各模块 common、api、core-product、task (一)、父工程 rabbit-parent 1.pom文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmln 阅读全文
posted @ 2021-03-17 21:44 callbin 阅读(210) 评论(0) 推荐(0) 编辑

摘要:配置文件 \src\main\resources\application.properties server.servlet.context-path=/ server.port=8002 spring.rabbitmq.addresses=192.168.11.71:5672,192.168.11 阅读全文
posted @ 2021-03-17 19:38 callbin 阅读(186) 评论(0) 推荐(0) 编辑

摘要:一、RabbitMQ与SpringBoot整合_生产端 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> se 阅读全文
posted @ 2021-03-16 19:32 callbin 阅读(140) 评论(0) 推荐(0) 编辑

摘要:word文档地址: https://files.cnblogs.com/files/callbin/RabbitMQ%E6%B6%88%E6%81%AF%E6%9C%8D%E5%8A%A1%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C.zip 阅读全文
posted @ 2021-03-16 15:47 callbin 阅读(101) 评论(0) 推荐(0) 编辑

摘要:生成端发消息 package com.bfxy.rabbitmq.api.delay; import java.io.IOException; import java.util.HashMap; import java.util.Map; import com.rabbitmq.client.AMQ 阅读全文
posted @ 2021-03-16 15:29 callbin 阅读(195) 评论(0) 推荐(0) 编辑

摘要:代码演示 生成端 package com.bfxy.rabbitmq.api.limit; import java.util.HashMap; import java.util.Map; import com.rabbitmq.client.AMQP; import com.rabbitmq.cli 阅读全文
posted @ 2021-03-16 14:54 callbin 阅读(92) 评论(0) 推荐(0) 编辑

摘要:生成端 package com.bfxy.rabbitmq.api.confirmlistener; import java.io.IOException; import com.rabbitmq.client.Channel; import com.rabbitmq.client.ConfirmL 阅读全文
posted @ 2021-03-16 14:35 callbin 阅读(86) 评论(0) 推荐(0) 编辑

摘要:一、消息如何保障 100%的投递成功 阅读全文
posted @ 2021-03-16 11:58 callbin 阅读(80) 评论(0) 推荐(0) 编辑

摘要:一、Exchange 交换机 2.交换机类型 (一) Direct Exchange 直连 2)Direct 生产者 生产者只关心 Exchange package com.bfxy.rabbitmq.api.exchange.direct; import com.rabbitmq.client.C 阅读全文
posted @ 2021-03-16 10:37 callbin 阅读(213) 评论(0) 推荐(0) 编辑

摘要:一、pom依赖引入 <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>3.6.5</version> </dependency> 二、生产者 Routingkey 要和 阅读全文
posted @ 2021-03-16 10:11 callbin 阅读(81) 评论(0) 推荐(0) 编辑

摘要:急速入门,在这里我们使用RabbitMQ 3.6.5 版本进行操作: - 环境搭建: - 官网地址:http://www.rabbitmq.com/ - 环境描述:Linux(centos7 Redhat7) ```shell ## 1. 首先在Linux上进行一些软件的准备工作,yum下来一些基础 阅读全文
posted @ 2021-03-15 15:59 callbin 阅读(201) 评论(0) 推荐(0) 编辑

摘要:一、RabbitMQ 二、 三、 四、AMQP核心概念 五、RabbitMQ的整体架构 阅读全文
posted @ 2021-03-15 15:27 callbin 阅读(93) 评论(0) 推荐(0) 编辑

摘要:一、kafka介绍 1、文件读取写给另外一端的过程,存在4次拷贝过程(一般的程序) 2、Kafka 采用的 zero copy 和 page cache 阅读全文
posted @ 2021-03-15 11:57 callbin 阅读(216) 评论(0) 推荐(0) 编辑

摘要:一、RabbitMQ 四种集群架构 一、主备模式 二、镜像模式 缺点:无法横向扩展 三、多活模式 阅读全文
posted @ 2021-03-15 11:33 callbin 阅读(142) 评论(0) 推荐(0) 编辑

摘要:一、分布式消息队列(MQ)应用场景 阅读全文
posted @ 2021-03-15 11:19 callbin 阅读(789) 评论(0) 推荐(0) 编辑

摘要:参考文献 https://github.com/happyfish100/https://github.com/happyfish100/fastdfs/wikihttps://www.cnblogs.com/leechenxiang/p/5406548.htmlhttps://www.cnblog 阅读全文
posted @ 2021-03-14 20:01 callbin 阅读(213) 评论(0) 推荐(0) 编辑

摘要:常见术语tracker:追踪者服务器,主要用于协调调度,可以起到负载均衡的作用,记录storage的相关状态信息。storage:存储服务器,用于保存文件以及文件的元数据信息。group:组,同组节点提供冗余备份,不同组用于扩容。mata data:文件的元数据信息,比如长宽信息,图片后缀,视频的帧 阅读全文
posted @ 2021-03-14 11:20 callbin 阅读(55) 评论(0) 推荐(0) 编辑

摘要:目前文件上传的问题 分布式文件系统:一个允许文件通过网络在多台节点上分享的文件系统,多台计算机节点共同组成一个整体,为更多的用户提供分享文件和存储空间。 使用分布式文件系统 解决以下问题: 1、海量文件数据存储 2、文件数据高可用(冗余备份) 3、读写性能和负载均衡 以上3点都是我们之前使用tomc 阅读全文
posted @ 2021-03-14 11:02 callbin 阅读(99) 评论(0) 推荐(0) 编辑

摘要:分布式系统 分布式系统就是一个系统由多个组成部分共同构成,用户的一个请求可能会经过多个不同的计算机节点之后,通过运算才会把结果响应给用户,那么这个请求所经过的不同的几个系统就是分布式系统。对于用户来讲,你是不是分布式系统,对他来讲是透明的。参考如下图: 图中就表示一个用户在经历下单过程会经过多个系统 阅读全文
posted @ 2021-03-14 10:33 callbin 阅读(235) 评论(0) 推荐(0) 编辑

摘要:一、安装nodejs 1.、打开nodejs官网:https://nodejs.org/en/download/,选择下载linux版本64位。 2、解压压缩包 命令:tar -xvf node-v12.18.3-linux-x64.tar.xz, 将压缩包解压 3、将解压出来的文件重命名 命令:m 阅读全文
posted @ 2021-03-12 13:59 callbin 阅读(1686) 评论(0) 推荐(0) 编辑

摘要:一、下载 Elasticsearch 1、 https://www.elastic.co/cn/downloads/elasticsearch wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.11.2 阅读全文
posted @ 2021-03-12 09:35 callbin 阅读(311) 评论(0) 推荐(0) 编辑

摘要:一、什么是分布式搜索引擎? 二、什么是Elasticsearch? 官网:https://www.elastic.co/cn/elasticsearch/ 三、ES核心术语 核心概念 ES -> 数据库 索引index -> 表 文档 document ->行 (记录) 字段 fields -> 列 阅读全文
posted @ 2021-03-12 08:53 callbin 阅读(171) 评论(0) 推荐(0) 编辑

摘要: 阅读全文
posted @ 2021-03-11 19:38 callbin 阅读(152) 评论(0) 推荐(0) 编辑

摘要:一、集群 多个节点部署同一个服务就是集群 二、Keepalived概念 1、解决单点故障 2 、组件免费 3、 可用实现高可用HA机制 4、 基于VRRP 协议 三、安装 Keepalived (1)下载地址: https://www.keepalived.org/software/keepaliv 阅读全文
posted @ 2021-03-11 15:13 callbin 阅读(468) 评论(0) 推荐(0) 编辑

摘要:一、Tomcat部署架构 演进 二、Nginx部署架构 配置nginx tomcat api接口域名访问配置: upstream api.callbin.cn { server 172.17.40.111:8088; } server{ listen 80; server_name api.call 阅读全文
posted @ 2021-03-11 14:16 callbin 阅读(57) 评论(0) 推荐(0) 编辑

摘要:管理和技术 管理: 经理->总监->高级总监->副总裁->CTO 技术: 高级工程师->主任工程师->首席工程师->架构师->首席架构师->总架构师 阅读全文
posted @ 2021-03-11 11:25 callbin 阅读(173) 评论(0) 推荐(0) 编辑

摘要:1.df查看磁盘驱动器当前可用空间 df -h 2、free 显示可用内存 free -h 3. 查看IP ifconfig 4.查看网关 netstat -rn 5.查看DNS cat /etc/resolv.conf 6.查看主机名 hostname 7.查看操作系统版本 cat /etc/is 阅读全文
posted @ 2021-03-11 11:04 callbin 阅读(127) 评论(0) 推荐(0) 编辑

摘要:常用指令 ls 显示文件或目录 -l 列出文件详细信息l(list) -a 列出当前目录下所有文件及目录,包括隐藏的a(all) mkdir 创建目录 -p 创建目录,若无父目录,则创建p(parent) cd 切换目录 touch 创建空文件 echo 创建带有内容的文件。 cat 查看文件内容 阅读全文
posted @ 2021-03-11 11:02 callbin 阅读(58) 评论(0) 推荐(0) 编辑

摘要:系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT / 阅读全文
posted @ 2021-03-11 11:00 callbin 阅读(47) 评论(0) 推荐(0) 编辑

摘要:一、分布式会话 1、什么是会话会话Session代表的是客户端与服务器的一次交互过程,这个过程可以是连续也可以是时断时续的。曾经的Servlet时代(jsp),一旦用户与服务端交互,服务器tomcat就会为用户创建一个session,同时前端会有一个jsessionid,每次交互都会携带。如此一来, 阅读全文
posted @ 2021-03-11 09:18 callbin 阅读(381) 评论(0) 推荐(0) 编辑

摘要:一、修改打包形式 在pom.xml里设置 <packaging>war</packaging> Pom.xml文件 打包方式改为war <!--改为war方式 默认为jar--> <packaging>war</packaging> 二、移除嵌入式tomcat插件 在pom.xml里找到spring 阅读全文
posted @ 2021-03-10 19:25 callbin 阅读(225) 评论(0) 推荐(0) 编辑

摘要:1、主配置文件 2、挂载文件 开发环境:application-dev.yml 生产环境 application-prod.ym 阅读全文
posted @ 2021-03-10 15:07 callbin 阅读(91) 评论(0) 推荐(0) 编辑

摘要:复制、哨兵、集群 阅读全文
posted @ 2021-03-10 12:06 callbin 阅读(57) 评论(0) 推荐(0) 编辑

摘要:客户端测试 负载均衡是否正常 后端Real-Server出问题是否自动剔除 lvs高可用是否正常,提供服务的LVS宕机,vip漂移到另一台LVS继续提供服务 阅读全文
posted @ 2021-03-10 10:27 callbin 阅读(43) 评论(0) 推荐(0) 编辑

摘要:redis操作类 package com.imooc.utils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; i 阅读全文
posted @ 2021-03-09 23:43 callbin 阅读(101) 评论(0) 推荐(0) 编辑

摘要:1. 引入 redis 依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> 2. 配置red 阅读全文
posted @ 2021-03-09 23:23 callbin 阅读(54) 评论(0) 推荐(0) 编辑

摘要:一、Redis的线程模型 就如同KTV点歌 二、多路复用器(理解) 只负责接待,丢给酒店,具体由酒店负责。 阅读全文
posted @ 2021-03-09 21:30 callbin 阅读(179) 评论(0) 推荐(0) 编辑

摘要:http://redisdoc.com/index.html 一、Redis的数据类型 - string string 字符串 string: 最简单的字符串类型键值对缓存,也是最基本的 字符串类型是Redis中最基本的数据类型,它能存储任何形式的字符串,包括二进制数据。你可以用其存储用户的邮箱、J 阅读全文
posted @ 2021-03-09 17:21 callbin 阅读(54) 评论(0) 推荐(0) 编辑

摘要:一、下载 官网: https://redis.io/download 选择下载稳定版本。 ps -ef | grep redis 二、安装Redis 1、解压redis tar -zxvf redis-5.0.12.tar.gz 6.06版本安装 # wget wget http://downloa 阅读全文
posted @ 2021-03-09 11:02 callbin 阅读(265) 评论(0) 推荐(0) 编辑

摘要:查看磁盘:df -Th 查看inode:df -i 文件对应的inode的号, ls -i 文件名 阅读全文
posted @ 2021-03-08 15:45 callbin 阅读(57) 评论(0) 推荐(0) 编辑

摘要:一、购物车的存储形式 1、cookie存放数据 无须登录、无须查库、保存在浏览器端 优点:性能好、访问快、没有和数据库交互。 缺点1:换浏览器购物车数据会丢失。 缺点2:电脑被他人使用,存在隐私安全。 2、session存放数据 用户登录后,购物车数据放入用户会话 优点:初期性能较好、访问快。 缺点 阅读全文
posted @ 2021-03-07 21:23 callbin 阅读(1990) 评论(0) 推荐(0) 编辑

摘要:一、数据表设计 create table `foodie-shop-dev`.user_address ( id varchar(64) not null comment '地址主键id' primary key, user_id varchar(64) not null comment '关联用户 阅读全文
posted @ 2021-03-07 21:03 callbin 阅读(2143) 评论(0) 推荐(0) 编辑

摘要:一、复杂订单状态设计 二、订单表设计 订单的每个状态更改都需要进行记录10:待付款 20:已付款,待发货 30:已发货,待收货(7天自动确认) 40:交易成功(此时可以评价)50:交易关闭(待付款时,用户取消 或 长时间未付款,系统识别后自动关闭)退货/退货,此分支流程不做,所以不加入 阅读全文
posted @ 2021-03-07 20:16 callbin 阅读(259) 评论(0) 推荐(0) 编辑

摘要:一、数据表结构 create table `foodie-shop-dev`.items ( id varchar(64) not null comment '商品主键id' primary key, item_name varchar(32) not null comment '商品名称 商品名称 阅读全文
posted @ 2021-03-06 10:04 callbin 阅读(1004) 评论(0) 推荐(0) 编辑

摘要:一、脱敏工具类 package com.imooc.utils; import sun.applet.Main; /** * 通用脱敏工具类 * 可用于: * 用户名 * 手机号 * 邮箱 * 地址等 */ public class DesensitizationUtil { private sta 阅读全文
posted @ 2021-03-06 06:22 callbin 阅读(282) 评论(0) 推荐(0) 编辑

摘要:一、SpringBoot 整合 mybatis-pagehelper 1.引入分页插件依赖 <!--pagehelper --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-b 阅读全文
posted @ 2021-03-06 00:12 callbin 阅读(197) 评论(0) 推荐(0) 编辑

摘要:一、数据库结构 create table `foodie-shop-dev`.items_comments ( id varchar(64) not null comment 'id主键' primary key, user_id varchar(64) null comment '用户id 用户名 阅读全文
posted @ 2021-03-05 22:13 callbin 阅读(202) 评论(0) 推荐(0) 编辑

摘要:一、数据库结构 create table `foodie-shop-dev`.items ( id varchar(64) not null comment '商品主键id' primary key, item_name varchar(32) not null comment '商品名称 商品名称 阅读全文
posted @ 2021-03-05 20:23 callbin 阅读(249) 评论(0) 推荐(0) 编辑

摘要:功能:查询每个一级分类的最新6条商品数据一、数据库表结构 create table `foodie-shop-dev`.category ( id int auto_increment comment '主键' primary key, name varchar(32) not null comme 阅读全文
posted @ 2021-03-05 18:26 callbin 阅读(996) 评论(0) 推荐(0) 编辑

摘要:跨域 产生跨域问题的罪魁祸首是浏览器同源策略,当协议、子域名、主域名、端口号中任意一个不相同时,都算作不同域,不同域之间的网络请求就会触发跨域问题。跨域并不是请求发不出去,请求能发出去,服务端能收到请求并正常返回结果,只是结果被浏览器拦截了。 解决方法 前后台分离模式目前主流解决方案有三种: web 阅读全文
posted @ 2021-03-04 21:50 callbin 阅读(2878) 评论(0) 推荐(0) 编辑

摘要:/** * 事务传播 - Propagation * REQUIRED: 使用当前的事务,如果当前没有事务,则自己新建一个事务,子方法是必须运行在一个事务中的; * 如果当前存在事务,则加入这个事务,成为一个整体。 * 举例:领导没饭吃,我有钱,我会自己买了自己吃;领导有的吃,会分给你一起吃。 * 阅读全文
posted @ 2021-03-04 21:21 callbin 阅读(110) 评论(0) 推荐(0) 编辑

摘要:用户的主键 1、全局唯一化。已经把组件预先的引用了进来。就是下面三个包, 2、这里有个sid,其实就是工具类。 package org.n3r.idworker; import org.n3r.idworker.strategy.DefaultWorkerIdStrategy; import org 阅读全文
posted @ 2021-03-04 21:09 callbin 阅读(260) 评论(0) 推荐(0) 编辑

摘要:一、枚举类型定义 1、性别:男,女,保密 (目录:com/imooc/enums/Sex.java) package com.imooc.enums; public enum Sex { woman(0,"女"), man(1,"男"), secret(2,"保密"); public final I 阅读全文
posted @ 2021-03-04 20:50 callbin 阅读(92) 评论(0) 推荐(0) 编辑

摘要:功能使用说明.首页加载分类数据的方式 (1)先渲染一级分类 (2)懒加载二级分类,(如鼠标hover一级分类时才开始加载对应的二级数据) 一、数据库表结构 category 分类表 create table `foodie-shop-dev`.category ( id int auto_incre 阅读全文
posted @ 2021-03-04 19:02 callbin 阅读(546) 评论(0) 推荐(0) 编辑

摘要:1、使用AOP, 引入aop依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> 2、新增 ServiceL 阅读全文
posted @ 2021-03-04 18:38 callbin 阅读(111) 评论(0) 推荐(0) 编辑

摘要:一、整合Swagger2文档API 1、pom.xml引入依赖 <!-- swagger2配置--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2 阅读全文
posted @ 2021-03-04 18:26 callbin 阅读(641) 评论(0) 推荐(0) 编辑

摘要: 阅读全文
posted @ 2021-03-01 22:45 callbin 阅读(80) 评论(0) 推荐(0) 编辑

该文被密码保护。
posted @ 2021-03-01 19:41 callbin 阅读(3) 评论(0) 推荐(0) 编辑

摘要:一、Maven项目代码 1、foodie-dev父工程项目 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2 阅读全文
posted @ 2021-03-01 19:12 callbin 阅读(145) 评论(0) 推荐(0) 编辑

摘要:1、项目会使用maven来构建一个聚合的分层项目。分层后的项目结构如下: 1)聚合工程里可以分为顶级项目(顶级工程、父工程)与子工程,这两者的关系其实就是父子继承的关系,子工程在maven里称之为模块(module),模块之间是平级,是可以相互依赖的。 2)子模块可以使用顶级工程里所有的资源(依赖) 阅读全文
posted @ 2021-03-01 17:43 callbin 阅读(263) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示