fusenapi/model/gmodel/fs_resource_gen.go
laodaming f519e27719 fix
2023-08-18 11:41:36 +08:00

31 lines
1.6 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 (
"gorm.io/gorm"
"time"
)
// 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 *string `gorm:"default:'';" json:"metadata"` // 元数据,json格式,存储图像分率
MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加
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"}
}