From a3a24e1cf44aa4e95a8684c86455a2b7064ac623 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期二, 23 七月 2024 04:51:29 +0800 Subject: [PATCH] 定时删除本地存储的图片 --- models/ape.go | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/models/ape.go b/models/ape.go index 89ccdce..6c98447 100644 --- a/models/ape.go +++ b/models/ape.go @@ -8,6 +8,7 @@ type Ape struct { Id string `gorm:"column:id;primary_key;" json:"id"` Name string `gorm:"column:name" json:"name"` + FromId string `gorm:"column:from_id" json:"from_id"` HeartbeatTime string `gorm:"column:heartbeat_time" json:"heartbeat_time"` Ext vo.Ape `gorm:"column:ext;type:json;not null;default '{}'" json:"ext"` CreateTime int64 `gorm:"column:create_time;autoCreateTime;" json:"create_time"` @@ -27,8 +28,8 @@ return db.Table(a.TableName()).Save(a).Error } -func (a *Ape) Keepalive() error { - return db.Table(a.TableName()).Where("id = ?", a.Id).Update("heartbeat_time", time.Now().Format("2006-01-02 15:04:05")).Error +func (a *Ape) Keepalive(id string) error { + return db.Table(a.TableName()).Where("id = ?", id).Update("heartbeat_time", time.Now().Format("2006-01-02 15:04:05")).Error } func (a *Ape) FindAll() ([]Ape, error) { -- Gitblit v1.8.0