Elasticsearch、Easy-es 快速入门 SearchAfterPage分页 若依前后端分离 Ruoyi-Vue SpringBoot

news2025/3/1 6:42:09

一、环境安装

Elasticsearch
ik分词器

1.1 下载解压Elasticsearch-7.x版本,越高越好,低版本有Log4j漏洞,Easy-es目前支持7.x
1.2 IK中文分词器

将对应Elasticsearch版本IK放进文件夹,Elasticsearch-7.6.1,ik对应版本就是7.6.1,不配置分词器,会将国家 解析为国、家。
在这里插入图片描述

1.3 运行Elasticsearch

在这里插入图片描述

1.4查看运行状态
http://127.0.0.1:9200/

在这里插入图片描述

1.5 修改密码(正式环境)

Elasticsearch7.x——设置用户密码认证

Multi Elasticsearch Head密码连接

http://127.0.0.1:9200/?auth_user=elastic&auth_password=xxx
1.6 使用可视化连接工具

需求简单,我用谷歌浏览器插件足够了 Multi Elasticsearch Head

在这里插入图片描述

二、可视化工具检索数据

2.1 查看表数据

在这里插入图片描述

2.2 查询数据

查询 标题包含中国通史的数据
在这里插入图片描述

三、Easy-es

easy-es官网

3.1 pom文件
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>easy-es支持版本</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
            <version>ES版本</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
          <version>ES版本</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.easy-es</groupId>
            <artifactId>easy-es-boot-starter</artifactId>
            <version>easy-es支持版本</version>
        </dependency>
3.2 springboot配置
easy-es:
  enable: true #默认为true,若为false则认为不启用本框架
  address : 60.205.186.155:9200 # es的连接地址,必须含端口 若为集群,则可以用逗号隔开 例如:127.0.0.1:9200,127.0.0.2:9200
  username: elastic #若无 则可省略此行配置
  password:  #若无 则可省略此行配置
3.4 实体类
package com.huida.framework.es.domain;

import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;


/**
 * titleContent
 */
@Data
@IndexName("title_content")
public class EsTitleContent {

    /**
     * es中的唯一id
     */
    @IndexId(type = IdType.UUID)
    private String id;

    /**
     * mysql主键
     */
    private String businessId;

    /**
     * mysql表名
     */
    private String tableName;

    /**
     * 跳转页面
     */
    private String pages;


    /**
     * 标题
     */
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String title;

    /**
     * 内容
     */
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String content;


}

3.5 mapper
package com.huida.framework.es.mapper;


import com.huida.framework.es.domain.EsTitleContent;
import org.dromara.easyes.core.core.BaseEsMapper;

/**
 * Mapper
 * <p>
 * Copyright © 2021 xpc1024 All Rights Reserved
 **/
public interface EsTitleContentMapper extends BaseEsMapper<EsTitleContent> {

}

3.6 springboot包扫描
@EsMapperScan("com.huida.es.mapper")
3.7 查询实体
package com.huida.framework.es.domain;

import lombok.Data;
import lombok.NonNull;

import java.util.List;

@Data
public class EsTitleContentQuery {

    /**
     * 每页的数量
     */
    private Integer pageSize;
    /**
     * 总页数
     */
    private Integer pageNum;
    /**
     * 下一页sort
     */
    private List<Object> nextSearchAfter;

    /**
     * 搜索关键字
     */
    private String keyword;

}

