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

import com.xunhong.erp.turbo.api.infra.dto.qry.DictionaryShowQry;
import com.xunhong.erp.turbo.api.infra.dto.vo.DictionaryVO;
import com.xunhong.erp.turbo.infra.app.assembler.DictionaryAssembler;
import com.xunhong.erp.turbo.infra.domain.entity.Dictionary;
import com.xunhong.erp.turbo.infra.domain.gateway.DictionaryGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

	private final DictionaryAssembler dictionaryAssembler;
	private final DictionaryGateway dictionaryGateway;

	public DictionaryVO execute(DictionaryShowQry dictionaryShowQry) {
		Dictionary dictionary = dictionaryGateway.show(dictionaryShowQry);

		return dictionaryAssembler.toDictionaryVO(dictionary);
	}
}

