mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
feat:实现团队功能
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user