1、实现网站首页

2、实现文档阅读
3、实现项目发布
4、实现用户权限
This commit is contained in:
lifei6671
2017-04-30 22:13:12 +08:00
parent d38417535a
commit ad67558b80
36 changed files with 1486 additions and 233 deletions

View File

@@ -2,8 +2,8 @@ package models
import (
"time"
"github.com/astaxie/beego/orm"
"strings"
"github.com/astaxie/beego/logs"
"github.com/lifei6671/godoc/conf"
)
@@ -23,6 +23,7 @@ type BookResult struct {
CreateName string `json:"create_name"`
ModifyTime time.Time `json:"modify_time"`
Cover string `json:"cover"`
Theme string `json:"theme"`
Label string `json:"label"`
MemberId int `json:"member_id"`
Editor string `json:"editor"`
@@ -39,6 +40,7 @@ func NewBookResult() *BookResult {
return &BookResult{}
}
// 根据项目标识查询项目以及指定用户权限的信息.
func (m *BookResult) FindByIdentify(identify string,member_id int) (*BookResult,error) {
if identify == "" || member_id <= 0 {
@@ -77,24 +79,9 @@ func (m *BookResult) FindByIdentify(identify string,member_id int) (*BookResult,
return m, err
}
m.BookId = book.BookId
m.BookName = book.BookName
m.Identify = book.Identify
m.OrderIndex = book.OrderIndex
m.Description = strings.Replace(book.Description, "\r\n", "<br/>", -1)
m.PrivatelyOwned = book.PrivatelyOwned
m.PrivateToken = book.PrivateToken
m.DocCount = book.DocCount
m.CommentStatus = book.CommentStatus
m.CommentCount = book.CommentCount
m.CreateTime = book.CreateTime
m.CreateName = member.Account
m.ModifyTime = book.ModifyTime
m.Cover = book.Cover
m.Label = book.Label
m.Status = book.Status
m.Editor = book.Editor
m = book.ToBookResult()
m.CreateName = member.Account
m.MemberId = relationship.MemberId
m.RoleId = relationship.RoleId
m.RelationshipId = relationship.RelationshipId