models

package
v0.0.0-...-5757ea1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDoc

func AddDoc(code, title, label, principal string, end time.Time, uid int64) (id int64, err error)

添加成果到项目侧栏某个id下 如果这个侧栏id下的这个成果编号已经存在,则返回id //应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个

func AddOnlyAttachment

func AddOnlyAttachment(filename string, filesize, downloads, productid int64) (id int64, err1, err2 error)

添加附件到成果id下 如果附件名称已经存在,则不再追加写入数据库 应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个

func AddOnlyChanges

func AddOnlyChanges(key, uid, uname, created string) (id int64, err1, err2 error)

添加历史版本

func AddOnlyHistory

func AddOnlyHistory(onlyattachmentid, uid int64, serverversion string, version int, key, fileurl, changesurl string, expires, created time.Time) (id int64, err1, err2 error)

添加历史版本

func DeleteDoc

func DeleteDoc(cid int64) error

删除_把附件也一并删除(在controllers中实现吧)

func DeleteOnlyAttachment

func DeleteOnlyAttachment(cid int64) error

删除附件

func UpdateDoc

func UpdateDoc(cid int64, code, title, label, principal string, end time.Time) error

修改成果信息

func UpdateDocTime

func UpdateDocTime(cid int64) error

修改成果时间信息

func UpdateOnlyAttachment

func UpdateOnlyAttachment(cid int64) (err error)

修改附件的日期和changesurl修改记录地址

Types

type OnlyAttachment

type OnlyAttachment struct {
	Id        int64
	FileName  string
	FileSize  int64
	Downloads int64
	DocId     int64 //*Topic `orm:"rel(fk)"`
	// Changesurl string    `orm:"null"` //文件修改记录
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

附件

func GetOnlyAttachbyId

func GetOnlyAttachbyId(Id int64) (attach OnlyAttachment, err error)

根据附件id查询附件

func GetOnlyAttachments

func GetOnlyAttachments(id int64) (attachments []*OnlyAttachment, err error)

根据成果id取得所有附件

type OnlyChanges

type OnlyChanges struct {
	Id         int64
	HistoryKey string `orm:"sie(19)"`
	UserId     string `orm:"sie(10)"`
	UserName   string `orm:"sie(20)"`
	Created    string `orm:"sie(19)"`
}

修改情况

func GetOnlyChanges

func GetOnlyChanges(key string) (onlychanges []*OnlyChanges, err error)

根据附件历史版本key获取历史版本修改信息

type OnlyHistory

type OnlyHistory struct {
	Id            int64
	AttachId      int64
	UserId        int64
	ServerVersion string
	Version       int
	FileUrl       string
	ChangesUrl    string    //`orm:"null"`
	HistoryKey    string    `orm:"sie(19)"`
	Expires       time.Time `orm:"type(datetime)"`
	Created       time.Time `orm:"type(datetime)"`
}

历史版本

func GetOnlyHistory

func GetOnlyHistory(onlyattachmentid int64) (onlyhistories []*OnlyHistory, err error)

根据附件id获取历史版本信息

func GetOnlyHistoryVersion

func GetOnlyHistoryVersion(onlyattachmentid int64) (onlyhistories []OnlyHistory, err error)

获取附件id历史版本号

type OnlyOffice

type OnlyOffice struct {
	Id        int64     `form:"-"`
	Code      string    `orm:"null"`
	Title     string    `orm:"null"`
	Label     string    `orm:"null"`
	End       time.Time `orm:"null;type(datetime)"`
	Principal string    `orm:"null"`
	// Ext     string    `orm:"null"`
	Uid     int64     `orm:"null"`
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

func GetDocs

func GetDocs() (docs []*OnlyOffice, err error)

取得所有项目

func Getdocbyid

func Getdocbyid(id int64) (doc OnlyOffice, err error)

根据docid获得docuid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL