package egovframework.cross.rss.web; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.rometools.rome.feed.atom.Category; import com.rometools.rome.feed.atom.Content; import com.rometools.rome.feed.atom.Feed; import com.rometools.rome.feed.atom.Link; import com.rometools.rome.feed.atom.Person; import com.rometools.rome.feed.synd.SyndPerson; import egovframework.com.cmm.service.Globals; import egovframework.cross.rss.service.RssFeedVO; import egovframework.cross.rss.view.RssFeedView; /** * RSS 피드 Controller * * @since 2022. 2. 16 * @author 임종호 * *
 * -----------------------
 * 개정이력
 * 2022. 2. 16 임종호 : 최초작성
 * 
*/ @Controller public class RssFeedController { @Autowired private RssFeedView rssFeedView; /** * RSS Feed * @Author : 임종호 * @Date : 2022. 2. 16 * @Method Name : atom * @return : AtomFeedView */ @RequestMapping(value = "/rss.do") public RssFeedView atom(Model model) { // 임시 데이터 RssFeedVO vo = new RssFeedVO(); vo.setId(""); vo.setPublished(new Date()); vo.setTitle("제목1111111111"); // 링크 Link link = new Link(); link.setHref("http://naver.com"); vo.setAlternateLinks(Collections.singletonList(link)); // 내용 Content content = new Content(); content.setValue("
내요용요
"); content.setType("html"); vo.setContents(Collections.singletonList(content)); // 분류 Category category = new Category(); category.setTerm("카테고리11"); vo.setCategories(Collections.singletonList(category)); // 작성자 SyndPerson author = new Person(); author.setName("작성자1"); vo.setAuthors(Collections.singletonList(author)); List list = new ArrayList(); list.add(vo); model.addAttribute("datas", list); return rssFeedView; } }