Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 31, 2025

This PR implements a complete complaint handling service for WeChat Mini Programs, addressing the request for transaction complaint interfaces including message push notifications and query capabilities.

Features Added

Core Complaint Management APIs

  • Query complaint lists with pagination and date filtering
  • Get detailed complaint information including user contact details and order information
  • Query negotiation history to track complaint resolution progress
  • Submit responses to complaints with text content and image attachments
  • Mark complaints as completed when resolved

Notification Management

  • Create/update/delete notification callback URLs for real-time complaint updates
  • Query current notification settings for webhook management

File Upload Support

  • Upload response images with support for both File objects and InputStreams
  • Proper integration with WxJava's existing file upload patterns

Implementation Details

The implementation follows WxJava's established patterns and conventions:

// Example usage - setting up complaint notifications
WxMaComplaintService complaintService = wxMaService.getComplaintService();

// Set notification callback
WxMaComplaintNotifyUrlRequest notifyRequest = WxMaComplaintNotifyUrlRequest.newBuilder()
    .url("https://your-domain.com/complaint/notify")
    .build();
complaintService.addComplaintNotifyUrl(notifyRequest);

// Query recent complaints
WxMaComplaintRequest request = WxMaComplaintRequest.newBuilder()
    .beginDate("2025-01-01")
    .endDate("2025-01-31")
    .limit(20)
    .build();
WxMaComplaintResult complaints = complaintService.queryComplaints(request);

// Submit response with image
String mediaId = complaintService.uploadResponseImage(responseImage);
WxMaResponseRequest response = WxMaResponseRequest.newBuilder()
    .complaintId("complaint_123")
    .responseContent("We are processing your complaint...")
    .responseImages(Arrays.asList(mediaId))
    .build();
complaintService.submitResponse(response);

Technical Components

  • 10 bean classes for comprehensive request/response handling
  • WxMaComplaintService interface with 11 methods covering all complaint operations
  • WxMaComplaintServiceImpl implementation following project conventions
  • URL constants properly organized in WxMaApiUrlConstants.Complaint
  • Integration with main WxMaService interface via getComplaintService()

Quality Assurance

  • All builds pass successfully including full project compilation
  • Checkstyle validation passes with Google Java Style compliance
  • Proper error handling with WxErrorException integration
  • Comprehensive JavaDoc documentation
  • Follows existing WxJava patterns for consistency

This implementation provides merchants with complete tools to handle user complaints effectively, enabling automated notifications and comprehensive complaint tracking as requested in the original issue.

Fixes #3519.


💬 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:07
…e APIs

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 微信小程序的 交易投诉类接口 Implement WeChat Mini Program complaint handling service with comprehensive API support Aug 31, 2025
@Copilot Copilot AI requested a review from binarywang August 31, 2025 15:11
Copilot finished work on behalf of binarywang August 31, 2025 15:11
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