package com.sonic.bear.service.impl;


import com.sonic.bear.service.CommonMessageService;
import com.sonic.pigeon.lib.client.MessageClient;
import com.sonic.pigeon.lib.enums.StationMessageTypeEnum;
import com.sonic.pigeon.lib.input.SendMessageInput;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 公共发送系统通知
 */
@Service
public class CommonMessageServiceImpl implements CommonMessageService {

    @Autowired
    private MessageClient messageClient;


    @Override
    public void userRegisterSendMessage(Long userId) {
        String title = StationMessageTypeEnum.REGISTER_WELCOME.getTitle();
        String content = StationMessageTypeEnum.REGISTER_WELCOME.getContent();
        SendMessageInput sendMessageInput = new SendMessageInput(-1L, userId, StationMessageTypeEnum.REGISTER_WELCOME.getIndex(), title, content);
        messageClient.sendMessage(sendMessageInput);
    }

}
