SpringBoot入门 - 开发中还有哪些常用注解

5.2 Mybatis快速入门,轻松学会常用12种注解开发 通过 《上文》,我们完成了SpringBoot整合Mybatis,那么接下来,我们就来使用Mybatis访问MySQL数据库!MyBatis的强大在于它的语句映射,它提供了注解和XML映射两种方式,都是为了减少我们的使用成本,屏蔽JDBC代码细节,节省代码,从而让我们更专注于SQL代码!本文主要使用注解方式实现登录接口DAL层的UserMapper代码,并借此示例讲解Mybatis常用的12种注解用法,让新手轻松学会常用12种注解开发。 阅读详情
本文主要介绍一些SpringBoot中常用的注解。

Spring Boot 常用注解

@SpringBootApplication

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Configuration
@EnableAutoConfiguration
@ComponentScan
public @interface SpringBootApplication {

    /**
     * Exclude specific auto-configuration classes such that they will never be applied.
     * @return the classes to exclude
     */
    Class<?>[] exclude() default {};

}

定义在main方法入口类处,用于启动sping boot应用项目

@EnableAutoConfiguration

让spring boot根据类路径中的jar包依赖当前项目进行自动配置

在src/main/resources的META-INF/spring.factories

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration,\
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration

若有多个自动配置,用“,”隔开

@ImportResource

加载xml配置,一般是放在启动main类上

@ImportResource("classpath*:/spring/*.xml")  单个

@ImportResource({"classpath*:/spring/1.xml","classpath*:/spring/2.xml"})   多个

@Value

application.properties定义属性,直接使用@Value注入即可

public class A{
     @Value("${push.start:0}")    如果缺失,默认值为0
     private Long  id;
}

@ConfigurationProperties(prefix="person")

可以新建一个properties文件,ConfigurationProperties的属性prefix指定properties的配置的前缀,通过location指定properties文件的位置

@ConfigurationProperties(prefix="person")
public class PersonProperties {
    
    private String name ;
    private int age;
}

@EnableConfigurationProperties

用 @EnableConfigurationProperties注解使 @ConfigurationProperties生效,并从IOC容器中获取bean。

https://blog.youkuaiyun.com/u010502101/article/details/78758330

@RestController

组合@Controller和@ResponseBody,当你开发一个和页面交互数据的控制时,比如bbs-web的api接口需要此注解

@RequestMapping("/api2/copper")

用来映射web请求(访问路径和参数)、处理类和方法,可以注解在类或方法上。注解在方法上的路径会继承注解在类上的路径。

produces属性: 定制返回的response的媒体类型和字符集,或需返回值是json对象

@RequestMapping(value="/api2/copper",produces="application/json;charset=UTF-8",method = RequestMethod.POST)

@RequestParam

获取request请求的参数值

 public List<CopperVO> getOpList(HttpServletRequest request,
                                    @RequestParam(value = "pageIndex", required = false) Integer pageIndex,
                                    @RequestParam(value = "pageSize", required = false) Integer pageSize) {
 
  }

@ResponseBody

支持将返回值放在response体内,而不是返回一个页面。比如Ajax接口,可以用此注解返回数据而不是页面。此注解可以放置在返回值前或方法前。

另一个玩法,可以不用@ResponseBody。
继承FastJsonHttpMessageConverter类并对writeInternal方法扩展,在spring响应结果时,再次拦截、加工结果
// stringResult: json返回结果
//HttpOutputMessage outputMessage

 byte[] payload = stringResult.getBytes();
 outputMessage.getHeaders().setContentType(META_TYPE);
 outputMessage.getHeaders().setContentLength(payload.length);
 outputMessage.getBody().write(payload);
 outputMessage.getBody().flush();

@Bean

@Bean(name="bean的名字",initMethod="初始化时调用方法名字",destroyMethod="close")

定义在方法上,在容器内初始化一个bean实例类。

@Bean(destroyMethod="close")
@ConditionalOnMissingBean
public PersonService registryService() {
        return new PersonService();
    }

@Service

用于标注业务层组件

@Controller

用于标注控制层组件(如struts中的action)

@Repository

用于标注数据访问组件,即DAO组件

