提供 Web 开发中常见的服务
- Redis 服务,支持集群模式
- Captcha 服务,实现基于文本的防机器人验证码
<dependency>
<groupId>com.github.swiftech</groupId>
<artifactId>swiftboot-service</artifactId>
<version>2.2.1</version>
</dependency>
- application.yaml
swiftboot:
service:
redis:
host: localhost
port: 6379
cluster: localhost:6379
captcha:
expiresIn: 300
- MyController.java
public class MyController {
@Resource
private RedisService redisService;
@Resource
private CaptchaService captchaService;
}