mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-21 03:44:17 +08:00
实现文档编辑
This commit is contained in:
@@ -9,9 +9,11 @@ import (
|
||||
// Attachment struct .
|
||||
type Attachment struct {
|
||||
AttachmentId int `orm:"column(attachment_id);pk;auto;unique" json:"attachment_id"`
|
||||
DocumentId int `orm:"column(document_id);type(int)" json:"document_id"`
|
||||
FileName string `orm:"column(file_name);size(2000)" json:"file_name"`
|
||||
BookId int `orm:"column(book_id);type(int)" json:"book_id"`
|
||||
FileName string `orm:"column(file_name);size(255)" json:"file_name"`
|
||||
FilePath string `orm:"column(file_path);size(2000)" json:"file_path"`
|
||||
FileSize float64 `orm:"column(file_size);type(float)" json:"file_size"`
|
||||
HttpPath string `orm:"column(http_path);size(2000)" json:"http_path"`
|
||||
FileExt string `orm:"column(file_ext);size(50)" json:"file_ext"`
|
||||
CreateTime time.Time `orm:"type(datetime);column(create_time);auto_now_add"`
|
||||
CreateAt int `orm:"column(create_at);type(int)" json:"create_at"`
|
||||
@@ -41,6 +43,11 @@ func (m *Attachment) Insert() error {
|
||||
|
||||
return err
|
||||
}
|
||||
func (m *Attachment) Update() error {
|
||||
o := orm.NewOrm()
|
||||
_,err := o.Update(m)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *Attachment) Find(id int) (*Attachment,error) {
|
||||
if id <= 0 {
|
||||
|
Reference in New Issue
Block a user