package com.wechat.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wechat.dao.MdeJobAdvertisedDao;
import com.wechat.global.base.BaseService;
import com.wechat.model.dbEntity.MdeJobAdvertised;
import com.wechat.model.dto.AvailableAndUsedCountDto;
import com.wechat.model.responseDto.JobAdvertisedNologinResp;
import com.wechat.model.responseDto.JobAdvertisedRes;
import com.wechat.model.responseDto.JobAdvertisedResp;

@Service
public class MdeJobAdvertisedService extends BaseService{

	@Resource
	MdeJobAdvertisedDao jobAdvertisedDao;

	
	public int insert(MdeJobAdvertised mdeJobAdvertised) {
		return jobAdvertisedDao.insert(mdeJobAdvertised);
	}
	/**
	 * 收藏的职位列表
	 * @param strings
	 * @return
	 */
	public List<JobAdvertisedRes> getCollectionJobList(String[] jobListStr,String lang) {
		
		return jobAdvertisedDao.getCollectionJobList(jobListStr,lang);
	}
	public int update(MdeJobAdvertised mdeJobAdvertised) {
		return jobAdvertisedDao.update(mdeJobAdvertised);
	}
	
	/**
	 * 获取发布中的职位
	 * @param userCode
	 * @param lang
	 * @return
	 */
	public List<JobAdvertisedResp> getPublishingJobsByUserCode(String userCode, String lang) {
		return jobAdvertisedDao.getPublishingJobsByUserCode(userCode,lang);
	}
	
	/**
	 * 获取发布中的职位
	 * @param userCode
	 * @param lang
	 * @return
	 */
	public List<JobAdvertisedNologinResp> getPublishingJobsByUserCodeNologin(String userCode, String lang) {
		return jobAdvertisedDao.getPublishingJobsByUserCodeNologin(userCode,lang);
	}
	
	/**
	 * 获取酒店可首推和已首推个数  
	 * @param userCode
	 * @return
	 */
	public AvailableAndUsedCountDto getAvailableAndUsedCount(String userCode) {
		return jobAdvertisedDao.getAvailableAndUsedCount(userCode);
	}
	
	/**
	 * 获取发布中的职位(非登陆状态)
	 * @param userCode
	 * @param lang
	 * @return
	 */
	public List<JobAdvertisedNologinResp> getPublishingJobsNologin(String userCode) {
		return jobAdvertisedDao.getPublishingJobsNologin(userCode);
	}

}
