package com.red.circle.other.app.service.task;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.app.command.task.VoiceTaskCompletedTaskSettingCmdExe;
import com.red.circle.other.app.command.task.VoiceTaskReceiveTaskRewardsCmdExe;
import com.red.circle.other.app.command.task.query.VoiceTaskCompletedTaskListQryExe;
import com.red.circle.other.app.dto.clientobject.task.DailyTaskStorageCO;
import com.red.circle.other.app.dto.cmd.task.DailyTasksEventCmd;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 每日任务相关实现.
 *
 * @author pengliang on 2020/11/27
 */
@Service
@RequiredArgsConstructor
public class DailyTasksServiceImpl implements DailyTasksService {

  private final VoiceTaskCompletedTaskListQryExe voiceTaskCompletedTaskListQryExe;
  private final VoiceTaskReceiveTaskRewardsCmdExe voiceTaskReceiveTaskRewardsCmdExe;
  private final VoiceTaskCompletedTaskSettingCmdExe voiceTaskCompletedTaskSettingCmdExe;


  @Override
  public void completedTaskSetting(DailyTasksEventCmd cmd) {
    voiceTaskCompletedTaskSettingCmdExe.execute(cmd);
  }

  @Override
  public List<DailyTaskStorageCO> listCompletedTask(AppExtCommand cmd) {
    return voiceTaskCompletedTaskListQryExe.execute(cmd);
  }

  @Override
  public void receiveTaskRewards(DailyTasksEventCmd cmd) {
    voiceTaskReceiveTaskRewardsCmdExe.execute(cmd);
  }

}
