feat:实现团队功能

This commit is contained in:
lifei6671
2018-11-08 20:08:30 +08:00
parent d152455c50
commit 64edcf97ce
5 changed files with 30 additions and 77 deletions

View File

@@ -23,6 +23,7 @@ import (
"github.com/lifei6671/mindoc/utils/ziptil"
"gopkg.in/russross/blackfriday.v2"
"encoding/json"
"github.com/lifei6671/mindoc/utils"
)
// Book struct .
@@ -104,7 +105,7 @@ func NewBook() *Book {
func (book *Book) Insert() error {
o := orm.NewOrm()
// o.Begin()
book.BookName = utils.StripTags(book.BookName)
_, err := o.Insert(book)
if err == nil {
@@ -153,6 +154,7 @@ func (book *Book) Find(id int,cols ...string) (*Book, error) {
func (book *Book) Update(cols ...string) error {
o := orm.NewOrm()
book.BookName = utils.StripTags(book.BookName)
temp := NewBook()
temp.BookId = book.BookId

View File

@@ -90,6 +90,7 @@ func (item *Document) Find(id int) (*Document, error) {
//插入和更新文档.
func (item *Document) InsertOrUpdate(cols ...string) error {
o := orm.NewOrm()
item.DocumentName = utils.StripTags(item.DocumentName)
var err error
if item.DocumentId > 0 {
_, err = o.Update(item, cols...)