package com.red.circle.other.app.service.user.material;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.app.command.user.query.UseOwnedBadgeQryExe;
import com.red.circle.other.inner.model.dto.material.BadgeConfigDetailsDTO;
import com.red.circle.other.app.command.user.UserSwitchBadgeCmdExe;
import com.red.circle.other.app.command.user.UserToggleBadgeCmdExe;
import com.red.circle.other.app.command.user.query.UseWearBadgeQryExe;
import com.red.circle.other.app.dto.cmd.user.material.UserSwitchBadgeCmd;
import com.red.circle.other.app.dto.cmd.user.material.UserToggleBadgeCmd;
import java.util.List;

import com.red.circle.other.inner.model.dto.material.UseOwnBadgeDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户徽章，服务实现.
 *
 * @author pengliang on 2023/7/24
 */
@Service
@RequiredArgsConstructor
public class UserBadgeServiceImpl implements UserBadgeService {

  private final UseWearBadgeQryExe useWearBadgeQryExe;
  private final UserSwitchBadgeCmdExe userSwitchBadgeCmdExe;
  private final UserToggleBadgeCmdExe userToggleBadgeCmdExe;
  private final UseOwnedBadgeQryExe useOwnedBadgeQryExe;

  @Override
  public void switchBadge(UserSwitchBadgeCmd cmd) {
    userSwitchBadgeCmdExe.execute(cmd);
  }

  @Override
  public List<BadgeConfigDetailsDTO> useWearBadge(AppExtCommand cmd) {
    return useWearBadgeQryExe.execute(cmd);
  }

    @Override
    public List<UseOwnBadgeDTO> ownedBadge(AppExtCommand cmd, String type) {
        return useOwnedBadgeQryExe.execute(cmd, type);
    }

    @Override
  public void toggleBadge(UserToggleBadgeCmd cmd) {
    userToggleBadgeCmdExe.execute(cmd);
  }

}
