摘要: 代码 生成全局唯一的ID: /** * 生成全局唯一的ID * @param keyPrefix * @return */public long nextId(String keyPrefix) { // 1.生成时间戳 LocalDateTime now = LocalDateTime.now() 阅读全文
posted @ 2022-11-13 15:57 এএ᭄念卿এএ᭄ 阅读(22) 评论(0) 推荐(0)
摘要: 代码实现:互斥锁 package com.hmdp.utils;import cn.hutool.core.util.BooleanUtil;import cn.hutool.core.util.StrUtil;import cn.hutool.json.JSONObject;import cn.h 阅读全文
posted @ 2022-11-13 15:33 এএ᭄念卿এএ᭄ 阅读(30) 评论(0) 推荐(0)
摘要: 代码实现 // String key=CACHE_SHOP_KEY + id;// //1从缓存中查询上铺缓存// String shopJson = stringRedisTemplate.opsForValue().get(key);// //2判断是否存在// if (StrUtil.isBl 阅读全文
posted @ 2022-11-13 13:45 এএ᭄念卿এএ᭄ 阅读(25) 评论(0) 推荐(0)