1、实现富文本编辑器

2、实现文档转换为PDF、MOBI、EPUB、Word格式
3、实现登录后跳转到来源地址
This commit is contained in:
Minho
2018-01-26 17:17:38 +08:00
parent e1ec6bb788
commit 882d93e7b0
57 changed files with 1572 additions and 1475 deletions

View File

@@ -8,27 +8,27 @@ import (
type AttachmentResult struct {
Attachment
IsExist bool
BookName string
DocumentName string
IsExist bool
BookName string
DocumentName string
FileShortSize string
Account string
Account string
LocalHttpPath string
}
func NewAttachmentResult() *AttachmentResult {
return &AttachmentResult{ IsExist : false }
return &AttachmentResult{IsExist: false}
}
func (m *AttachmentResult) Find(id int) (*AttachmentResult,error) {
func (m *AttachmentResult) Find(id int) (*AttachmentResult, error) {
o := orm.NewOrm()
attach := NewAttachment()
err := o.QueryTable(m.TableNameWithPrefix()).Filter("attachment_id",id).One(attach)
err := o.QueryTable(m.TableNameWithPrefix()).Filter("attachment_id", id).One(attach)
if err != nil {
return m,err
return m, err
}
m.Attachment = *attach
@@ -50,12 +50,12 @@ func (m *AttachmentResult) Find(id int) (*AttachmentResult,error) {
if attach.CreateAt > 0 {
member := NewMember()
if e := o.QueryTable(member.TableNameWithPrefix()).Filter("member_id",attach.CreateAt).One(member,"account");e == nil {
if e := o.QueryTable(member.TableNameWithPrefix()).Filter("member_id", attach.CreateAt).One(member, "account"); e == nil {
m.Account = member.Account
}
}
m.FileShortSize = utils.FormatBytes(int64(attach.FileSize))
m.LocalHttpPath = strings.Replace(m.FilePath,"\\","/",-1)
m.LocalHttpPath = strings.Replace(m.FilePath, "\\", "/", -1)
return m,nil
}
return m, nil
}