WxJava icon indicating copy to clipboard operation
WxJava copied to clipboard

Add Mini Program customer service management interfaces

Open Copilot opened this issue 7 months ago • 0 comments

This PR adds comprehensive customer service management functionality to the WeChat Mini Program SDK, addressing the gap identified in issue #3678.

Problem

The Mini Program module (weixin-java-miniapp) was missing customer service management interfaces. While it had:

  • WxMaCustomserviceWorkService for enterprise WeChat binding
  • WxMaMsgService.sendKefuMsg() for sending customer service messages

It lacked the core customer service management capabilities available in the MP module (WxMpKefuService), such as account management and session control.

Solution

Added a new WxMaKefuService interface and implementation that provides:

Customer Service Account Management

  • kfList() - Get list of customer service accounts
  • kfAccountAdd() - Add new customer service account
  • kfAccountUpdate() - Update customer service account
  • kfAccountDel() - Delete customer service account

Session Management

  • kfSessionCreate() - Create customer service session
  • kfSessionClose() - Close customer service session
  • kfSessionGet() - Get customer session status
  • kfSessionList() - Get customer service session list

Usage Example

// Access the new customer service management functionality
WxMaKefuService kefuService = wxMaService.getKefuService();

// Add customer service account
WxMaKfAccountRequest request = WxMaKfAccountRequest.builder()
    .kfAccount("service@example")
    .kfNick("Customer Service")
    .kfPwd("password123")
    .build();
boolean result = kefuService.kfAccountAdd(request);

// Manage sessions
kefuService.kfSessionCreate("user_openid", "service@example");
WxMaKfList kfList = kefuService.kfList();

Implementation Details

  • New Interface: WxMaKefuService with all customer service management methods
  • Implementation: WxMaKefuServiceImpl with proper error handling and API integration
  • Bean Classes: Complete set of request/response objects for all operations
  • Integration: Seamlessly integrated into existing WxMaService architecture
  • Tests: Unit tests and usage examples included
  • Documentation: Comprehensive documentation with examples

Validation

  • ✅ Full build success across all 34 modules
  • ✅ Checkstyle validation passed
  • ✅ No breaking changes to existing functionality
  • ✅ Minimal, surgical implementation focused only on the missing functionality

This implementation provides the missing customer service management capabilities while maintaining compatibility with existing code and following established patterns in the codebase.

Fixes #3678.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot avatar Aug 31 '25 14:08 Copilot