3.8 业务实现代码,查询,初始化数据
    public void selectTrainingCourseToEs() {
        List<TrainingCourse> trainingCourseList = trainingCourseService.selectTrainingCourseToEs();
        List<EsTitleContent> esTitleContentList = new ArrayList<>(trainingCourseList.size() * 2);
        EsTitleContent item = null;
        for (TrainingCourse trainingCourse : trainingCourseList) {
            item = new EsTitleContent();
            item.setSystemType(trainingCourse.getSystemType());
            item.setTitle(trainingCourse.getClassName());
            if (StringUtils.isNotBlank(trainingCourse.getContent())) {
                //用hutool工具类会保存(空格字符 &nbsp; &ensp; &emsp;
                item.setContent(Jsoup.parse(trainingCourse.getContent()).text());
            }
            item.setBusinessId(trainingCourse.getRecordId());
            item.setTableName("training_course_new");
            if (StringUtils.equals(trainingCourse.getType(), "1")) {
                item.setModule("同心培训");
            } else {
                item.setModule("同心活动");
            }
            item.setDataJsonStr(JSON.toJSONString(trainingCourse));
            esTitleContentList.add(item);
        }
        batchInsert(esTitleContentList);
    }

    public boolean createIndex() {
        // 1.初始化-> 创建索引(相当于mysql中的表)
        return esTitleContentMapper.createIndex();
    }


    public void deleteAllData() {
        Wrapper<EsTitleContent> esTitleContentWrapper = new LambdaEsQueryWrapper<>();
        esTitleContentMapper.delete(esTitleContentWrapper);
    }


    public void batchInsert(List<EsTitleContent> list) {
        if (CollectionUtil.isNotEmpty(list)){
            esTitleContentMapper.insertBatch(list);
        }
    }

    public SAPageInfo<EsTitleContent> search(EsTitleContentQuery esTitleContentQuery) {
        LambdaEsQueryWrapper<EsTitleContent> wrapper = new LambdaEsQueryWrapper<>();
        wrapper.sortByScore(SortOrder.DESC);
        wrapper.orderByDesc(EsTitleContent::getId);
//        wrapper.eq(EsTitleContent::getSystemType, "bgtx");
        //SQL搜索
        if (StringUtils.isNotBlank(esTitleContentQuery.getKeyword())) {
            wrapper.and(i -> i.match(EsTitleContent::getTitle, esTitleContentQuery.getKeyword(), 10f)
                    .or().match(EsTitleContent::getContent, esTitleContentQuery.getKeyword(), 5f));
            return esTitleContentMapper.searchAfterPage(wrapper, esTitleContentQuery.getNextSearchAfter(), esTitleContentQuery.getPageSize());
        }
        return new SAPageInfo<>();
    }

3.9 前端调用查询
{
    "pageNum": 1,
    "pageSize": 10,
    "keyword": "2024",
    "nextSearchAfter": null
}


// {
//     "pageNum": 2,
//     "pageSize": 10,
//     "keyword": "2024",
//     "nextSearchAfter": [
//             "3b5332ed-7a9b-4ee5-b31a-1c5eadbd519a"
//         ]
// }

四、前端搜索组件

在这里插入图片描述

<template>
  <view class="container">
    <view class="search-header">
      <view class="input-box">
        <view class="cuIcon-search"></view>
        <input name="input" class="keyword" :focus="true" v-model="queryParams.keyword"
               @input="inputChange" @focus="inputFocus" @confirm="onKeywordConfirm"
               :placeholder="defaultKeyword.keyword" confirm-type="search"/>
        <text v-if="queryParams.keyword" class="cuIcon-close del" @tap="clearKeyword"></text>
      </view>
      <view class="right" @tap="closeSearch">取消</view>
    </view>
    <view class="search-result" v-if="searchResultOpen && searchResultList">
      <u-cell-group>
        <view class="result-box">
          <view class="result-item" v-for="item in searchResultList" :key="item.id" @click="clickResult(item)">
            <text class="train-type">
              {{ item.module }}
            </text>
            <view class="title u-line-1" v-html="item.title"></view>
            <view v-html="item.content"></view>
          </view>
        </view>
      </u-cell-group>
    </view>
    <view class="search-result-empty" v-if="searchResultOpen  && searchResultList.length===0">
      <image class="icon" :src="`${TrainFileBasUrl}/app_resource/portal/static/images/zgt/search.png`"></image>
      <text class="text">换个关键词试试</text>
    </view>
    <view class="padding-tb" v-if="searchResultOpen && searchResultList.length>0">
      <u-loadmore :status="loadStatus" :load-text="loadText"/>
    </view>


  </view>
</template>

<script>
import tools from '@/commons/tools.js';

