MCPcopy Index your code
hub / github.com/TruthHun/DocHub / DelRows

Method DelRows

models/RecycleModel.go:297–330  ·  view source on GitHub ↗

删除文档记录

(ids ...interface{})

Source from the content-addressed store, hash-verified

295
296//删除文档记录
297func (this *DocumentRecycle) DelRows(ids ...interface{}) (err error) {
298 //1、删除被收藏的收藏记录
299 //2、删除文档的评论(评分)记录
300 //3、删除document表的记录
301 //4、删除document_info表的记录
302 //【这个不删除】5、删除document_store表的记录
303 //6、删除回收站中的记录
304 var (
305 o = orm.NewOrm()
306 )
307
308 if err = NewCollect().DelByDocId(ids...); err != orm.ErrNoRows && err != nil {
309 return
310 }
311
312 //删除评论
313 if err = NewDocumentComment().DelCommentByDocId(ids...); err != orm.ErrNoRows && err != nil {
314 return
315 }
316
317 if _, err = o.QueryTable(GetTableDocumentInfo()).Filter("Id__in", ids).Delete(); err != orm.ErrNoRows && err != nil {
318 return
319 }
320
321 if _, err = o.QueryTable(GetTableDocument()).Filter("Id__in", ids...).Delete(); err != orm.ErrNoRows && err != nil {
322 return
323 }
324
325 if _, err = o.QueryTable(GetTableDocumentRecycle()).Filter("Id__in", ids...).Delete(); err != orm.ErrNoRows && err != nil {
326 return
327 }
328
329 return
330}
331
332//根据md5,删除文档、封面、预览文件等
333//@param md5 文档md5

Callers 2

ActionMethod · 0.95
DeepDelMethod · 0.95

Calls 8

NewCollectFunction · 0.85
NewDocumentCommentFunction · 0.85
GetTableDocumentInfoFunction · 0.85
GetTableDocumentFunction · 0.85
GetTableDocumentRecycleFunction · 0.85
DelByDocIdMethod · 0.80
DelCommentByDocIdMethod · 0.80
DeleteMethod · 0.80

Tested by

no test coverage detected