1
Fork 0
photoview/api/graphql/models/share_token.go

23 lines
439 B
Go
Raw Normal View History

2020-02-09 21:25:33 +01:00
package models
2020-02-11 14:32:35 +01:00
import (
"time"
)
2020-02-09 21:25:33 +01:00
type ShareToken struct {
Model
Value string `gorm:"not null"`
OwnerID int `gorm:"not null"`
Owner User `gorm:"constraint:OnDelete:CASCADE;"`
2020-02-09 21:25:33 +01:00
Expire *time.Time
Password *string
AlbumID *int
Album *Album `gorm:"constraint:OnDelete:CASCADE;"`
MediaID *int
Media *Media `gorm:"constraint:OnDelete:CASCADE;"`
2020-02-09 21:25:33 +01:00
}
func (share *ShareToken) Token() string {
return share.Value
}