package com.zanxiang.game.module.manage.rpc.impl;

import com.zanxiang.game.module.base.pojo.dto.SendMsgDTO;
import com.zanxiang.game.module.base.pojo.params.SendMsgTaskParam;
import com.zanxiang.game.module.base.pojo.params.SendMsgTaskResultParam;
import com.zanxiang.game.module.base.pojo.vo.SendMsgResultVO;
import com.zanxiang.game.module.base.pojo.vo.SendMsgVO;
import com.zanxiang.game.module.base.rpc.ICPSendMsgRpc;
import com.zanxiang.game.module.base.util.PageUtil;
import com.zanxiang.game.module.manage.service.ICpSendMsgResultService;
import com.zanxiang.game.module.manage.service.ICpSendMsgTaskService;
import com.zanxiang.module.util.pojo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author : lingfeng
 * @time : 2024-03-14
 * @description : CP消息发送接口
 */
@DubboService
@Slf4j
public class CpSendMsgRpcImpl implements ICPSendMsgRpc {

    @Autowired
    private ICpSendMsgTaskService cpSendMsgTaskService;

    @Autowired
    private ICpSendMsgResultService cpSendMsgResultService;

    @Override
    public ResultVO<Boolean> sendMsg(SendMsgDTO sendMsgDto) {
        return cpSendMsgTaskService.sendMsg(sendMsgDto);
    }

    @Override
    public PageUtil<SendMsgVO> getSendMsgTaskList(SendMsgTaskParam param) {
        return cpSendMsgTaskService.getSendMsgTaskList(param);
    }

    @Override
    public PageUtil<SendMsgResultVO> getSendMsgTaskResultList(SendMsgTaskResultParam sendMsgTaskResultParam) {
        return cpSendMsgResultService.getSendMsgTaskResultList(sendMsgTaskResultParam);
    }

    @Override
    public ResultVO<Boolean> reSendMsgByTaskId(Long gameId, Long taskId) {
        return ResultVO.ok(cpSendMsgTaskService.reSendMsgByTaskId(gameId, taskId));
    }

    @Override
    public ResultVO<Boolean> reSendMsgByResultId(Long resultId) {
        return ResultVO.ok(cpSendMsgTaskService.reSendMsgByResultId(resultId));
    }
}
