package com.palmnest.service.appVersion.manager.impl;

import com.palmnest.dao.estateserve.AppUseVersionDao;
import com.palmnest.model.estateserve.AppUseVersion;
import com.palmnest.service.appVersion.manager.AppUseVersionManager;
import com.palmnest.service.impl.GenericManagerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * app版本管理manager实现类
 *
 * @author longmeizhen
 */
@Service("appUseVersionManager")
public class AppUseVersionManagerImpl extends GenericManagerImpl<AppUseVersion, Long> implements AppUseVersionManager {

	private AppUseVersionDao appUseVersionDao;

	@Autowired
	public void setAppUseVersionDao(AppUseVersionDao appUseVersionDao) {
		this.appUseVersionDao = appUseVersionDao;
		this.dao = appUseVersionDao;
	}

	@Override
	public AppUseVersion getLatestRecode(String useCode, String type) throws Exception {
		return appUseVersionDao.getLatestRecode(useCode, type);
	}

	@Override
	public int updateRecodeByType(String type, String useCode) throws Exception {
		return appUseVersionDao.updateRecodeByType(type, useCode);
	}

	@Override
	public List<AppUseVersion> getByRecode(String useCode, String type) {
		return appUseVersionDao.getByRecode(useCode, type);
	}

	@Override
	public AppUseVersion save(AppUseVersion auv) {
		return appUseVersionDao.save(auv);
	}

}
