github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/resource_ownership.go (about) 1 package models 2 3 import ( 4 "github.com/machinefi/w3bstream/pkg/depends/base/types" 5 "github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes" 6 ) 7 8 // ResourceOwnership database model resource ownership 9 // @def primary ID 10 // @def unique_index UI_resource_account ResourceID AccountID 11 // 12 //go:generate toolkit gen model ResourceOwnership --database DB 13 type ResourceOwnership struct { 14 datatypes.PrimaryID 15 RelResource 16 RelAccount 17 ResourceOwnerInfo 18 datatypes.OperationTimes 19 } 20 type ResourceOwnerInfo struct { 21 UploadedAt types.Timestamp `db:"f_uploaded_at" json:"uploadedAt"` 22 ExpireAt types.Timestamp `db:"f_expire_at,default='0'" json:"expireAt"` 23 Filename string `db:"f_filename,default=''" json:"filename"` 24 Comment string `db:"f_comment,default=''" json:"comment"` 25 }