随笔分类 - 谷粒商城
摘要:1.上架三天需要秒杀的商品 @Override public void uploadSeckillSkuLatest3Days() { //1、扫描最近三天的商品需要参加秒杀的活动 R lates3DaySession = couponFeignService.getLates3DaySession
阅读全文
摘要:1.订单确认页返回需要用的数据 @Override public OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException { //构建OrderConfirmVo OrderConfirmVo con
阅读全文
摘要:1.添加购物车 @Override public CartItemVo addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException { //拿到要操作的购物车信息 BoundHashOperat
阅读全文
摘要:同一个线程内共享数据 public static ThreadLocal<UserInfoTo> toThreadLocal = new ThreadLocal<>(); // 赋值 toThreadLocal.set(userInfoTo); // 取值 UserInfoTo userInfoTo
阅读全文
摘要:Single Sign On 一处登陆、处处可用 参考:https://gitee.com/xuxueli0323/xxl-sso 单点登录流程
阅读全文
摘要:SpringBoot 整合 SpringSession https://docs.spring.io/spring-session/docs/2.5.0/reference/html5/#samples auth 服务、product 服务、 search 服务 pom文件 <!-- 整合 spri
阅读全文
摘要:一、Session 共享问题 1.1 Session 原理 1.2 分布式下 Session 共享问题 二、Session 共享问题解决 2.1 Session 复制 2.2 客户端存储 2.3 hash一致性 2.4 统一存储
阅读全文
摘要:OAuth: : OAuth(开放授权)是一个开放标准,允许用户授权第三方网站访问他们存储在另外的服务提供者上的信息,而不需要将用户名和密码提供给第三方网站或分享他们数据的所有内容。 OAuth2.0 :对于用户相关的 OpenAPI(例如获取用户信息,动态同步,照片,日志,分享等),为了保护用户数
阅读全文
摘要:一、参数校验补充 通过注解可以给前端传递过来的值进行校验,例如: 但是这个注解必须配合 @Valid 使用,完成对参数的校验: 而校验的结果,也会自动封装到 BindingResult 类型中,通过这个参数可以很方便的对错误的参数进行处理。 hasErrors() 可以判断是否有参数校验错误,如果有
阅读全文
摘要:一、阿里云短信服务 https://www.aliyun.com/product/sms?spm=5176.159202.J_8058803260.68.64ae6a56APLp1H 二、工具类 HttpUtils HttpUtils 请从 https://github.com/aliyun/api
阅读全文
摘要:一、创建认证模块 1.1 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSc
阅读全文
摘要:一、商品详情 1.1 域名跳转环境 修改本机 hosts 文件: # guli mall # 192.168.163.131 gulimall.com 192.168.163.131 search.gulimall.com 192.168.163.131 item.gulimall.com 1.2
阅读全文
摘要:一、课件 07、异步&线程池.pdf 二、线程池 2.1 线程池的七大参数 /** * Creates a new {@code ThreadPoolExecutor} with the given initial * parameters. * * @param corePoolSize the
阅读全文
摘要:
一、添加模板页面 <!-- 模板引擎 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 将
阅读全文
一、添加模板页面 <!-- 模板引擎 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 将
阅读全文
摘要:
一、课件 05、缓存&分布式锁.pdf 二、缓存 - redis 这里操作环境为商品服务模块,虚拟机初始化时已安装 Redis。 2.1 添加 redis 依赖 <!-- redis --> <dependency> <groupId>org.springframework.boot</groupI
阅读全文
一、课件 05、缓存&分布式锁.pdf 二、缓存 - redis 这里操作环境为商品服务模块,虚拟机初始化时已安装 Redis。 2.1 添加 redis 依赖 <!-- redis --> <dependency> <groupId>org.springframework.boot</groupI
阅读全文
摘要:
课件 04、性能与压力测试.pdf 性能优化 - Nginx 动静分离 首先,把商品服务中静态文件夹 index 放到 nginx 下 /mydata/nginx/html/static目录; 给模板中所有静态资源的请求路径前都加上 /static; 修改 Nginx 配置文件 /mydata/ng
阅读全文
课件 04、性能与压力测试.pdf 性能优化 - Nginx 动静分离 首先,把商品服务中静态文件夹 index 放到 nginx 下 /mydata/nginx/html/static目录; 给模板中所有静态资源的请求路径前都加上 /static; 修改 Nginx 配置文件 /mydata/ng
阅读全文
摘要:
一、修改 Windows hosts 文件 位置:C:\Windows\System32\drivers\etc 在后面追加以下内容: # guli mall # 192.168.163.131 gulimall.com 二、Nginx 配置文件 三、分析Nginx配置文件 cat /mydata/
阅读全文
一、修改 Windows hosts 文件 位置:C:\Windows\System32\drivers\etc 在后面追加以下内容: # guli mall # 192.168.163.131 gulimall.com 二、Nginx 配置文件 三、分析Nginx配置文件 cat /mydata/
阅读全文
摘要:
一、商品上架 //商品上架 @GlobalTransactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class) @Override public void up(Long spuId
阅读全文
一、商品上架 //商品上架 @GlobalTransactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class) @Override public void up(Long spuId
阅读全文
摘要:
一、获取仓库列表 @Override public PageUtils queryPage(Map<String, Object> params) { QueryWrapper<WareInfoEntity> queryWrapper = new QueryWrapper<>(); String k
阅读全文
一、获取仓库列表 @Override public PageUtils queryPage(Map<String, Object> params) { QueryWrapper<WareInfoEntity> queryWrapper = new QueryWrapper<>(); String k
阅读全文
摘要:
一、分类维护-通过Java8 Stream API 获取商品三级分类数据 数据库 实体类 @Data @TableName("pms_category") public class CategoryEntity implements Serializable { private static fin
阅读全文
一、分类维护-通过Java8 Stream API 获取商品三级分类数据 数据库 实体类 @Data @TableName("pms_category") public class CategoryEntity implements Serializable { private static fin
阅读全文

浙公网安备 33010602011771号