package com.xunhong.erp.turbo.biz.app.executor.query;

import com.xunhong.erp.turbo.api.biz.dto.qry.DealerShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerVO;
import com.xunhong.erp.turbo.biz.app.assembler.DealerAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.Dealer;
import com.xunhong.erp.turbo.biz.domain.gateway.DealerGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author shenyifei
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class DealerShowQryExe {

	private final DealerAssembler dealerAssembler;
	private final DealerGateway dealerGateway;

	public DealerVO execute(DealerShowQry dealerShowQry) {
		Dealer dealer = dealerGateway.show(dealerShowQry);

		return dealerAssembler.toDealerVO(dealer);
	}
}