@Component

泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。

@PostConstruct

spring容器初始化时,要执行该方法

@PostConstruct  
public void init() {   
}   

@PathVariable

用来获得请求url中的动态参数

@Controller  
public class TestController {  

     @RequestMapping(value="/user/{userId}/roles/{roleId}",method = RequestMethod.GET)  
     public String getLogin(@PathVariable("userId") String userId,  
         @PathVariable("roleId") String roleId){
           
         System.out.println("User Id : " + userId);  
         System.out.println("Role Id : " + roleId);  
         return "hello";  
     
     }  
}

@ComponentScan

注解会告知Spring扫描指定的包来初始化Spring

@ComponentScan(basePackages = "com.bbs.xx")

@EnableZuulProxy

路由网关的主要目的是为了让所有的微服务对外只有一个接口,我们只需访问一个网关地址,即可由网关将所有的请求代理到不同的服务中。Spring Cloud是通过Zuul来实现的,支持自动路由映射到在Eureka Server上注册的服务。Spring Cloud提供了注解@EnableZuulProxy来启用路由代理。

@Autowired

在默认情况下使用 @Autowired 注释进行自动注入时,Spring 容器中匹配的候选 Bean 数目必须有且仅有一个。当找不到一个匹配的 Bean 时,Spring 容器将抛出 BeanCreationException 异常,并指出必须至少拥有一个匹配的 Bean。

当不能确定 Spring 容器中一定拥有某个类的 Bean 时,可以在需要自动注入该类 Bean 的地方可以使用 @Autowired(required = false),这等于告诉 Spring: 在找不到匹配 Bean 时也不报错

@Autowired注解注入map、list与@Qualifier

@Configuration

@Configuration("name")//表示这是一个配置信息类,可以给这个配置类也起一个名称
@ComponentScan("spring4")//类似于xml中的<context:component-scan base-package="spring4"/>
public class Config {

    @Autowired//自动注入,如果容器中有多个符合的bean时,需要进一步明确
    @Qualifier("compent")//进一步指明注入bean名称为compent的bean
    private Compent compent;

    @Bean//类似于xml中的<bean id="newbean" class="spring4.Compent"/>
    public Compent newbean(){
        return new Compent();
    }   
}

@Import(Config1.class)

导入Config1配置类里实例化的bean

@Configuration
public class CDConfig {

    @Bean   // 将SgtPeppers注册为 SpringContext中的bean
    public CompactDisc compactDisc() {
        return new CompactDisc();  // CompactDisc类型的
    }
}

@Configuration
@Import(CDConfig.class)  //导入CDConfig的配置
public class CDPlayerConfig {

    @Bean(name = "cDPlayer")
    public CDPlayer cdPlayer(CompactDisc compactDisc) {  
         // 这里会注入CompactDisc类型的bean
         // 这里注入的这个bean是CDConfig.class中的CompactDisc类型的那个bean
        return new CDPlayer(compactDisc);
    }
}

@Order

@Order(1),值越小优先级超高,越先运行

@ConditionalOnExpression

@Configuration
@ConditionalOnExpression("${enabled:false}")
public class BigpipeConfiguration {
    @Bean
    public OrderMessageMonitor orderMessageMonitor(ConfigContext configContext) {
        return new OrderMessageMonitor(configContext);
    }
}

开关为true的时候才实例化bean

@ConditionalOnProperty

这个注解能够控制某个 @Configuration 是否生效。具体操作是通过其两个属性name以及havingValue来实现的,其中name用来从application.properties中读取某个属性值,如果该值为空,则返回false;如果值不为空,则将该值与havingValue指定的值进行比较,如果一样则返回true;否则返回false。如果返回值为false,则该configuration不生效;为true则生效。

https://blog.youkuaiyun.com/dalangzhonghangxing/article/details/78420057

@ConditionalOnClass

该注解的参数对应的类必须存在,否则不解析该注解修饰的配置类

@Configuration
@ConditionalOnClass({Gson.class})
public class GsonAutoConfiguration {
    public GsonAutoConfiguration() {
    }

    @Bean
    @ConditionalOnMissingBean
    public Gson gson() {
        return new Gson();
    }
}

