Jeeapp Spring Boot 文档
Jeeapp Spring Boot 是一套企业级 Spring Boot Starters 集合,提供了钉钉、浙政钉、Teambition 等平台的快速集成能力,以及 Excel 处理、JPA 增强等实用工具。
主要特性
- 钉钉集成: 完整的钉钉开放平台 SDK,支持消息推送、审批流程、企业通讯录等功能
- 浙政钉集成: 专门适配浙政钉平台的 SDK
- Teambition 集成: Teambition 项目管理平台的完整 API 封装
- Excel 处理: 基于 Apache POI 的增强型 Excel 读写工具
- JPA 增强: 提供 JPA 的额外功能支持
- 监控集成: 应用监控和性能分析
- 安全增强: Spring Security 集成和增强
- Swagger 文档: API 文档自动生成
系统要求
Jeeapp Spring Boot 1.2.4-SNAPSHOT 需要以下环境:
- Java 8 或更高版本
- Spring Boot 2.7.x
- Maven 3.6+ 或 Gradle 7+
Maven 安装
Jeeapp Spring Boot 提供了 BOM (Bill of Materials) 来管理依赖版本。在您的 pom.xml 中添加以下配置:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.jeeapp.spring.boot</groupId>
<artifactId>jeeapp-spring-boot-dependencies</artifactId>
<version>{project-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
然后添加所需的 Starter 依赖,例如:
<dependencies>
<dependency>
<groupId>com.jeeapp.spring.boot</groupId>
<artifactId>dingtalk-spring-boot-starter</artifactId>
</dependency>
</dependencies>
Gradle 安装
在 Gradle 项目中,您可以这样配置:
dependencies {
implementation platform('com.jeeapp.spring.boot:jeeapp-spring-boot-dependencies:{project-version}')
implementation 'com.jeeapp.spring.boot:dingtalk-spring-boot-starter'
}
创建第一个应用
以下是一个使用钉钉集成的简单示例:
Maven 依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.jeeapp.spring.boot</groupId>
<artifactId>dingtalk-spring-boot-starter</artifactId>
</dependency>
配置文件
在 application.yml 中添加配置:
dingtalk:
app-type: INTERNAL
client-id: your-app-key
client-secret: your-app-secret
corp-id: your-corp-id
agent-id: your-agent-id
代码示例
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jeeapp.dingtalk.DingTalkTemplate;
import lombok.RequiredArgsConstructor;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
@RestController
@RequiredArgsConstructor
class DingTalkController {
private final DingTalkTemplate dingTalkTemplate;
@GetMapping("/user")
public Object getUser(String userId) throws Exception {
com.aliyun.dingtalkcontact_1_0.Client client = dingTalkTemplate.createClient(com.aliyun.dingtalkcontact_1_0.Client.class);
return client.getUser(userId).getBody();
}
}
运行应用
运行 DemoApplication 类,然后访问 http://localhost:8080/user?userId=xxx 即可获取用户信息。
文档章节
以下是 Jeeapp Spring Boot 提供的所有 Starter:
| 名称 | 仓库地址 | 说明 |
|---|---|---|
| 钉钉集成 | dingtalk-spring-boot-starter | 钉钉开放平台集成,支持企业内部应用、第三方应用、H5 微应用等 |
| 浙政钉集成 | dingtalkgov-spring-boot-starter | 浙政钉平台集成,专门适配浙江政务钉钉平台 |
| Teambition 集成 | teambition-spring-boot-starter | Teambition 项目管理平台集成,支持项目、任务、文件管理 |
| Excel 处理 | excel-spring-boot-starter | Excel 读写处理增强工具,支持流式读取、注解映射、样式设置 |
| JPA 增强 | jpa-spring-boot-starter | JPA 功能增强,支持 JSON 类型、雪花 ID、MySQL 函数等 |
| 监控集成 | monitor-spring-boot-starter | 应用监控和性能分析,集成 Micrometer 和健康检查 |
| 安全增强 | security-spring-boot-starter | Spring Security 集成和增强,支持当前认证注解 |
| Swagger 文档 | swagger-spring-boot-starter | Swagger API 文档自动生成,支持分页和 QueryDSL |
| P6Spy 分析 | p6spy-spring-boot-starter | SQL 性能分析和监控,支持 SQL 日志记录 |
获取帮助
如果您在使用过程中遇到问题:
- 在 Issue Tracker 提交问题
- 联系技术支持团队