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

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.other.app.convertor.user.UserSVipAppConvert;
import com.red.circle.other.app.dto.clientobject.user.user.UserSVipCO;
import com.red.circle.other.domain.gateway.user.ability.UserSVipGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 用户SVip信息.
 * </p>
 *
 * @author pengshigang
 * @since 2022-08-22
 */
@Component
@RequiredArgsConstructor
public class UserSVipProfileQryExe {

  private final UserSVipGateway userSVipGateway;
  private final UserSVipAppConvert userSVipAppConvert;

  public UserSVipCO execute(AppExtCommand cmd) {
    return userSVipAppConvert.toUserSVipCO(
        userSVipGateway.getUserSVipProfile(cmd.requiredReqUserId(), cmd.requireReqSysOrigin())
    );
  }

}
