package com.palmnest.service.virtProject.impl;

import com.palmnest.model.estateserve.UserAccountRecode;
import com.palmnest.service.virtProject.UserAccountService;
import com.palmnest.service.virtProject.manager.UserAccountManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userAccountService")
public class UserAccountServiceImpl implements UserAccountService {

	@Autowired
	private UserAccountManager userAccountManager;

	@Override
	public List<UserAccountRecode> getUserAccountRecode(String orgId, String openId) {
		return userAccountManager.getUserAccountRecode(orgId, openId);
	}

	@Override
	public List<UserAccountRecode> getUserAccountByAccount(String orgId, String accountId,
														   String openId) {
		return userAccountManager.getUserAccountByAccount(orgId, accountId, openId);
	}

	@Override
	public int isHaveAccLogin(String openId, String orgId) throws Exception {
		return userAccountManager.isHaveAccLogin(openId, orgId);
	}

	@Override
	public void updateUserAccount(UserAccountRecode recode) {
		userAccountManager.updateModel(recode);
	}
}
