根据md5判断文档是否存在 @param md5str 文档的md5 @return Id 文档存储表的id
(md5str string)
| 251 | //@param md5str 文档的md5 |
| 252 | //@return Id 文档存储表的id |
| 253 | func (this *Document) IsExistByMd5(md5str string) (Id int) { |
| 254 | var ds DocumentStore |
| 255 | orm.NewOrm().QueryTable(GetTableDocumentStore()).Filter("Md5", md5str).One(&ds) |
| 256 | return ds.Id |
| 257 | } |
| 258 | |
| 259 | //文档软删除,即把文档状态标记为-1,操作之后,需要把总文档数量、用户文档数量-1,同时把文档id移入回收站 |
| 260 | func (this *Document) SoftDel(uid int, isAdmin bool, ids ...interface{}) (err error) { |
no test coverage detected