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.CompletedFirstChargeCmdExe;
import com.red.circle.other.app.command.task.FirstChargeReceiveRewardCmdExe;
import com.red.circle.other.app.dto.clientobject.task.UserOneTimeTaskCO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户只可以完成一次的一次性任务.
 *
 * @author pengshigang on 2021/7/16
 */
@Service
@RequiredArgsConstructor
public class UserOneTimeTaskServiceImpl implements UserOneTimeTaskService {

  private final CompletedFirstChargeCmdExe completedFirstChargeCmdExe;
  private final FirstChargeReceiveRewardCmdExe firstChargeReceiveRewardCmdExe;

  @Override
  public UserOneTimeTaskCO firstChargeAwardStatus(AppExtCommand cmd) {
    return completedFirstChargeCmdExe.execute(cmd);
  }

  @Override
  public void receiveReward(AppExtCommand cmd) {
    firstChargeReceiveRewardCmdExe.execute(cmd);
  }
}
