package com.nokia.sms.service;

import com.nokia.common.http.R;
import com.nokia.pushmessage.service.PushMessageService;
import com.nokia.sms.dto.SendDingTalkMessageDTO;
import org.springframework.stereotype.Service;

@Service
public class DingTalkService {
    private final PushMessageService pushMessageService;

    public DingTalkService(PushMessageService pushMessageService) {
        this.pushMessageService = pushMessageService;
    }

    public R sendTextMessage(SendDingTalkMessageDTO dto) {
        pushMessageService.sendTextMessage(dto.getAccessToken(), dto.getPrefix(), dto.getMessage());
        return R.ok();
    }
}
