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

import com.red.circle.common.business.dto.cmd.app.AppAccountCmd;
import com.red.circle.other.app.convertor.user.UserProfileAppConvertor;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 根据邀请码获得用户信息(App使用).
 * </p>
 *
 * @author pengshigang
 * @since 2023-12-25
 */
@Service
@AllArgsConstructor
public class InviteNewInvitePeopleQryExe {

  private final UserProfileGateway userProfileGateway;
  private final UserProfileAppConvertor userProfileAppConvertor;

  public UserProfileDTO execute(AppAccountCmd cmd) {

    return userProfileAppConvertor.toUserProfileDTO(
        userProfileGateway.getByAccount(cmd.getReqSysOrigin().getOrigin(), cmd.getAccount()));
  }

}
