Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 31, 2025

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 AI and others added 2 commits August 31, 2025 15:01
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
… tests and documentation

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 没有微信小程序-客服管理相关接口 Add Mini Program customer service management interfaces Aug 31, 2025
@Copilot Copilot AI requested a review from binarywang August 31, 2025 15:06
Copilot finished work on behalf of binarywang August 31, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

没有微信小程序-客服管理相关接口
2 participants