@ConditionalOnMisssingClass({ApplicationManager.class})

如果存在它修饰的类的bean,则不需要再创建这个bean;

@ConditionOnMissingBean(name = "example")

表示如果name为“example”的bean存在,该注解修饰的代码块不执行。

k8s重装1.28.2+calico+踩坑收集+InPlacePodVerticalScaling 它提供了从镜像构建(通过 Dockerfile)、镜像管理(上传、下载、存储等)、容器创建、运行、网络配置(可以为容器分配自定义的网络,如 bridge 网络、host 网络等)到容器编排(通过 Docker Compose 可以简单地编排多个容器的启动和关联关系)等一整套完整的解决方案。它的核心功能是启动和管理容器的生命周期。sudo apt update这个可以经常用,是来更新软件包的,它不下载,所以没风险,但是经常会报错,别问,问就是某种强大的力量,所以用镜像或者代理或者巴拉巴拉。 阅读详情

相关推荐

虚拟机ubuntu22.04.3中安装vitis2024.1注意事项

虚拟机ubuntu安装vitis2024.1

qq_52033578的博客 2497

Spring Boot入门(四):开发Web Api接口常用注解总结

在程序员的日常工作中,Web开发应该是占比很重的一部分,至少我工作以来,开发的系统基本都是Web端访问的系统,Web开发在这几年也是经历了很快的发展,前端也显得越来越重要,现在很多大一点的公司都实行前后端分离,让后端和前端只专注于自己的事,所谓术业有专攻,我个人也非常建议前后端分离。 既然前后端分离了,那么后端肯定需要提供Web Api接口给到前端,并返回前端需要的数据。 在Spring Boot...

weixin_33951761的博客 991

【β-Boltzmann探索策略】

𝜀是一个介于0和1之间的参数,用于控制探索和利用的比例。当𝜀较大时,智能体更倾向于探索;当𝜀较小时,智能体更倾向于利用已知信息。

m0_59385870的博客 1087

springboot开发入门和基本操作指南

<plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring−boot−maven−plugin</artifactId></plugin></plugins>

Hll098的博客 500

程序员应用AI大模型创业实现财务自由的100种赚钱方案原理与实战指南

成功的 AI 创业者都遵循着 “技术 + 需求 + 变现” 的铁三角法则。记住:不是要做 “全能大模型”,而是成为某个垂直领域的 “AI 解决方案专家”。现在就开始行动:用周末 2 小时完成第一个 MVP,下周启动种子用户测试,三个月内找到可复制的盈利模式。当你实现第一个 10 万用户时,会发现财务自由的密码藏在持续迭代的每个 0.1 版本更新中。延伸思考:你的技术背景适合切入哪个细分领域?

AI天才研究院 1382

9.6华为OD机试真题 新系统 - 少儿爬山闯关积分游戏 (Java/Py/C/C++/Js/Go)

2026 华为OD机试真题9月6日华为OD上机新系统考试真题 100 分题型。

算法大师! 860

SpringBoot入门教程:SpringBoot 常用注解

SpringBoot入门教程(三):SpringBoot 常用注解 一、基本介绍 @SpringBootApplication: 包含@Configuration、@EnableAutoConfiguration、@ComponentScan 通常用在主类上。 @Repository: 用于标注数据访问组件,即DAO组件。 @Service: 用于标注业务层组件。 @...

程序员资料站 756

【CAD二次开发】炸开所有的嵌套块

代码】【CAD二次开发】炸开所有的嵌套块。

1515

Spring Boot 4 集成:@AiService、多模型路由与多租户隔离

Spring Boot 4.1.x 与 LangChain4j 1.23.0 集成需规避多租户数据串扰、模型路由僵化与降级缺失三大陷阱。推荐采用“配置→路由→隔离→降级”四层架构,优先手动 @Bean 确保可控性。通过可配置的多模型路由策略(按场景、租户、成本、健康度)实现精准调度,并结合 Resilience4j 实现熔断与降级,辅以可观测性设计,保障系统稳定性与可维护性。

weixin_43128865的博客 362

【实战项目开发技术分享】如何设置机器人禁行区/虚拟墙

