{"id":201163,"date":"2025-05-10T09:34:02","date_gmt":"2025-05-10T01:34:02","guid":{"rendered":"https:\/\/server.hk\/cnblog\/201163\/"},"modified":"2025-05-10T09:34:02","modified_gmt":"2025-05-10T01:34:02","slug":"%e5%88%a9%e7%94%a8redis%e5%ae%9e%e7%8e%b0%e9%98%b2%e6%ad%a2%e6%8e%a5%e5%8f%a3%e9%87%8d%e5%a4%8d%e6%8f%90%e4%ba%a4%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/201163\/","title":{"rendered":"\u5229\u7528Redis\u5b9e\u73b0\u9632\u6b62\u63a5\u53e3\u91cd\u590d\u63d0\u4ea4\u529f\u80fd"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u5229\u7528Redis\u5b9e\u73b0\u9632\u6b62\u63a5\u53e3\u91cd\u590d\u63d0\u4ea4\u529f\u80fd<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u5728\u6570\u636e\u5e93\u5b9e\u6218\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e00\u4e9b\u8fd9\u6837\u90a3\u6837\u7684\u95ee\u9898\uff0c\u7136\u540e\u8981\u5361\u597d\u534a\u5929\uff0c\u7b49\u95ee\u9898\u89e3\u51b3\u4e86\u624d\u53d1\u73b0\u539f\u6765\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u662f\u6ca1\u6709\u638c\u63e1\u597d\u3002\u4eca\u5929golang\u5b66\u4e60\u7f51\u5c31\u6574\u7406\u5206\u4eab\u300a\u5229\u7528Redis\u5b9e\u73b0\u9632\u6b62\u63a5\u53e3\u91cd\u590d\u63d0\u4ea4\u529f\u80fd\u300b\uff0c\u804a\u804a\u91cd\u590d\u3001redis\u63a5\u53e3\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u52a9\u5230\u6b63\u5728\u52aa\u529b\u8d5a\u94b1\u7684\u4f60\u3002<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20221230\/167240431163aedd57e49b9.jpg\" class=\"aligncenter\"><\/p>\n<p>\u8fd9\u4e0b\u9c7c\u4e5f\u6478\u4e0d\u4e86\u4e86\uff0c\u53ea\u80fd\u53bb\u770b\u770b\u53d1\u751f\u4e86\u4ec0\u4e48\u4e8b\u60c5\u3002\u636e\u7528\u6237\u53cd\u6620\uff0c\u5f53\u65f6\u7f51\u7edc\u6709\u70b9\u5361\uff0c\u6240\u4ee5\u591a\u70b9\u4e86\u51e0\u6b21\u63d0\u4ea4\uff0c\u6700\u540e\u53d1\u73b0\u51fa\u73b0\u4e86\u5341\u51e0\u6761\u4e00\u6837\u7684\u6570\u636e\u3002<\/p>\n<p>\u53ea\u80fd\u8bf4\u73b0\u5728\u7684\u4eba\u90fd\u592a\u5fc3\u6025\u4e86\uff0c\u8fde\u8fd9\u51e0\u79d2\u7684\u65f6\u95f4\u90fd\u7b49\u4e0d\u4e86\uff0c\u60ef\u7684\u3002\u5fc3\u91cc\u5410\u69fd\u5f52\u5410\u69fd\uff0c\u8fd9\u95ee\u9898\u8fd8\u662f\u8981\u89e3\u51b3\u7684\uff0c\u4e0d\u7136\u8001\u677f\u53ef\u4e0d\u60ef\u6211\u3002<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20221230\/167240431263aedd5839f24.png\" class=\"aligncenter\"><\/p>\n<p>\u5176\u5b9e\u60f3\u60f3\u5c31\u77e5\u9053\u4e3a\u5565\u4f1a\u8fd9\u6837\uff0c\u5728\u7f51\u7edc\u5ef6\u8fdf\u7684\u65f6\u5019\uff0c\u7528\u6237\u591a\u6b21\u70b9\u51fb\uff0c\u6700\u540e\u8fd9\u51e0\u6b21\u8bf7\u6c42\u90fd\u53d1\u9001\u5230\u4e86\u670d\u52a1\u5668\u8bbf\u95ee\u76f8\u5173\u7684\u63a5\u53e3\uff0c\u6700\u540e\u6267\u884c\u63d2\u5165\u3002<\/p>\n<p>\u65e2\u7136\u77e5\u9053\u4e86\u539f\u56e0\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\u3002\u5f53\u65f6\u6211\u7684\u7b2c\u4e00\u60f3\u6cd5\u5c31\u662f\u7528<strong>\u6ce8\u89e3 + AOP<\/strong>\u3002\u901a\u8fc7\u5728\u81ea\u5b9a\u4e49\u6ce8\u89e3\u91cc\u5b9a\u4e49\u4e00\u4e9b\u76f8\u5173\u7684\u5b57\u6bb5\uff0c\u6bd4\u5982\u8fc7\u671f\u65f6\u95f4\u5373\u8be5\u65f6\u95f4\u5185\u540c\u4e00\u7528\u6237\u4e0d\u80fd\u91cd\u590d\u63d0\u4ea4\u8bf7\u6c42\u3002\u7136\u540e\u628a\u6ce8\u89e3\u6309\u9700\u52a0\u5728\u63a5\u53e3\u4e0a\uff0c\u6700\u540e\u5728\u62e6\u622a\u5668\u91cc\u5224\u65ad\u63a5\u53e3\u4e0a\u662f\u5426\u6709\u8be5\u63a5\u53e3\uff0c\u5982\u679c\u5b58\u5728\u5219\u62e6\u622a\u3002<\/p>\n<p>\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\u90a3\u8fd8\u9700\u8981\u89e3\u51b3\u53e6\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u600e\u4e48\u5224\u65ad\u5f53\u524d\u7528\u6237\u9650\u5b9a\u65f6\u95f4\u5185\u8bbf\u95ee\u4e86\u5f53\u524d\u63a5\u53e3\u3002\u5176\u5b9e\u8fd9\u4e2a\u4e5f\u7b80\u5355\uff0c\u53ef\u4ee5\u4f7f\u7528Redis\u6765\u505a\uff0c\u7528\u6237\u540d + \u63a5\u53e3 + \u53c2\u6570\u5565\u7684\u4f5c\u4e3a\u552f\u4e00\u952e\uff0c\u7136\u540e\u8fd9\u4e2a\u952e\u7684\u8fc7\u671f\u65f6\u95f4\u8bbe\u7f6e\u4e3a\u6ce8\u89e3\u91cc\u8fc7\u671f\u5b57\u6bb5\u7684\u503c\u3002\u8bbe\u7f6e\u4e00\u4e2a\u8fc7\u671f\u65f6\u95f4\u53ef\u4ee5\u8ba9\u952e\u8fc7\u671f\u81ea\u52a8\u91ca\u653e\uff0c\u4e0d\u7136\u5982\u679c\u7ebf\u7a0b\u7a81\u7136\u6b47\u903c\uff0c\u8be5\u63a5\u53e3\u5c31\u4e00\u76f4\u4e0d\u80fd\u8bbf\u95ee\u3002<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20221230\/167240431263aedd587dd30.png\" class=\"aligncenter\"><\/p>\n<p>\u8fd9\u6837\u8fd8\u9700\u8981\u6ce8\u610f\u7684\u4e00\u4e2a\u95ee\u9898\u662f\uff0c\u5982\u679c\u4f60\u5148\u53bbRedis\u83b7\u53d6\u8fd9\u4e2a\u952e\uff0c\u7136\u540e\u5224\u65ad\u8fd9\u4e2a\u952e\u4e0d\u5b58\u5728\u5219\u8bbe\u7f6e\u952e\uff1b\u5b58\u5728\u5219\u8bf4\u660e\u8fd8\u6ca1\u5230\u8bbf\u95ee\u65f6\u95f4\uff0c\u8fd4\u56de\u63d0\u793a\u3002\u8fd9\u4e2a\u601d\u8def\u662f\u6ca1\u9519\u7684\uff0c\u4f46\u8fd9\u6837\u5982\u679c\u83b7\u53d6\u548c\u8bbe\u7f6e\u5206\u6210\u4e24\u4e2a\u64cd\u4f5c\uff0c\u5c31\u4e0d\u6ee1\u8db3\u539f\u5b50\u6027\u4e86\uff0c\u90a3\u4e48\u5728\u591a\u7ebf\u7a0b\u4e0b\u662f\u4f1a\u51fa\u9519\u7684\u3002\u6240\u4ee5\u8fd9\u6837\u9700\u8981\u628a\u4fe9\u64cd\u4f5c\u53d8\u6210\u4e00\u4e2a\u539f\u5b50\u64cd\u4f5c\u3002<\/p>\n<p>\u5206\u6790\u597d\u4e86\uff0c\u5c31\u5f00\u5e72\u3002<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20221230\/167240431363aedd59018d2.jpg\" class=\"aligncenter\"><\/p>\n<h2>1\u3001\u81ea\u5b9a\u4e49\u6ce8\u89e3<\/h2>\n<pre>\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\/**\n * \u9632\u6b62\u540c\u65f6\u63d0\u4ea4\u6ce8\u89e3\n *\/\n@Target({ElementType.PARAMETER, ElementType.METHOD})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface NoRepeatCommit {\n    \/\/ key\u7684\u8fc7\u671f\u65f6\u95f43s\n    int expire() default 3;\n}\n<\/pre>\n<p>\u8fd9\u91cc\u4e3a\u4e86\u7b80\u5355\u4e00\u70b9\uff0c\u53ea\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5b57\u6bb5<code>expire<\/code>\uff0c\u9ed8\u8ba4\u503c\u4e3a3\uff0c\u53733s\u5185\u540c\u4e00\u7528\u6237\u4e0d\u5141\u8bb8\u91cd\u590d\u8bbf\u95ee\u540c\u4e00\u63a5\u53e3\u3002\u4f7f\u7528\u7684\u65f6\u5019\u4e5f\u53ef\u4ee5\u4f20\u5165\u81ea\u5b9a\u4e49\u7684\u503c\u3002<\/p>\n<p>\u6211\u4eec\u53ea\u9700\u8981\u5728\u5bf9\u5e94\u7684\u63a5\u53e3\u4e0a\u6dfb\u52a0\u8be5\u6ce8\u89e3\u5373\u53ef<\/p>\n<pre>\n@NoRepeatCommit\n\u6216\u8005\n@NoRepeatCommit(expire = 10)\n<\/pre>\n<h2>2\u3001\u81ea\u5b9a\u4e49\u62e6\u622a\u5668<\/h2>\n<p>\u81ea\u5b9a\u4e49\u597d\u4e86\u6ce8\u89e3\uff0c\u90a3\u5c31\u8be5\u5199\u62e6\u622a\u5668\u4e86\u3002<\/p>\n<pre>\n@Aspect\npublic class NoRepeatSubmitAspect {\n    private static Logger _log = LoggerFactory.getLogger(NoRepeatSubmitAspect.class);\n    RedisLock redisLock = new RedisLock();\n\n    @Pointcut(\"@annotation(com.zheng.common.annotation.NoRepeatCommit)\")\n    public void point() {}\n\n    @Around(\"point()\")\n    public Object doAround(ProceedingJoinPoint pjp) throws Throwable {\n        \/\/ \u83b7\u53d6request\n        RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();\n        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) requestAttributes;\n        HttpServletRequest request = servletRequestAttributes.getRequest();\n        HttpServletResponse responese = servletRequestAttributes.getResponse();\n        Object result = null;\n\n        String account = (String) request.getSession().getAttribute(UpmsConstant.ACCOUNT);\n        User user = (User) request.getSession().getAttribute(UpmsConstant.USER);\n        if (StringUtils.isEmpty(account)) {\n            return pjp.proceed();\n        }\n\n        MethodSignature signature = (MethodSignature) pjp.getSignature();\n        Method method = signature.getMethod();\n        NoRepeatCommit form = method.getAnnotation(NoRepeatCommit.class);\n\n        String sessionId = request.getSession().getId() + \"|\" + user.getUsername();\n        String url = ObjectUtils.toString(request.getRequestURL());\n        String pg = request.getMethod();\n        String key = account + \"_\" + sessionId + \"_\" + url + \"_\" + pg;\n        int expire = form.expire();\n        if (expire \n\n<p>\u62e6\u622a\u5668\u5b9a\u4e49\u7684\u5207\u70b9\u662f<code>NoRepeatCommit<\/code>\u6ce8\u89e3\uff0c\u6240\u4ee5\u88ab<code>NoRepeatCommit<\/code>\u6ce8\u89e3\u6807\u6ce8\u7684\u63a5\u53e3\u5c31\u4f1a\u8fdb\u5165\u8be5\u62e6\u622a\u5668\u3002\u8fd9\u91cc\u6211\u4f7f\u7528\u4e86<code>account + \"_\" + sessionId + \"_\" + url + \"_\" + pg<\/code>\u4f5c\u4e3a\u552f\u4e00\u952e\uff0c\u8868\u793a\u67d0\u4e2a\u7528\u6237\u8bbf\u95ee\u67d0\u4e2a\u63a5\u53e3\u3002<\/p>\n<p>\u8fd9\u6837\u6bd4\u8f83\u5173\u952e\u7684\u4e00\u884c\u662f<code>boolean isSuccess = redisLock.tryLock(key, key + sessionId, expire);<\/code>\u3002\u53ef\u4ee5\u770b\u770b<code>RedisLock<\/code>\u8fd9\u4e2a\u7c7b\u3002<\/p>\n<h2>3\u3001Redis\u5de5\u5177\u7c7b<\/h2>\n<p>\u4e0a\u9762\u8ba8\u8bba\u8fc7\u4e86\uff0c\u83b7\u53d6\u9501\u548c\u8bbe\u7f6e\u9501\u9700\u8981\u505a\u6210\u539f\u5b50\u64cd\u4f5c\uff0c\u4e0d\u7136\u5e76\u53d1\u73af\u5883\u4e0b\u4f1a\u51fa\u95ee\u9898\u3002\u8fd9\u91cc\u53ef\u4ee5\u4f7f\u7528Redis\u7684<code>SETNX<\/code>\u547d\u4ee4\u3002<\/p>\n\n<pre>\n\/**\n * redis\u5206\u5e03\u5f0f\u9501\u5b9e\u73b0\n * Lua\u8868\u8fbe\u5f0f\u4e3a\u4e86\u4fdd\u6301\u6570\u636e\u7684\u539f\u5b50\u6027\n *\/\npublic class RedisLock {\n\n    \/**\n     * redis \u9501\u6210\u529f\u6807\u8bc6\u5e38\u91cf\n     *\/\n    private static final Long RELEASE_SUCCESS = 1L;\n    private static final String SET_IF_NOT_EXIST = \"NX\";\n    private static final String SET_WITH_EXPIRE_TIME = \"EX\";\n    private static final String LOCK_SUCCESS= \"OK\";\n    \/**\n     * \u52a0\u9501 Lua \u8868\u8fbe\u5f0f\u3002\n     *\/\n    private static final String RELEASE_TRY_LOCK_LUA =\n            \"if redis.call('setNx',KEYS[1],ARGV[1]) == 1 then return redis.call('expire',KEYS[1],ARGV[2]) else return 0 end\";\n    \/**\n     * \u89e3\u9501 Lua \u8868\u8fbe\u5f0f.\n     *\/\n    private static final String RELEASE_RELEASE_LOCK_LUA =\n            \"if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end\";\n\n    \/**\n     * \u52a0\u9501\n     * \u652f\u6301\u91cd\u590d\uff0c\u7ebf\u7a0b\u5b89\u5168\n     * \u65e2\u7136\u6301\u6709\u9501\u7684\u7ebf\u7a0b\u5d29\u6e83\uff0c\u4e5f\u4e0d\u4f1a\u53d1\u751f\u6b7b\u9501\uff0c\u56e0\u4e3a\u9501\u5230\u671f\u4f1a\u81ea\u52a8\u91ca\u653e\n     * @param lockKey    \u52a0\u9501\u952e\n     * @param userId     \u52a0\u9501\u5ba2\u6237\u7aef\u552f\u4e00\u6807\u8bc6\uff08\u91c7\u7528\u7528\u6237id, \u9700\u8981\u628a\u7528\u6237 id \u8f6c\u6362\u4e3a String \u7c7b\u578b\uff09\n     * @param expireTime \u9501\u8fc7\u671f\u65f6\u95f4\n     * @return OK \u5982\u679ckey\u88ab\u8bbe\u7f6e\u4e86\n     *\/\n    public boolean tryLock(String lockKey, String userId, long expireTime) {\n        Jedis jedis = JedisUtils.getInstance().getJedis();\n        try {\n            jedis.select(JedisUtils.index);\n            String result = jedis.set(lockKey, userId, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, expireTime);\n            if (LOCK_SUCCESS.equals(result)) {\n                return true;\n            }\n        } catch (Exception e) {\n            e.printStackTrace();\n        } finally {\n            if (jedis != null)\n                jedis.close();\n        }\n\n        return false;\n    }\n\n    \/**\n     * \u89e3\u9501\n     * \u4e0e tryLock \u76f8\u5bf9\u5e94\uff0c\u7528\u4f5c\u91ca\u653e\u9501\n     * \u89e3\u9501\u5fc5\u987b\u4e0e\u52a0\u9501\u662f\u540c\u4e00\u4eba\uff0c\u5176\u4ed6\u4eba\u62ff\u5230\u9501\u4e5f\u4e0d\u53ef\u4ee5\u89e3\u9501\n     *\n     * @param lockKey \u52a0\u9501\u952e\n     * @param userId  \u89e3\u9501\u5ba2\u6237\u7aef\u552f\u4e00\u6807\u8bc6\uff08\u91c7\u7528\u7528\u6237id, \u9700\u8981\u628a\u7528\u6237 id \u8f6c\u6362\u4e3a String \u7c7b\u578b\uff09\n     * @return\n     *\/\n    public boolean releaseLock(String lockKey, String userId) {\n        Jedis jedis = JedisUtils.getInstance().getJedis();\n        try {\n            jedis.select(JedisUtils.index);\n            Object result = jedis.eval(RELEASE_RELEASE_LOCK_LUA, Collections.singletonList(lockKey), Collections.singletonList(userId));\n            if (RELEASE_SUCCESS.equals(result)) {\n                return true;\n            }\n        } catch (Exception e) {\n            e.printStackTrace();\n        } finally {\n            if (jedis != null)\n                jedis.close();\n        }\n\n        return false;\n    }\n}\n<\/pre>\n<p>\u5728\u52a0\u9501\u7684\u65f6\u5019\uff0c\u6211\u4f7f\u7528\u4e86<code>String result = jedis.set(lockKey, userId, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, expireTime);<\/code>\u3002set\u65b9\u6cd5\u5982\u4e0b<\/p>\n<pre>\n\/* Set the string value as value of the key. The string can't be longer than 1073741824 bytes (1 GB).\nParams:\n\t\tkey \u2013\n\t\tvalue \u2013\n\t\tnxxx \u2013 NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the \t\tkey if it already exist.\n\t\texpx \u2013 EX|PX, expire time units: EX = seconds; PX = milliseconds\n\t\ttime \u2013 expire time in the units of expx\nReturns: Status code reply\n*\/\npublic String set(final String key, final String value, final String nxxx, final String expx,\n      final long time) {\n    checkIsInMultiOrPipeline();\n    client.set(key, value, nxxx, expx, time);\n    return client.getStatusCodeReply();\n  }\n<\/pre>\n<p>\u5728key\u4e0d\u5b58\u5728\u7684\u60c5\u51b5\u4e0b\uff0c\u624d\u4f1a\u8bbe\u7f6ekey\uff0c\u8bbe\u7f6e\u6210\u529f\u5219\u8fd4\u56deOK\u3002\u8fd9\u6837\u5c31\u505a\u5230\u4e86\u67e5\u8be2\u548c\u8bbe\u7f6e\u539f\u5b50\u6027\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u8fd9\u91cc\u5728\u4f7f\u7528\u5b8cjedis\uff0c\u9700\u8981\u8fdb\u884cclose\uff0c\u4e0d\u7136\u8017\u5c3d\u8fde\u63a5\u6570\u5c31\u5b8c\u86cb\u4e86\uff0c\u6211\u4e0d\u4f1a\u544a\u8bc9\u4f60\u6211\u628a\u670d\u52a1\u5668\u641e\u6302\u4e86\u3002<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20221230\/167240431363aedd5947b22.jpg\" class=\"aligncenter\"><\/p>\n<h2>4\u3001\u5176\u4ed6\u60f3\u8bf4\u7684<\/h2>\n<p>\u5176\u5b9e\u505a\u5b8c\u8fd9\u4e09\u6b65\u5dee\u4e0d\u591a\u4e86\uff0c\u57fa\u672c\u591f\u7528\u3002\u518d\u8003\u8651\u4e00\u4e9b\u5176\u4ed6\u60c5\u51b5\u7684\u8bdd\uff0c\u6bd4\u5982\u5728expire\u8bbe\u7f6e\u7684\u65f6\u95f4\u5185\uff0c\u6211\u8fd9\u4e2a\u63a5\u53e3\u8fd8\u6ca1\u6267\u884c\u5b8c\u903b\u8f91\u548b\u529e\u5462\uff1f<\/p>\n<p>\u5176\u5b9e\u6211\u4eec\u4e0d\u7528\u81ea\u5df1\u5728\u8fd9\u6574\u7834\u8f6e\u5b50\uff0c\u76f4\u63a5\u7528\u5065\u58ee\u7684\u8f6e\u5b50\u4e0d\u597d\u5417\uff1f\u6bd4\u5982<code>Redisson<\/code>\uff0c\u6765\u5b9e\u73b0\u5206\u5e03\u5f0f\u9501\uff0c\u90a3\u4e48\u4e0a\u9762\u7684\u95ee\u9898\u5c31\u4e0d\u7528\u8003\u8651\u4e86\u3002\u6709\u770b\u95e8\u72d7\u6765\u5e2e\u4f60\u505a\uff0c\u5728\u952e\u8fc7\u671f\u7684\u65f6\u5019\uff0c\u5982\u679c\u68c0\u67e5\u5230\u952e\u8fd8\u88ab\u7ebf\u7a0b\u6301\u6709\uff0c\u90a3\u4e48\u5c31\u4f1a\u91cd\u65b0\u8bbe\u7f6e\u952e\u7684\u8fc7\u671f\u65f6\u95f4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5229\u7528Redis\u5b9e\u73b0\u9632\u6b62\u63a5\u53e3\u91cd\u590d\u63d0&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-201163","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/201163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=201163"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/201163\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=201163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=201163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=201163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}