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

import com.red.circle.other.app.dto.cmd.user.user.UserOnlineStatusUploadCmd;
import com.red.circle.other.infra.common.user.OnlineStatusCommon;
import com.red.circle.other.inner.model.cmd.user.OnlineStatusUploadCmd;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 用户在线状态上传
 *
 * @author pengliang on 2020/11/26
 */
@Slf4j
@Component
@Deprecated
@RequiredArgsConstructor
public class UserOnlineStatusUploadCmdExe {

  private final OnlineStatusCommon onlineStatusCommon;

  public void execute(UserOnlineStatusUploadCmd cmd) {
    onlineStatusCommon.upload(new OnlineStatusUploadCmd()
        .setSysOrigin(cmd.requireReqSysOrigin())
        .setUserId(cmd.requiredReqUserId())
        .setStatus(cmd.getStatus())
        .setTask(cmd.getTask())
        .setSessionId(cmd.getSessionId())
    );
  }

}