在现代机器人技术的日益发展中,路径规划是使机器人在复杂环境中安全、高效移动的关键部分。其中一个重要的问题是如何划定机器人的禁行区,以确保机器人不会进入危险区域或无法到达的地方。在本文中,我们将探讨一些关键策略,帮助机器人算法工程师更好地划定禁行区。代价地图可以通过多层叠加来实现,一般包括以下几个层级:静态地图层(Static Map Layer):由SLAM(Simultaneous Localization and Mapping)构建的静态地图。该层包含了环境中固定不变的地物信息,如墙壁、家具等。

xiewf的博客 1万+

【乐企-工具篇】有关乐企发票文件生成- OFD和PDF文件生成

有关乐企发票文件生成-OFD和PDF文件生成

九七的博客 2055

40 张表、20 层 e2e:把一个开源 Agent 平台迁到 Spring Boot 4.1

升级 BizBuddy 从 Spring Boot 3.5 到 4.1.1,核心挑战不在代码修改,而在验证。虽仅四类变更(Jackson 3、Starter 拆分、空安全注解、依赖坐标更新),但耗时七成用于确保行为一致:Jackson 3 的不可变映射器、序列化签名变化、Redis 缓存兼容性、旧类名导致的反序列化异常均需逐项排查。关键资产是20层HTTP与18条UI端到端用例,保障了真实场景验证。部分依赖如AgentScope仍留用Jackson 2,通过边界隔离避免硬改。建议尽早迁移,避免未来更复杂的技

长弓三石 238

npm install 时出现npm error code ENOTFOUND和npm error network request to https://registry.npmjs.org的解决方案

本文主要介绍了npm install 时出现npm error code ENOTFOUND和npm error network request to https://registry.npmjs.org 的解决方案,希望能对使用npm的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 6万+

Spring Boot 3.3 启动报 BeanCurrentlyInCreation:循环依赖默认被禁的代价

从 2.5 升到 3.3 启动即报循环依赖异常,它只提示环路一端。需结合堆栈还原完整依赖环,再按真实耦合点选择解环手段。此类放行仅适用于紧急止血,构造器注入的环仍须重构。

昨日种种,皆成今我。今日种种,皆成新我。 234

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Spring Boot 提速记:启动 40 秒到 8 秒,GC 停顿从 850ms 降到 60ms

面向线上 Spring Boot 服务,给出启动侧延迟初始化与 AOT 编译、运行侧 GC 与虚拟线程选型,再用分层压测验证收益,附可复制的参数与代码。

2301_78967866的博客 372

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

ZeusSpring框架深度解析:基于Spring Boot的高效模块化企业级开发解决方案与实战指南

1.1 项目背景与定位在现代企业级应用开发中,如何在保证代码质量的同时提升开发效率,是每一个技术团队面临的核心挑战。ZeusSpring正是为了解决这一痛点而生。这是一个由开发者AichaelLee创建并维护的,基于Spring Boot生态的高度可扩展、模块化的开发框架。它并非简单的代码堆砌,而是对Spring Boot进行了深度的增强与封装,旨在为开发者提供一套“开箱即用”且架构清晰的基础设施。1.2 核心价值主张ZeusSpring的核心设计理念在于“模块化”与“高效”。

wulechun的博客 197

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

毕设选题:基于 Spring Boot 与机器视觉的智慧农场作物病害识别系统设计与实现

本项目基于Spring Boot与机器视觉,设计实现智慧农场作物病害识别系统。集成EfficientNet-B3分类与YOLOv8检测模型,依托54,305张样本、38种病害数据,实现1.8秒内精准识别,准确率达96.8%。系统构建“拍照—识别—开方—复核—回访”闭环流程,结合320条防治方案库与农技员协同复核,提升防治效率与准确性。前后端分离架构,支持24个农场、12,600亩监测面积,累计识别8.6万次,具备高落地性与教学科研价值。

小凯的博客 322

Spring Boot 4 + OpenTelemetry + OpenFeign:自动传播 TraceId 的完整实践

