2020-02-09 21:25:33 +01:00
|
|
|
package models
|
|
|
|
|
2020-02-11 14:32:35 +01:00
|
|
|
import (
|
|
|
|
"time"
|
2020-07-10 18:35:37 +02:00
|
|
|
|
2020-11-26 20:48:04 +01:00
|
|
|
"gorm.io/gorm"
|
2020-02-11 14:32:35 +01:00
|
|
|
)
|
2020-02-09 21:25:33 +01:00
|
|
|
|
|
|
|
type ShareToken struct {
|
2020-11-26 20:48:04 +01:00
|
|
|
gorm.Model
|
2020-02-09 21:25:33 +01:00
|
|
|
Value string
|
2020-11-26 20:48:04 +01:00
|
|
|
OwnerID uint
|
|
|
|
Owner User
|
2020-02-09 21:25:33 +01:00
|
|
|
Expire *time.Time
|
|
|
|
Password *string
|
2020-11-26 20:48:04 +01:00
|
|
|
AlbumID *uint
|
|
|
|
Album Album
|
|
|
|
MediaID *uint
|
|
|
|
Media *Media
|
2020-02-09 21:25:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (share *ShareToken) Token() string {
|
|
|
|
return share.Value
|
|
|
|
}
|