package org.dromara.payment.merchant.dubbo;

import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.payment.api.merchant.RemoteMerchantService;
import org.dromara.payment.api.merchant.domain.RemoteBusMerchantAccountVo;
import org.dromara.payment.api.syd.RemoteSydService;
import org.dromara.payment.merchant.domain.vo.BusMerchantAccountVo;
import org.dromara.payment.merchant.mapper.BusMerchantAccountMapper;
import org.dromara.payment.merchant.service.IBusMerchantAccountService;
import org.dromara.system.api.domain.vo.RemoteSysUserVo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商户服务
 *
 * @author Michelle.Chung
 */
@RequiredArgsConstructor
@Service
@DubboService
public class RemoteMerchantServiceImpl implements RemoteMerchantService {
    private final IBusMerchantAccountService merchantAccountService;

    @Override
    public RemoteBusMerchantAccountVo getDefaultAccByMerIdAndSydId(Long merId, Long sydId) {
        BusMerchantAccountVo accountVo = merchantAccountService.getDefaultAccByMerIdAndSydId(merId,sydId);
        return accountVo != null ? MapstructUtils.convert(accountVo, RemoteBusMerchantAccountVo.class) : null;
    }
}
