package org.xyzh.common.wechat.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xyzh.common.wechat.pojo.kefu.KefuCallback;

/**
 * @description    客服回调默认处理器
 * @filename    DefaultKefuCallbackHandler.java
 * @author    yslg
 * @copyright xyzh
 * @since 2025-12-19
 */
public class DefaultKefuCallbackHandler implements KefuCallbackHandler {

    private static final Logger logger = LoggerFactory.getLogger(DefaultKefuCallbackHandler.class);

    @Override
    public void onEnterSession(KefuCallback callback) {
        logger.info("用户进入会话: externalUserid={}, openKfid={}, welcomeCode={}", 
            callback.getExternalUserid(), callback.getOpenKfid(), callback.getWelcomeCode());
    }

    @Override
    public void onMsgSendFail(KefuCallback callback) {
        logger.warn("消息发送失败: failMsgid={}, failType={}", 
            callback.getFailMsgid(), callback.getFailType());
    }

    @Override
    public void onUserRecallMsg(KefuCallback callback) {
        logger.info("用户撤回消息: msgid={}", callback.getMsgid());
    }

    @Override
    public void onServicerStatusChange(KefuCallback callback) {
        logger.info("接待人员状态变更: openKfid={}", callback.getOpenKfid());
    }

    @Override
    public void onSessionStatusChange(KefuCallback callback) {
        logger.info("会话状态变更: openKfid={}, externalUserid={}", 
            callback.getOpenKfid(), callback.getExternalUserid());
    }

    @Override
    public void onTextMessage(KefuCallback callback) {
        logger.info("收到文本消息: externalUserid={}, content={}", 
            callback.getExternalUserid(), callback.getContent());
    }

    @Override
    public void onImageMessage(KefuCallback callback) {
        logger.info("收到图片消息: externalUserid={}, mediaId={}", 
            callback.getExternalUserid(), callback.getMediaId());
    }

    @Override
    public void onVoiceMessage(KefuCallback callback) {
        logger.info("收到语音消息: externalUserid={}, mediaId={}", 
            callback.getExternalUserid(), callback.getMediaId());
    }

    @Override
    public void onVideoMessage(KefuCallback callback) {
        logger.info("收到视频消息: externalUserid={}, mediaId={}", 
            callback.getExternalUserid(), callback.getMediaId());
    }

    @Override
    public void onFileMessage(KefuCallback callback) {
        logger.info("收到文件消息: externalUserid={}, mediaId={}", 
            callback.getExternalUserid(), callback.getMediaId());
    }

    @Override
    public void onLocationMessage(KefuCallback callback) {
        logger.info("收到位置消息: externalUserid={}", callback.getExternalUserid());
    }

    @Override
    public void onLinkMessage(KefuCallback callback) {
        logger.info("收到链接消息: externalUserid={}", callback.getExternalUserid());
    }

    @Override
    public void onBusinessCardMessage(KefuCallback callback) {
        logger.info("收到名片消息: externalUserid={}", callback.getExternalUserid());
    }

    @Override
    public void onMiniprogramMessage(KefuCallback callback) {
        logger.info("收到小程序消息: externalUserid={}", callback.getExternalUserid());
    }
    
}