export default {
  data() {
    return {
      queryParams: {
        keyword: '',
        pageNum: 1,
        pageSize: 10,
        nextSearchAfter: null,
        hasData: true
      },
      //搜索结果展示
      searchResultOpen: false,
      //搜索结果
      searchResultList: [],
      //帮助搜索词
      helpKeyword: [],
      //历史搜索词
      historyKeyword: [],
      //默认搜索词
      defaultKeyword: '',
      //热门搜索词
      hotKeyword: [],
      //过滤搜索结果
      categoryFilter: false,
      filterCategory: [],
      //排序字段
      currentSortType: 'default',
      //排序方式
      currentSortOrder: 'desc',
      loadStatus: 'loadmore',
      loadText: {
        loadmore: '加载更多',
        loading: '正在加载...',
        nomore: '没有更多数据了'
      },

    }
  },
  onReachBottom() {
    if (this.queryParams.hasData) {
      this.queryParams.pageNum += 1
      this.getSearchResultList()
    }
  },
  onShow() {
    tools.checkSession()
  },
  methods: {
    clickResult: function (item) {
     if (item.tableName === 'tz_ly_book') {
          tools.openPage('/pagesBook/pages/book/view', item.title, {
            id: item.businessId
          });
        }
    },
    closeSearch: function () {
      tools.back()
    },
    clearKeyword: function () {
      this.queryParams = {
        keyword: '',
        pageNum: 1,
        pageSize: 10,
        nextSearchAfter: null,
        hasData: true
      }
      this.searchResultOpen = false
      this.searchResultList = []
    },
    inputFocus: function () {
      this.searchResultOpen = false
      this.searchResultList = []
      if (this.keyword) {
        this.getHelpKeyword();
      }
    },
    inputChange: function (e) {
      this.keyword = e.detail.value
      this.searchResultOpen = false
      this.getHelpKeyword();
    },
    onKeywordConfirm(event) {
      this.getSearchResult(event.detail.value);
    },
    getSearchResult(keyword) {
      this.keyword = keyword
      this.queryParams.pageNum = 1
      this.queryParams.nextSearchAfter = null
      this.getSearchResultList();
    },
    getSearchResultList() {
      this.loadStatus = 'loading';
      tools.post(tools.Server + '/es/titleContent/search', this.queryParams, {
        isPostData: true,
        showLoading: false
      }).then((res) => {
        if (res.success) {
          if (this.queryParams.pageNum < res.data.pages) {
            this.loadStatus = 'loadmore';
            this.queryParams.hasData = true;
            this.queryParams.nextSearchAfter = res.data.nextSearchAfter
          } else {
            this.loadStatus = 'nomore';
            this.queryParams.hasData = false;
          }
          if (res.data.list) {
            if (1 === this.queryParams.pageNum) {
              this.searchResultList = res.data.list
            } else {
              res.data.list.forEach(item => {
                this.searchResultList.push(item)
              })
            }
          }
          this.searchResultOpen = true
        }
      })
    },
    getSearchKeyword() {
      // let that = this;
      // util.request(api.SearchIndex).then(function(res) {
      //   if (res.errno === 0) {
      // that.historyKeyword = res.data.historyKeywordList
      // that.defaultKeyword = res.data.defaultKeyword
      // that.hotKeyword = res.data.hotKeywordList
      //   }
      // });
    },
    getHelpKeyword: function () {
      let that = this;
      // util.request(api.SearchHelper, {
      //   keyword: that.keyword
      // }).then(function(res) {
      //   if (res.errno === 0) {
      //     that.helpKeyword = res.data;
      //   }
      // });
    },
  },
  onLoad: function () {
    this.getSearchKeyword();
  }
}
</script>

<style lang="scss">
page {
  min-height: 100%;
  background-color: #f4f4f4;
}

.container {
  min-height: 100%;
  background-color: #f4f4f4;
}

.search-header {
  position: fixed;
  top: 44px;
  width: 750rpx;
  height: 91rpx;
  display: flex;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, .15);
  padding: 0 31.25rpx;
  font-size: 29rpx;
  color: #333;
}

.search-header .input-box {
  position: relative;
  margin-top: 16rpx;
  float: left;
  width: 0;
  flex: 1;
  height: 59rpx;
  line-height: 59rpx;
  padding: 0 20rpx;
  background: #f4f4f4;
}

.search-header .icon {
  position: absolute;
  top: 14rpx;
  left: 20rpx;
  width: 31rpx;
  height: 31rpx;
}

