# openclaw-dingtalk-java **Repository Path**: wangbincode/openclaw-dingtalk-java ## Basic Information - **Project Name**: openclaw-dingtalk-java - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-15 - **Last Updated**: 2026-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenClaw + 钉钉集成项目脚手架 基于 Spring Boot 3 + WebFlux 的 OpenClaw 钉钉集成项目。 ## 功能特性 ### 核心 Skills - ✅ **JavaArchitectSkill**: 分析需求生成 Spring Boot 项目结构 - ✅ **JavaCoderSkill**: 生成代码并执行 `mvn compile` - ✅ **GiteePushSkill**: 推送代码到 Gitee,带有人工确认逻辑 - ✅ **MigrationJourneySkill**: 整合 Skills 实现完整迁移旅程 ### 控制器 - ✅ **DingTalkWebhookController**: 处理钉钉回调,支持 ActionCard 按钮确认 - ✅ **MigrationController**: 迁移旅程 REST API ### 服务 - ✅ **DingTalkService**: 发送钉钉消息(文本/Markdown/互动卡片) ## 快速开始 ### 1. 环境变量配置 ```bash # OpenClaw 配置 export OPENCLAW_GATEWAY_URL=http://localhost:9000 export OPENCLAW_API_KEY=your-api-key export OPENCLAW_WORKSPACE=/tmp/openclaw-workspace # 钉钉配置 export DINGTALK_WEBHOOK=https://oapi.dingtalk.com/robot/send?access_token=xxx export DINGTALK_APP_KEY=your-app-key export DINGTALK_APP_SECRET=your-app-secret export DINGTALK_CALLBACK_TOKEN=your-callback-token export DINGTALK_CALLBACK_AES_KEY=your-aes-key # Gitee 配置 export GITEE_TOKEN=your-gitee-token export GITEE_USERNAME=your-username ``` ### 2. 编译项目 ```bash mvn clean compile ``` ### 3. 运行项目 ```bash mvn spring-boot:run ``` ### 4. 打包 ```bash mvn clean package -DskipTests ``` ## API 接口 ### 迁移旅程 #### 1. 启动迁移旅程 ``` POST /api/migration/start Content-Type: application/json { "requirement": "创建 Spring Boot 用户管理系统", "projectDir": "/tmp/migration-project", "repositoryName": "user-management-system" } ``` **响应:** ```json { "status": "success", "message": "迁移旅程执行完成,等待人工确认", "taskId": "uuid-xxx", "phases": { "collection": {...}, "assessment": {...}, "migration": {...} } } ``` #### 2. 确认推送(阶段 4) ``` POST /api/migration/confirm Content-Type: application/json { "taskId": "uuid-xxx", "confirmed": true } ``` #### 3. 查询迁移状态 ``` GET /api/migration/status/{taskId} ``` ### 钉钉回调 ``` POST /api/dingtalk/callback ``` 处理钉钉事件回调和互动卡片按钮点击。 ### 查询待确认推送任务 ``` GET /api/dingtalk/push-task ``` ## 迁移旅程流程 ``` ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ 阶段 1: 采集 │ ──▶ │ 阶段 2: 评估 │ ──▶ │ 阶段 3: 迁移 │ ──▶ │ 阶段 4: 验证 │ │ 分析需求 │ │ 生成代码 │ │ 创建推送 │ │ 人工确认 │ │ 生成结构 │ │ 编译验证 │ │ 任务 │ │ 推送结果 │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ ✅ ✅ ⏳ 👤 等待确认 ``` ## 项目结构 ``` openclaw-dingtalk-java/ ├── src/main/java/com/openclaw/dingtalk/ │ ├── OpenClawDingTalkApplication.java # 主启动类 │ ├── config/ │ │ ├── OpenClawProperties.java # OpenClaw 配置 │ │ ├── GiteeProperties.java # Gitee 配置 │ │ ├── DingTalkProperties.java # 钉钉配置 │ │ └── WebClientConfig.java # WebClient 配置 │ ├── controller/ │ │ ├── DingTalkWebhookController.java # 钉钉回调控制器 │ │ └── MigrationController.java # 迁移旅程控制器 │ ├── service/ │ │ └── DingTalkService.java # 钉钉消息服务 │ └── skill/ │ ├── JavaArchitectSkill.java # 架构师技能 │ ├── JavaCoderSkill.java # 编码技能 │ ├── GiteePushSkill.java # Gitee 推送技能 │ └── MigrationJourneySkill.java # 迁移旅程技能 ├── src/main/resources/ │ ├── application.yml # 应用配置 │ └── migration-example.json # 迁移示例配置 ├── src/test/java/ │ ├── OpenClawDingTalkApplicationTests.java │ └── skill/MigrationJourneySkillTest.java └── pom.xml ``` ## 依赖说明 | 依赖 | 版本 | 说明 | |------|------|------| | Spring Boot | 3.2.0 | 核心框架 | | WebFlux | 3.2.0 | 响应式 Web | | JGit | 6.7.0 | Git 操作 | | Lombok | - | 代码简化 | | OpenClaw Core | 1.0.0 | OpenClaw 核心 | ## 开发说明 ### 添加新的 Skill 1. 在 `skill` 包下创建新类 2. 使用 `@Component` 注解 3. 在需要的地方注入使用 ### 添加新的 Controller 1. 在 `controller` 包下创建新类 2. 使用 `@RestController` 注解 3. 定义请求映射 ## License MIT