Merge branch 'develop'

admin [init ok]
lea++ blog platform [ok]
This commit is contained in:
life committed 2014-09-24 22:24:52 +08:00
1 parent 99956cfd72
commit 87269cc939
409 files changed
+28646 -18

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ type BlogItem struct {
Note
Content string // 可能是content的一部分, 截取. 点击more后就是整个信息了
HasMore bool // 是否是否还有
User User // 用户信息
}
type UserBlogBase struct {
+15
View File
@@ -0,0 +1,15 @@
package info
import (
"gopkg.in/mgo.v2/bson"
"time"
)
// 配置
// 用户配置高于全局配置
type Config struct {
UserId bson.ObjectId `bson:"_id"`
StringConfigs map[string]string `StringConfigs` // key => value
ArrayConfigs map[string][]string `ArrayConfigs` // key => []value
UpdatedTime time.Time `UpdatedTime`
}
+2
View File
@@ -17,9 +17,11 @@ type Note struct {
ImgSrc string `ImgSrc` // 图片, 第一张缩略图地址
Tags []string `Tags,omitempty`
IsTrash bool `IsTrash` // 是否是trash, 默认是false
IsBlog bool `IsBlog,omitempty` // 是否设置成了blog 2013/12/29 新加
IsRecommend bool `IsRecommend,omitempty` // 是否为推荐博客 2014/9/24新加
IsTop bool `IsTop,omitempty` // blog是否置顶
IsMarkdown bool `IsMarkdown` // 是否是markdown笔记, 默认是false
+1
View File
@@ -20,6 +20,7 @@ type User struct {
Pwd string `bson:"Pwd" json:"-"`
CreatedTime time.Time `CreatedTime`
Logo string `Logo` // 9-24
// 主题
Theme string `Theme`
+9
View File
@@ -1,6 +1,7 @@
package info
import (
"math"
)
@@ -10,4 +11,12 @@ type Page struct {
TotalPage int // 总页
Count int // 总记录数
List interface{}
}
func NewPage(page, perPageSize, count int, list interface{}) Page {
totalPage := 0
if count > 0 {
totalPage = int(math.Ceil(float64(count) / float64(perPageSize)))
}
return Page{page, totalPage, count, list}
}