本文演示Spring Boot 4 + OpenTelemetry + OpenFeign环境下,通过引入feign-micrometer依赖,实现调用方通过OpenFeign自动传播traceparent请求头,确保跨服务调用链路中TraceId一致。验证显示:被调方日志中包含traceparent,且两端TraceId相同、SpanId不同,符合W3C Trace Context规范,完整实现链路追踪。

宋冠巡的博客 401

Spring Boot 和 Spring Cloud 是什么关系

Spring Boot 与 Spring Cloud 是协同关系,非替代或升级。Boot 负责单个服务的快速启动与配置,Cloud 则解决多服务间的注册发现、调用、容错等分布式问题。两者能力不重叠:Boot 管进程内,Cloud 管进程间。Cloud 组件基于 Boot 的自动配置机制实现,依赖版本严格匹配,不可随意升级。是否使用 Cloud,取决于是否有跨服务治理需求,而非项目规模。小系统或已用 K8s 可无需引入完整 Cloud。

2401_89855466的博客 242

Spring Boot 3.x 多模型统一接入实战:Spring AI 1.x 与 LangChain4j 选型对比

多模型统一接入层的本质,是把"模型"从一个 SDK 依赖变成一个可配置、可路由、可降级的运行时依赖。版本对齐是前提,Spring AI 2.0.x 与 Spring Boot 3.x 不共存,别照抄跨路线的依赖;协议兼容是杠杆,但"OpenAI 兼容"必须逐家核对,差异要显式管理而不是假装不存在;抽象层决定演进上限,接入层做对了,RAG、MCP、Agent 编排才是在其上叠加能力,而不是推倒重来。

m0_74899094的博客 315

Spring Boot 系统监控与可观测性

基础的 JVM 和 HTTP 指标看不出来 Outbox 是否出问题,所以 Study 服务里添加,通过Micrometer Gauge + 定时 SQL 统计监控事件状态。status状态含义0PENDING等待发送1SENDING已被某个发布器领取2SENTBroker 已确认并通过路由检查3FAILED达到最大重试次数,待人工处理",其他SENDING、`FAILED` 指标同理;实际代码里需要异常处理,避免指标采集影响业务调度。Gauge。

m0_64642997的博客 356

ChatGPT、Codex并发排查:Spring Boot接口没有报错,为什么线程池队列越来越长,最后整批请求超时?

Spring Boot接口没有报错,CPU和数据库连接池也正常,为什么线程池队列却越来越长?本文从订单服务任务积压故障切入,分析无界队列、最大线程数、CallerRunsPolicy、下游阻塞和任务背压机制,并介绍通过Codex辅助定位线程池瓶颈的方法。

2601_96380027的博客 177

Spring Boot 4 默认开虚拟线程,HikariCP 却成瓶颈

升到 Spring Boot 4.1,虚拟线程自动开启,CI 全绿,你以为高并发稳了。结果压测第一轮连接池就打满、请求超时。这篇讲清楚:为什么虚拟线程会反手拖垮 HikariCP,以及三招把它救回来。

tangyuewei.com 483

Spring Boot 升到 2.6 启动报错,循环依赖为何被默认禁掉

升到 Spring Boot 2.6 后,字段注入的循环依赖被默认禁掉,服务一启动就抛异常退出。排查按四步走,从异常类名一路定位到互相引用的字段代码。

昨日种种,皆成今我。今日种种,皆成新我。 276

RFC 9457:Spring Boot 错误却返 200

2026 年 REST 错误契约收敛到 RFC 9457。拆开 Spring Boot 3.3.4 博客,javac 编译原文异常处理器、SQLite 复刻 SQL 时序,实测 3/4 错误返 200。附错误矩阵与 8 个坑改法。

Dai_sir_man的博客 181

基于Spring Boot和Vue的经方药食两用服务平台设计与实现

介绍一套基于Spring Boot和Vue的经方药食两用服务平台,包含食材与经方资料、药膳方案、收藏、预约服务单、体质记录和后台管理,并说明默认H2演示环境及MySQL配置。

weixin_63587281的博客 299
上一篇: SpringBoot入门 - 配置热部署devtools工具
下一篇: SpringBoot接口 - 如何统一接口封装
毕设王同学
博客等级 码龄12年 133粉丝 128原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

毕设王同学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值