package org.jerrymouse.chineseCalendar.service;

import java.util.List;

import org.jerrymouse.chineseCalendar.model.atom.SystemInfo;
import org.jerrymouse.chineseCalendar.model.birthday.Birthday;
import org.jerrymouse.chineseCalendar.model.birthday.BirthdayEncoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SiteService {
	@Autowired
	SystemInfo systemInfo;
	@Autowired
	BirthdayEncoder birthdayEncoder;

	public String encodeFeedURL(List<Birthday> birthdays) {
		String url = systemInfo.getMainURL();
		url += "/feed?data=";
		url += birthdayEncoder.encode(birthdays);
		return url;
	}

	public String encodeMainURL(List<Birthday> birthdays) {
		String url = systemInfo.getMainURL();
		url += "/birthdays?data=";
		url += birthdayEncoder.encode(birthdays);
		return url;
	}
}
