8 changed files with 41 additions and 25 deletions
Binary file not shown.
@ -0,0 +1,19 @@ |
|||||
|
package utils |
||||
|
|
||||
|
type Page struct { |
||||
|
PageNo int |
||||
|
PageSize int |
||||
|
TotalPage int |
||||
|
TotalCount int |
||||
|
FirstPage bool |
||||
|
LastPage bool |
||||
|
List interface{} |
||||
|
} |
||||
|
|
||||
|
func PageUtil(count int, pageNo int, pageSize int, list interface{}) Page { |
||||
|
tp := count / pageSize |
||||
|
if count % pageSize > 0 { |
||||
|
tp = count / pageSize + 1 |
||||
|
} |
||||
|
return Page{PageNo: pageNo, PageSize: pageSize, TotalPage: tp, TotalCount: count, FirstPage: pageNo == 1, LastPage: pageNo == tp, List: list} |
||||
|
} |
@ -1,14 +0,0 @@ |
|||||
{{template "header"}} |
|
||||
<title>博客 - 个人随笔</title> |
|
||||
<link type="text/css" rel="styleSheet" href="/static/css/newblog.css"/> |
|
||||
</head> |
|
||||
<body> |
|
||||
<div class="root-container"> |
|
||||
{{template "nav" .}} |
|
||||
<div class="blog-root"> |
|
||||
<h1>{{.Blog.Title}}</h1> |
|
||||
|
|
||||
</div> |
|
||||
</div> |
|
||||
</body> |
|
||||
</html> |
|
Loading…
Reference in new issue