class WeChatAlertNotifyHandlerImpl extends AbstractAlertNotifyHandlerImpl {
    private static final Logger log = LoggerFactory.getLogger(WeChatAlertNotifyHandlerImpl.class);
    private static final String CORP_ID = "YOUR_CORP_ID";
    private static final String CORP_SECRET = "YOUR_CORP_SECRET";
    private static final String AGENT_ID = "YOUR_AGENT_ID";
    private static final String GET_TOKEN_URL = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + CORP_ID + "&corpsecret=" + CORP_SECRET;
    private static final String SEND_MESSAGE_URL = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=";
    private static final String ACCESS_TOKEN = "access_token";

    @Override
    public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert alert) {<FILL_FUNCTION_BODY>}

    private String getAccessToken() throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(new URI(GET_TOKEN_URL))
                .GET()
                .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonParser parser = new JsonParser();
        JsonObject jsonObject = parser.parse(response.body()).getAsJsonObject();
        String accessToken = null;
        if (jsonObject.has(ACCESS_TOKEN)) {
            accessToken = jsonObject.get(ACCESS_TOKEN).getAsString();
        } else {
            // todo 处理错误情况，例如记录日志或抛出异常
            log.error("Failed to obtain ACCESS_TOKEN from response: {}", response.body());
        }

        return accessToken;
    }

    private String constructMessageContent(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert alert) {
        // 示例：构造一个文本消息内容
        JsonObject messageContent = new JsonObject();
        messageContent.addProperty("msgtype", "text");
        JsonObject textContent = new JsonObject();

        // 这里可以根据NoticeTemplate和Alert信息构造消息内容
        String alertMessage = String.format("警告：%s\n详情：%s", alert.getAlertDefineId(), alert.getContent());
        textContent.addProperty("content", alertMessage);
        messageContent.add("text", textContent);

        // 如果需要@某人，可以在这里添加
        JsonObject atInfo = new JsonObject();
        atInfo.addProperty("isAtAll", false); // 是否@所有人
        messageContent.add("at", atInfo);

        // 返回JSON字符串
        return messageContent.toString();
    }

    private void sendMessage(String accessToken, String messageContent) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(new URI(SEND_MESSAGE_URL + accessToken))
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(messageContent))
                .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        // 检查消息是否成功发送
        log.info("Message sent response: {}", response.body());
    }

    @Override
    public byte type() {
        return 3;
    }
}

        try {
            String accessToken = getAccessToken();
            String messageContent = constructMessageContent(receiver, noticeTemplate, alert);
            sendMessage(accessToken, messageContent);
        } catch (Exception e) {
            log.error("Failed to send WeChat alert", e);
        }
    
<methods>public void onEvent(org.apache.hertzbeat.common.support.event.SystemConfigChangeEvent) <variables>protected static final java.time.format.DateTimeFormatter DTF,private static final java.lang.String NUMBER_FORMAT,protected org.apache.hertzbeat.alert.AlerterProperties alerterProperties,protected java.util.ResourceBundle bundle,protected org.apache.hertzbeat.manager.service.NoticeConfigService noticeConfigService,protected RestTemplate restTemplate