Lucent's Blog

Lucent's Blog

当时明月在 曾照彩云归


人生不相见,动如参与商。


SpringBoot

  1. 基于Spring RSocket体验ChatGPT

    2 min read
    ChatGPT · SpringBoot

    什么是 RSocket RSocket 是一个新的、语言无关的第七层应用网络协议。它是一个双向、多路复用、基于消息、基于反应流背压的二进制协议。 和传统网络编程模型 HTTP 的 Request/Response 方式不同。RSocket 除了 Request/Response 方式之外,还支持 Fire And Forget(发送不回)、Stream(单向流)、Channel(双向流)。 搭建项目 1.引入依赖 chatgpt-spring-

  2. SpringBoot常用注解大全

    10 min read
    SpringBoot

    平时使用SpringBoot开发项目,少不了要使用到它的注解。这些注解让我们摆脱了繁琐的传统Spring XML配置,让我们开发项目更加高效,今天我们就来聊聊SpringBoot中常用的注解! 组件相关注解 @Controller 用于修饰MVC中controller层的组件,SpringBoot中的组件扫描功能会识别到该注解,并为修饰的类实例化对象,通常与@RequestMapping联用,当SpringMVC获取到请求时会转发到指定路径的方法进行处理。 @Controller @RequestMapping("/admin") public class UmsAdminController { } @Service 用于修饰service层的组件,service层组件专注于系统业务逻辑的处理,同样会被组件扫描并生成实例化对象。 @Service public class UmsAdminServiceImpl implements UmsAdminService{ } @Repository 用于修饰dao层的组件,