“mitao”
2026-04-08 62f8d49c054823813dd2f5fa7dd1aee12b7cd84c
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/app/auth/service/AppWechatAuthClient.java
@@ -6,6 +6,7 @@
import com.tcm.training.admin.app.auth.dto.AppWechatLoginRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate;
@@ -26,12 +27,14 @@
    /**
     * 使用默认 HTTP 客户端构造微信认证客户端。
     */
    @Autowired
    public AppWechatAuthClient(AppWechatAuthProperties properties, ObjectMapper objectMapper) {
        this(properties, objectMapper, new RestTemplate());
    }
    /**
     * 注入微信配置、JSON 解析器与 HTTP 客户端。
     * 存在多个构造器时,这个扩展构造器仅供测试或内部定制使用,避免 Spring 误判默认注入入口。
     */
    AppWechatAuthClient(AppWechatAuthProperties properties,
                        ObjectMapper objectMapper,