package com.xunhong.erp.turbo.facade.app.service;

import com.xunhong.erp.turbo.api.facade.api.WxMaServiceI;
import com.xunhong.erp.turbo.api.facade.dto.cmd.WxMaCallbackCmd;
import com.xunhong.erp.turbo.api.facade.dto.qry.WxMaOpenidQry;
import com.xunhong.erp.turbo.api.facade.dto.qry.WxMaPhoneQry;
import com.xunhong.erp.turbo.api.facade.dto.vo.WxMaOcrBankCardVO;
import com.xunhong.erp.turbo.api.facade.dto.vo.WxMaOcrIdCardVO;
import com.xunhong.erp.turbo.api.facade.dto.vo.WxMaOpenidVO;
import com.xunhong.erp.turbo.facade.app.executor.cmd.WxMaCallbackCmdExe;
import com.xunhong.erp.turbo.facade.app.executor.cmd.WxMaOcrBankCardCmdExe;
import com.xunhong.erp.turbo.facade.app.executor.cmd.WxMaOcrIdCardCmdExe;
import com.xunhong.erp.turbo.facade.app.executor.cmd.WxPhoneBindCmdExe;
import com.xunhong.erp.turbo.facade.app.executor.query.WxOpenidQryExe;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

@Service
@DubboService(interfaceClass = WxMaServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class WxMaServiceImpl implements WxMaServiceI {

	private final WxOpenidQryExe wxMaOpenidQryExe;
	private final WxPhoneBindCmdExe wxMaPhoneBindCmdExe;
	private final WxMaCallbackCmdExe wxMaCallbackCmdExe;
	private final WxMaOcrIdCardCmdExe wxMaOcrIdCardCmdExe;
	private final WxMaOcrBankCardCmdExe wxMaOcrBankCardCmdExe;

	@Override
	public String callback(WxMaCallbackCmd wxMaCallbackCmd) {
		return wxMaCallbackCmdExe.execute(wxMaCallbackCmd);
	}

	@Override
	public WxMaOpenidVO getOpenId(WxMaOpenidQry wxMaOpenidQry) {
		return wxMaOpenidQryExe.execute(wxMaOpenidQry);
	}

	@Override
	public String getPhone(WxMaPhoneQry wxMaPhoneQry) {
		return wxMaPhoneBindCmdExe.execute(wxMaPhoneQry);
	}

	@Override
	public WxMaOcrIdCardVO ocrIdCard(String ocrUrl) {
		return wxMaOcrIdCardCmdExe.execute(ocrUrl);
	}

	@Override
	public WxMaOcrBankCardVO ocrBankCard(String ocrUrl) {
		return wxMaOcrBankCardCmdExe.execute(ocrUrl);
	}
}
