package com.red.circle.other.app.command.team.query;


import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.infra.database.mongo.service.team.team.TeamMemberTargetService;
import com.red.circle.tool.core.num.NumUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 获取最新进行中目标.
 *
 * @author pengliang on 2023/2/17
 */
@Component
@RequiredArgsConstructor
public class TeamLatestInProgressTargetQryExe {

  private final TeamMemberTargetService teamMemberTargetService;

  public String execute(AppExtCommand cmd) {
    return NumUtils.formatLong(
        teamMemberTargetService.getLatestInProgressTarget(cmd.getReqUserId()));
  }

}
