fusenapi/model/gmodel/fs_resource_gen.go
2023-09-07 11:28:06 +08:00

31 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package gmodel
import (
"time"
"gorm.io/gorm"
)
// fs_resource 资源表
type FsResource struct {
ResourceId string `gorm:"primary_key;default:'';" json:"resource_id"` // 资源 ID
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户 ID
GuestId *int64 `gorm:"index;default:0;" json:"guest_id"` // 访客 ID
ResourceType *string `gorm:"index;default:'';" json:"resource_type"` // 资源类型
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` // 资源 URL
Version *string `gorm:"index;default:'0';" json:"version"` // 版本信息
UploadedAt *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"uploaded_at"` //
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
ApiType *int64 `gorm:"default:1;" json:"api_type"` // 调用类型1=对外2=对内
BucketName *string `gorm:"default:'';" json:"bucket_name"` // 存储桶名: 1=持久 2=缓存
Source *string `gorm:"default:'';" json:"source"` // 来源
}
type FsResourceModel struct {
db *gorm.DB
name string
}
func NewFsResourceModel(db *gorm.DB) *FsResourceModel {
return &FsResourceModel{db: db, name: "fs_resource"}
}