Example #1
0
func (a *Article) List(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	articles, pageInfo := repository.GetArticleListForPage(1)
	data := map[string]interface{}{
		"Title":    "Hello World!",
		"articles": articles,
		"pageInfo": pageInfo,
	}
	makeTemplateExcute("list", data, w)
}
Example #2
0
func BoardListPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	requestPage, err := strconv.Atoi(ps.ByName("pageNumber"))
	checkIsNumber(err, w, r)

	articles, pageInfo := repository.GetArticleListForPage(requestPage)
	data := map[string]interface{}{
		"Title":    "Hello World!",
		"articles": articles,
		"pageInfo": pageInfo,
	}
	makeTemplateExcute("list", data, w)

}