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

import com.xunhong.erp.turbo.api.facade.dto.qry.WxMaOpenidQry;
import com.xunhong.erp.turbo.api.user.api.UserAuthServiceI;
import com.xunhong.erp.turbo.api.user.dto.cmd.OpenSafeCmd;
import com.xunhong.erp.turbo.api.user.dto.cmd.UpdatePasswordCmd;
import com.xunhong.erp.turbo.api.user.dto.qry.PasswordLoginQry;
import com.xunhong.erp.turbo.api.user.dto.qry.UserAuthShowQry;
import com.xunhong.erp.turbo.api.user.dto.vo.UserAuthVO;
import com.xunhong.erp.turbo.user.app.executor.cmd.UpdatePasswordCmdExe;
import com.xunhong.erp.turbo.user.app.executor.query.OpenSafeCmdExe;
import com.xunhong.erp.turbo.user.app.executor.query.PasswordLoginQryExe;
import com.xunhong.erp.turbo.user.app.executor.query.UserAuthShowQryExe;
import com.xunhong.erp.turbo.user.app.executor.query.WxMaCodeLoginQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;


@Slf4j
@Service
@DubboService(interfaceClass = UserAuthServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class UserAuthServiceImpl implements UserAuthServiceI {

	private final PasswordLoginQryExe passwordLoginQryExe;
	private final WxMaCodeLoginQryExe wxMaCodeLoginQryExe;
	private final OpenSafeCmdExe openSafeCmdExe;
	private final UpdatePasswordCmdExe updatePasswordCmdExe;
	private final UserAuthShowQryExe userAuthShowQryExe;

	@Override
	public UserAuthVO passwordLogin(PasswordLoginQry passwordLoginQry) {
		return passwordLoginQryExe.execute(passwordLoginQry);
	}

	@Override
	public UserAuthVO wxMaCodeLogin(WxMaOpenidQry wxMaOpenidQry) {
		return wxMaCodeLoginQryExe.execute(wxMaOpenidQry);
	}

	@Override
	public void openSafe(OpenSafeCmd openSafeCmd) {
		openSafeCmdExe.execute(openSafeCmd);
	}

	@Override
	public void updatePassword(UpdatePasswordCmd updatePasswordCmd) {
		updatePasswordCmdExe.execute(updatePasswordCmd);
	}

	@Override
	public UserAuthVO show(UserAuthShowQry userAuthShowQry) {
		return userAuthShowQryExe.execute(userAuthShowQry);
	}
}
