tourze/wechat-work-staff-bundle
最新稳定版本:0.2.0
Composer 安装命令:
composer require tourze/wechat-work-staff-bundle
包简介
企业微信员工管理模块
README 文档
README
A Symfony Bundle for enterprise WeChat (DingTalk) staff management, providing comprehensive APIs for user, department, and tag management.
Features
- User Management: Create, update, delete, and sync enterprise WeChat users
- Department Management: Handle department structure and hierarchies
- Tag Management: Create and manage user tags for organization
- Avatar Management: Automatic user avatar synchronization and storage
- Authentication: OAuth integration with enterprise WeChat
- Cron Jobs: Automated data synchronization tasks
- JSON-RPC API: RESTful API endpoints for external integration
Installation
composer require tourze/wechat-work-staff-bundle
Quick Start
Basic Configuration
<?php // config/packages/wechat_work_staff.yaml wechat_work_staff: # Configuration will be loaded from other bundles
User Management
<?php use WechatWorkStaffBundle\Service\BizUserService; use WechatWorkStaffBundle\Repository\UserRepository; // Inject the service public function __construct( private BizUserService $userService, private UserRepository $userRepository ) {} // Get user by ID $user = $this->userRepository->findByUserId('user123'); // Sync user data from WeChat Work $this->userService->syncUserData($agentId);
Console Commands
The bundle provides several console commands for data synchronization:
User Management Commands
# Sync user list for specific agent php bin/console wechat-work:sync-user-list <agentId> # Check and update user avatars (runs automatically every 8 hours) php bin/console wechat-work:check-user-avatar
Tag Management Commands
# Sync user tags (runs automatically every 8 hours) php bin/console wechat-work:sync-user-tags # Sync users associated with tags (runs automatically every 20 minutes) php bin/console wechat-work:sync-tag-users
API Endpoints
The bundle provides several controller endpoints:
- Authentication:
/wechat-work/auth/*- OAuth flow handling - User Connection:
/wechat-work/connect/*- User account linking - Testing Endpoints: Various test endpoints for development
JSON-RPC Procedures
Available JSON-RPC procedures:
GetWechatWorkDepartmentTree- Retrieve department hierarchyGetWechatWorkUserByAuthCode- Get user information by auth code
Entities
- User: Enterprise WeChat user entity
- Department: Department/organization structure
- UserTag: User categorization tags
- AgentUser: Association between agents and users
Advanced Usage
Cron Jobs
Automated tasks (configured via AsCronTask attribute):
- Avatar Check: Every 8 hours at minute 14
- Tag Sync: Every 8 hours at minute 30
- Tag Users Sync: Every 20 minutes
Custom Event Listeners
The bundle dispatches events that you can listen to:
<?php use WechatWorkStaffBundle\EventSubscriber\UserTagListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class CustomUserTagListener implements EventSubscriberInterface { // Your custom logic }
Dependencies
This bundle requires:
- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine ORM
- Bundle Dependency Bundle
- HTTP Client Bundle
- WeChat Work Contracts Bundle
- League Flysystem (for avatar storage)
Contributing
Please see CONTRIBUTING.md for details.
Security
Security Considerations
- All external API calls include audit logging
- User data is properly validated and sanitized
- OAuth flows follow security best practices
- Sensitive information is properly encrypted
Reporting Security Issues
Please report security vulnerabilities to security@example.com.
License
The MIT License (MIT). Please see License File for more information.
tourze/wechat-work-staff-bundle 适用场景与选型建议
tourze/wechat-work-staff-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tourze/wechat-work-staff-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tourze/wechat-work-staff-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-03