.search-header .del {
  position: absolute;
  top: 3rpx;
  right: 10rpx;
  width: 53rpx;
  height: 53rpx;
  z-index: 10;
}

.search-header .keyword {
  position: absolute;
  top: 0;
  left: 40rpx;
  width: 506rpx;
  height: 59rpx;
  padding-left: 30rpx;
}

.search-header .right {
  margin-top: 24rpx;
  margin-left: 31rpx;
  margin-right: 6rpx;
  width: 58rpx;
  height: 43rpx;
  line-height: 43rpx;
  float: right;
}

.search-result {
  margin-top: 90rpx;
}

.no-search {
  height: auto;
  overflow: hidden;
  margin-top: 91rpx;
}

.serach-keywords {
  background: #fff;
  width: 750rpx;
  height: auto;
  overflow: hidden;
  margin-bottom: 20rpx;
}

.serach-keywords .h {
  padding: 0 31.25rpx;
  height: 93rpx;
  line-height: 93rpx;
  width: 100%;
  color: #999;
  font-size: 29rpx;
}

.serach-keywords .title {
  display: block;
  width: 120rpx;
  float: left;
}

.serach-keywords .icon {
  margin-top: 19rpx;
  float: right;
  display: block;
  margin-left: 511rpx;
  height: 55rpx;
  width: 55rpx;
}

.serach-keywords .b {
  width: 750rpx;
  height: auto;
  overflow: hidden;
  padding-left: 31.25rpx;
}

.serach-keywords .item {
  display: inline-block;
  width: auto;
  height: 48rpx;
  line-height: 48rpx;
  padding: 0 15rpx;
  border: 1px solid #999;
  margin: 0 31.25rpx 31.25rpx 0;
  font-size: 24rpx;
  color: #333;
}

.serach-keywords .item.active {
  color: #b4282d;
  border: 1px solid #b4282d;
}

.shelper-list {
  width: 750rpx;
  height: auto;
  overflow: hidden;
  background: #fff;
  padding: 0 31.25rpx;
}

.shelper-list .item {
  height: 93rpx;
  width: 687.5rpx;
  line-height: 93rpx;
  font-size: 24rpx;
  color: #333;
  border-bottom: 1px solid #f4f4f4;
}


.search-result-empty {
  width: 100%;
  height: 100%;
  padding-top: 300rpx;
}

.search-result-empty .icon {
  margin: 0 auto;
  display: block;
  width: 240rpx;
  height: 240rpx;
}

.search-result-empty .text {
  display: block;
  width: 100%;
  height: 40rpx;
  font-size: 28rpx;
  text-align: center;
  color: #999;
}

.result-box {
  padding-bottom: 1px;

  .result-item {
    margin: 10px 12px;
    background-color: #f1f1f1;
    border-radius: 8px;
    padding: 10px;
    position: relative;
    overflow: hidden;

    .train-type {
      color: #F96345;
      border: 1px solid #F96345;
      border-radius: 4rpx;
      padding: 2px 5px;
    }

    .status-name {
      background-color: #FBB653;
      position: absolute;
      z-index: 1;
      top: 0px;
      right: 0px;
      color: #fff;
      font-size: 12px;
      padding: 4px 10px 3px;
      border-bottom-left-radius: 8px;
    }

    .title {
      color: #000;
      font-weight: 600;
      // font-size: 16px;
      padding: 8px 0;
    }

    .org,
    .date-time {
      // font-size: 14px;
      color: #878787;
      padding: 3px 0;
    }

    .state {
      position: absolute;
      right: 0;
      top: 40%;
      padding: 5px 15px;
      border-radius: 15px 0 0 15px;
      // color: #FBB653;
      // background-color: #FFF9F0;
    }

    .data-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 6px;

      .sign-up {
        background-color: #F1F1F1;
        padding: 4px 5px;
        // font-size: 13px;
        color: #97a2a4;
        border-radius: 3px;

        .number {
          color: #cb3f48;
          margin-left: 5px;
        }
      }

      .btn-box {
        display: flex;
        justify-content: flex-end;

        .cu-btn {
          margin-left: 10px;
        }
      }

    }


  }
}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2040348.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

GPT-SoVITS

