当前位置: 首页 > news >正文

惠州论坛网站建设营销推广与策划

惠州论坛网站建设,营销推广与策划,网站后台新闻不显示如何刷新,一级A做爰片秋欲浓网站前言 最近想着把大火的deepseek 迁移到小程序里,基于刷题小程序的数据库做一个RAG应用,来进一步扩展答案解析,帮助用户解答相关问题。但是由于之前做的项目都要老了,并不支持spring 的AI模块,因此,我打算先…

前言

最近想着把大火的deepseek 迁移到小程序里,基于刷题小程序的数据库做一个RAG应用,来进一步扩展答案解析,帮助用户解答相关问题。但是由于之前做的项目都要老了,并不支持spring 的AI模块,因此,我打算先升级一下系统。

一、升级JDK 1.8 到 JDK 17

1、首先从官网上下载一个JDK17的包,windows系统可能有这两种包(压缩包和安装包)

直接下载压缩包,放在一个中文目录下,然后修改环境变量。 

 然后看一下java版本 java --version 是否修改成功。

 修改项目中的设置 如下

 

二、升级Springboot 2.x 到 Springboot 3.x  

 修改pom文件

    <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.2.0</version><relativePath/></parent>
    <properties><java.version>17</java.version></properties>

这里面需要注意的东西还挺多的

1、javax.servlet.*相关的类找不到,需要切换依赖为jakarta.servlet。修改javax.servlet.*为jakarta.servlet.*。

		<!--jakarta.servlet start --><dependency><groupId>jakarta.servlet</groupId><artifactId>jakarta.servlet-api</artifactId></dependency><!--jakarta.servlet end -->

 2.、mybatis-plus-boot-starter

		<!-- mybatis-plus start--><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-spring-boot3-starter</artifactId><version>3.5.5</version></dependency><!-- mybatis-plus end-->

 3、redis

spring.data.redis.host=127.0.0.1
#Redis服务器连接端口
spring.data.redis.port=6379
#连接池最大连接数(使用负值表示没有限制)
spring.data.redis.lettuce.pool.max-active=20
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.data.redis.lettuce.pool.max-wait=-1
#连接池中的最大空闲连接
spring.data.redis.lettuce.pool.max-idle=5
#连接池中的最小空闲连接
spring.data.redis.lettuce.pool.min-idle=0
#连接超时时间(毫秒)
spring.data.redis.timeout=1800000

4、commons-pool2

Spring Boot 的 spring-boot-starter-data-redis 依赖了 Lettuce 作为 Redis 客户端。

Lettuce 依赖于 commons-pool2 来实现连接池功能。

因此我们也需要更新一下commons-pool2的版本。

        <dependency><groupId>org.apache.commons</groupId><artifactId>commons-pool2</artifactId><version>2.11.1</version></dependency>

4、Spring-Security 

咋WebSecurityConfig显示的注册authenticationManager为一个Bean

    @Beanpublic AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception {return config.getAuthenticationManager();}

使用SecurityFilterChain替代WebSecurityConfigurerAdapter;

@Beanpublic SecurityFilterChain securityFilterChain(HttpSecurity http,CustomizeAuthenticationEntryPoint customizeAuthenticationEntryPoint,CustomizeAccessDeniedHandler customizeAccessDeniedHandler) throws Exception {http.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)).authenticationProvider(thirdLoginAuthenticationProvider).authorizeHttpRequests(authorize -> authorize.requestMatchers("/swagger-resources/configuration/ui","/swagger-resources","/swagger-resources/configuration/security","/swagger-ui.html",).permitAll().anyRequest().authenticated()).exceptionHandling(exception -> exception.accessDeniedHandler(customizeAccessDeniedHandler).authenticationEntryPoint(customizeAuthenticationEntryPoint)).cors(cors -> cors.configure(http)).csrf(csrf -> csrf.disable());return http.build();}

Spring-Security 6.x的版本中,对于session的管理也发生了一些变化,需要手动将 SecurityContext 保存到 HttpSession 中。

        HttpSession session = request.getSession();session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, SecurityContextHolder.getContext());

修改到这里位置,就可以启动项目了。

http://www.tj-hxxt.cn/news/97069.html

相关文章:

  • 做废品交易看什么什么网站潍坊网站外包
  • 新沂网站建设公司武汉网站建设推广公司
  • 网站建设公司权威排名比百度好用的搜索引擎
  • 手机网站免费模板下载互联网营销培训
  • 网站建设对服务器有舍要求吗外贸营销型网站设计
  • 做灯箱的网站深圳百度推广开户
  • 网站群建设标准怎样在百度上注册自己的店铺
  • 网站建设免费的博客网
  • 商城网站建设好么活动推广软文范例
  • 网站建设的问题分析策划书模板
  • 深圳品牌网站建设服务百度云盘官网登录入口
  • 苏州市建设厅网站首页关键词seo公司真实推荐
  • wordpress 优秀插件百度seo发包工具
  • 永远网站建设域名注册网
  • 西安大型网站建设公司做竞价推广这个工作怎么样
  • 慧宇巅峰网络-烟台网站建设公司外链网站大全
  • 国家网站建设的相关规定营销网页
  • 为何要屏蔽网站快照网络营销服务工具
  • 在手机上自建网站怎么弄如何做好网络营销管理
  • 创建网站向导和模板百度百科查询
  • 成立中英文网站建设工作领导小组苏州网站外包
  • 做网站定金是多少钱网域名解析ip查询
  • 四川seo选哪家天津网站seo设计
  • 网站制作前景怎么样seo课程培训
  • 湖北住房和城乡建设厅网站黑科技推广软件
  • 青岛如何做网站seo大数据统计网站
  • 免费行情软件app网站直播seo需要什么技术
  • 泉州做网站优化公司重庆森林壁纸
  • 网站开发藏语网店营销策划方案
  • 公司网站建设建议书武汉网站提升排名