feat: update video cut and extract head image job
This commit is contained in:
7
backend/database/fields/medias.go
Normal file
7
backend/database/fields/medias.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package fields
|
||||
|
||||
type MediaMetas struct {
|
||||
ParentHash string `json:"parent_hash,omitempty"`
|
||||
Short bool `json:"short,omitempty"`
|
||||
Duration int64 `json:"duration,omitempty"`
|
||||
}
|
||||
@@ -7,6 +7,7 @@ CREATE TABLE medias(
|
||||
mime_type varchar(128) NOT NULL DEFAULT '',
|
||||
size int8 NOT NULL DEFAULT 0,
|
||||
path varchar(255) NOT NULL DEFAULT '',
|
||||
metas jsonb NOT NULL DEFAULT '{}' ::jsonb,
|
||||
hash varchar(64) NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
|
||||
@@ -8,15 +8,17 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"quyun/database/fields"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Medias struct {
|
||||
ID int64 `sql:"primary_key" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Name string `json:"name"`
|
||||
MimeType string `json:"mime_type"`
|
||||
Size int64 `json:"size"`
|
||||
Path string `json:"path"`
|
||||
Hash string `json:"hash"`
|
||||
ID int64 `sql:"primary_key" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Name string `json:"name"`
|
||||
MimeType string `json:"mime_type"`
|
||||
Size int64 `json:"size"`
|
||||
Path string `json:"path"`
|
||||
Hash string `json:"hash"`
|
||||
Metas fields.Json[fields.MediaMetas] `json:"metas"`
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ type mediasTable struct {
|
||||
Size postgres.ColumnInteger
|
||||
Path postgres.ColumnString
|
||||
Hash postgres.ColumnString
|
||||
Metas postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
@@ -71,8 +72,9 @@ func newMediasTableImpl(schemaName, tableName, alias string) mediasTable {
|
||||
SizeColumn = postgres.IntegerColumn("size")
|
||||
PathColumn = postgres.StringColumn("path")
|
||||
HashColumn = postgres.StringColumn("hash")
|
||||
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, NameColumn, MimeTypeColumn, SizeColumn, PathColumn, HashColumn}
|
||||
mutableColumns = postgres.ColumnList{CreatedAtColumn, NameColumn, MimeTypeColumn, SizeColumn, PathColumn, HashColumn}
|
||||
MetasColumn = postgres.StringColumn("metas")
|
||||
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, NameColumn, MimeTypeColumn, SizeColumn, PathColumn, HashColumn, MetasColumn}
|
||||
mutableColumns = postgres.ColumnList{CreatedAtColumn, NameColumn, MimeTypeColumn, SizeColumn, PathColumn, HashColumn, MetasColumn}
|
||||
)
|
||||
|
||||
return mediasTable{
|
||||
@@ -86,6 +88,7 @@ func newMediasTableImpl(schemaName, tableName, alias string) mediasTable {
|
||||
Size: SizeColumn,
|
||||
Path: PathColumn,
|
||||
Hash: HashColumn,
|
||||
Metas: MetasColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
|
||||
@@ -25,3 +25,6 @@ types:
|
||||
orders:
|
||||
status: OrderStatus
|
||||
meta: Json[OrderMeta]
|
||||
|
||||
medias:
|
||||
metas: Json[MediaMetas]
|
||||
|
||||
Reference in New Issue
Block a user