文章目录 model archS1 ModelS2 model model arch S1 model: AR model–ssl tokensS2 model: VITS&#xff0c;ssl 已经是mel 长度线性相关&#xff0c;MRTE(ssl_codes_embs, text, global_mel_emb)模块&#xff0c;将文本加强相关&#xff0c;学到一个参考结果 S1 Model cla…

Lora 全文翻译

作者&#xff1a; 地点&#xff1a;hby 来源&#xff1a;https://arxiv.org/pdf/2106.09685 工具&#xff1a;文心 LORA: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS 摘要 自然语言处理的一个重要范式包括在通用领域数据上进行大规模预训练&#xff0c;并适应特定任务或…

Qt自定义控件:关于大佬“飞扬青云“的自定义UI控件的使用教程(MinGw,MSVC)

前言 最近在搞自定义控件&#xff0c;无意间发现大佬飞扬青云的开源项目&#xff0c;Qt/C编写超精美自定义控件 这里先贴出大佬项目地址和博客 码云&#xff1a;wwlzq5/qucsdk (gitee.com)&#xff08;旧版下载地址Qt4.7到Qt5.14&#xff09; github&#xff1a;https://git…

攻克面试:高频面试题与常见算法深度剖析

干货分享&#xff0c;感谢您的阅读&#xff01; &#xff08;暂存篇---后续会删除&#xff0c;完整版和持续更新见高频面试题基本总结回顾&#xff08;含笔试高频算法整理&#xff09;&#xff09; 备注&#xff1a;引用请标注出处&#xff0c;同时存在的问题请在相关博客留言…

第1章 大模型的概念、发展历程和应用领域

大模型&#xff1a;塑造未来的智能力量 目录 引言&#xff1a;大模型的定义与影响大模型的发展历程 早期探索&#xff1a;深度学习的起步中期发展&#xff1a;算法的革新与计算能力的提升当代突破&#xff1a;大模型的崛起 大模型的影响与未来展望 引言&#xff1a;大模型的定…

【设计模式】六大原则之依赖倒置原则(Dependency Inversion Principle,‌DIP)

设计模式是对相关问题提出的解决方案。 一般而言&#xff0c;一个模式有四个基本要素&#xff1a; 模式名称 &#xff08;pattern name&#xff09; 一个助记名&#xff0c;它用一两个词语来描述模式问题、解决方案和效果。问题&#xff08;problem&#xff09;描述了应该在何…

Unity中对Spine动画播放、暂停、事件处理管理类

Unity中对Spine动画播放、暂停、事件处理管理类 介绍Spine的事件处理动画师制作沟通Unity前端使用事件 Unity中动画播放Unity中动画暂定和继续Unity中停止动画Unity中动画转向Unity中获取骨骼和设置插槽附件完整管理类分享总结 介绍 最近在做设计spine动画的抖音小程序&#x…

RecyclerView的缓存机制(面试常客)

在构建滚动列表时&#xff0c;我们常首选RecyclerView&#xff0c;出于它优秀的缓存复用机制。 核心机制 RecyclerView的缓存机制又称回收复用机制&#xff0c;RecyclerView构建列表视图分为以下三步&#xff1a; 第一步的创建ViewHolder是RecyclerView构建视图时最耗时的操作…

鸿蒙(API 12 Beta3版)【使用通话设备切换组件】使用投播组件

基本概念 系统不再提供音频输出设备切换的API&#xff0c;如果需要应用内切换音频输出设备&#xff0c;请实现AVCastPicker组件&#xff0c;相关参数可参考[ohos.multimedia.avCastPicker]和 [ohos.multimedia.avCastPickerParam]。 本文将主要介绍AVCastPicker组件接入&…

【论文笔记】:PVswin-YOLOv8s:基于无人机的行人和车辆检测,使用改进的YOLOv8在智能城市中进行交通管理

摘要 在智慧城市中&#xff0c;有效的交通拥堵管理取决于熟练的行人和车辆检测。无人机 &#xff08;UAV&#xff09; 提供了一种具有移动性、成本效益和宽视野的解决方案&#xff0c;然而&#xff0c;优化识别模型对于克服小型和遮挡物体带来的挑战至关重要。为了解决这些问题…

推出 SAM 2:适用于视频和图像的下一代 Meta Segment Anything 模型

