package com.ematou.wxservice.mp.handler;

import com.ematou.wxservice.mp.message.WeChatMessage;
import com.ematou.wxservice.mp.message.WeChatMpXmlOutMessage;
import com.ematou.wxservice.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class WeChatUnsubscribeHandler implements WeChatMessageHandler {

    @Autowired
    UserInfoService userInfoService;

    /**
     *
     * 清除已关注用户信息
     * @param weChatMessage 接收到的消息
     * @return
     */
    @Override
    public WeChatMpXmlOutMessage handlerMessage(WeChatMessage weChatMessage) {
        userInfoService.deleUserInfoService(weChatMessage.getFromUser());
        return null;
    }
}
