feat: migrate serevices
Some checks failed
build quyun / Build (push) Failing after 2m50s

This commit is contained in:
2025-12-19 19:05:12 +08:00
parent 005585c53b
commit 557a641f41
71 changed files with 5626 additions and 280 deletions

View File

@@ -8,6 +8,8 @@ import (
"context"
"time"
"quyun/v2/pkg/fields"
"go.ipao.vip/gen"
"go.ipao.vip/gen/types"
)
@@ -16,14 +18,14 @@ const TableNameMedia = "medias"
// Media mapped from table <medias>
type Media struct {
ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp without time zone;not null;default:now()" json:"created_at"`
Name string `gorm:"column:name;type:character varying(255);not null" json:"name"`
MimeType string `gorm:"column:mime_type;type:character varying(128);not null" json:"mime_type"`
Size int64 `gorm:"column:size;type:bigint;not null" json:"size"`
Path string `gorm:"column:path;type:character varying(255);not null" json:"path"`
Metas types.JSON `gorm:"column:metas;type:jsonb;not null;default:{}" json:"metas"`
Hash string `gorm:"column:hash;type:character varying(64);not null" json:"hash"`
ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp without time zone;not null;default:now()" json:"created_at"`
Name string `gorm:"column:name;type:character varying(255);not null" json:"name"`
MimeType string `gorm:"column:mime_type;type:character varying(128);not null" json:"mime_type"`
Size int64 `gorm:"column:size;type:bigint;not null" json:"size"`
Path string `gorm:"column:path;type:character varying(255);not null" json:"path"`
Metas types.JSONType[fields.MediaMetas] `gorm:"column:metas;type:jsonb;not null;default:{}" json:"metas"`
Hash string `gorm:"column:hash;type:character varying(64);not null" json:"hash"`
}
// Quick operations without importing query package