Finish the logger maintain things.

This commit is contained in:
zicla
2018-11-30 22:01:31 +08:00
parent 84703a8971
commit 1bdfb4996e
8 changed files with 138 additions and 15 deletions

View File

@ -6,8 +6,8 @@ import (
_ "github.com/jinzhu/gorm/dialects/mysql"
"github.com/nu7hatch/gouuid"
"os"
"time"
"strings"
"time"
)
type MatterDao struct {
@ -216,6 +216,12 @@ func (this *MatterDao) Save(matter *Matter) *Matter {
return matter
}
//计数器加一
func (this *MatterDao) TimesIncrement(matterUuid string) {
db := CONTEXT.DB.Model(&Matter{}).Where("uuid = ?", matterUuid).Update("times", gorm.Expr("times + 1"))
this.PanicError(db.Error)
}
//删除一个文件,数据库中删除,物理磁盘上删除。
func (this *MatterDao) Delete(matter *Matter) {