继图像元分割模型(SAM) 取得成功之后&#xff0c;我们发布了SAM 2&#xff0c;这是一个用于在图像和视频中实时提示对象分割的统一模型&#xff0c;可实现最先进的性能。 为了秉承我们的开放科学方针&#xff0c;我们通过宽松的 Apache 2.0 许可证共享代码和模型权重。 我们还…

嵌入式linux系统镜像制作day2

点击上方"蓝字"关注我们 01、前言 嵌入式linux系统镜像制作day1这一节先了解,后面实操 02、Yocto项目快速启动 Yocto项目通过OpenEmbedded构建系统为各种平台(包括x86-64和仿真平台)提供了一个针对ARM、MIPS、PowerPC和x86架构的开源开发环境。您可以使用Yocto项…

WebDeveloper:1靶机渗透测试

一、靶机下载地址 https://www.vulnhub.com/entry/web-developer-1,288/ 二、信息收集 1、主机发现 # 使用命令 nmap 192.168.145.0/24 -sn | grep -B 2 "00:0C:29:54:22:E9" 2、端口扫描 # 使用命令 nmap 192.168.145.216 -p- -sV 3、指纹识别 # 使用命令 wha…

【SpringCloud】什么是MQ

RabbitMQ 1.什么是MQ 1.1 同步和异步通信 微服务间通讯有同步和异步两种方式&#xff1a; 同步通讯&#xff1a;就例如打电话一样&#xff0c;需要实时响应异步通讯&#xff1a;就例如发邮件一样&#xff0c;不需要马上回复 1.1.1同步通讯 Feign的远程调用就属于同步通讯…

【数据分析】描述性统计分析 - 直方图

一、什么是直方图 由一批长方形构成&#xff0c;通过长方形的面积或高度来代表对应组在数据中所占的比例。用长方形的面积代表对应组的频数与组距的比时&#xff0c;则称为频率分布直方图;当用长方形的高代表对应组的频数时&#xff0c;则称为频数分布直方图。但严格统计意义上…

WT32-ETH01开发板模块,启明云端物联网方案,乐鑫ESP32多样化开发应用

在物联网(IoT)的浪潮中&#xff0c;无线Wi-Fi模块作为连接传统硬件与现代智能网络的桥梁&#xff0c;正逐渐成为智能家居和设备通信不可或缺的一部分。Wi-Fi模块也被称为串口Wi-Fi模块&#xff0c;是一种嵌入式模块&#xff0c;它能够将串口或TTL电平信号转换为符合Wi-Fi无线网…

普元EOS-多数据源时业务数据库初始化

1 问题 EOS开发应用的时候&#xff0c;可以采用多数据源。 项目启动的是时候报错如下&#xff1a; 2024-08-14 16:03:56.105 ERROR [EOS-DEMO-SYS,EOSLOWCODE,default,cuipengyu:EOSLOWCODE:28015,,,,] 28960 --- [Timer-0] c.p.g.a.a.m.RdcloudStatisticsThread : User…

66_1JSON【浏览器中处理JSON、Java中处理JSON(FastJSON、Jackson)】、Java中的bean

JSON 概念 JSON&#xff1a;JavaScript Object Notation是一种表示对象的方式 基于JavaScript语言的轻量级的数据交换格式;&#xff08;即:用来传输数据的一种格式&#xff09; 现在传输数据的方式更多是采用json的格式&#xff0c;渐渐代替了XML JSON的数据表示 JSON采用名值…

封装一个细粒度的限流器

文章目录 原因限流对象限流后的做法怎么确定限流阈值观测业务性能数据压测借鉴链路上的其他服务手动计算 四种静态限流算法令牌桶漏桶固定窗口与滑动窗口 手写限流算法令牌桶漏桶固定窗口滑动窗口 分布式限流的具体实现 原因 尽管云原生网关里有统一入口的限流&#xff08;根据…

股指期货套期保值中的展期管理有哪些?

在复杂的金融市场环境中&#xff0c;展期作为一种重要的风险管理工具&#xff0c;被广泛应用于期货交易中&#xff0c;特别是当投资者需要对长期资产进行套期保值时。展期的核心思想在于&#xff0c;通过连续替换高流动性的近月期货合约来替代流动性较差的远月合约&#xff0c;…