feat: add list profile

This commit is contained in:
Rogee
2024-12-09 20:33:35 +08:00
parent af8a8e9469
commit 0c9cb498d5
12 changed files with 125 additions and 40 deletions

View File

@@ -18,6 +18,7 @@ type Medias struct {
TenantID int64 `json:"tenant_id"`
Title string `json:"title"`
Description string `json:"description"`
Duration int64 `json:"duration"`
Price int64 `json:"price"`
Discount int64 `json:"discount"`
Publish bool `json:"publish"`

View File

@@ -22,6 +22,7 @@ type mediasTable struct {
TenantID postgres.ColumnInteger
Title postgres.ColumnString
Description postgres.ColumnString
Duration postgres.ColumnInteger
Price postgres.ColumnInteger
Discount postgres.ColumnInteger
Publish postgres.ColumnBool
@@ -73,14 +74,15 @@ func newMediasTableImpl(schemaName, tableName, alias string) mediasTable {
TenantIDColumn = postgres.IntegerColumn("tenant_id")
TitleColumn = postgres.StringColumn("title")
DescriptionColumn = postgres.StringColumn("description")
DurationColumn = postgres.IntegerColumn("duration")
PriceColumn = postgres.IntegerColumn("price")
DiscountColumn = postgres.IntegerColumn("discount")
PublishColumn = postgres.BoolColumn("publish")
ResourcesColumn = postgres.StringColumn("resources")
CreatedAtColumn = postgres.TimestampColumn("created_at")
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
allColumns = postgres.ColumnList{IDColumn, HashColumn, TenantIDColumn, TitleColumn, DescriptionColumn, PriceColumn, DiscountColumn, PublishColumn, ResourcesColumn, CreatedAtColumn, UpdatedAtColumn}
mutableColumns = postgres.ColumnList{HashColumn, TenantIDColumn, TitleColumn, DescriptionColumn, PriceColumn, DiscountColumn, PublishColumn, ResourcesColumn, CreatedAtColumn, UpdatedAtColumn}
allColumns = postgres.ColumnList{IDColumn, HashColumn, TenantIDColumn, TitleColumn, DescriptionColumn, DurationColumn, PriceColumn, DiscountColumn, PublishColumn, ResourcesColumn, CreatedAtColumn, UpdatedAtColumn}
mutableColumns = postgres.ColumnList{HashColumn, TenantIDColumn, TitleColumn, DescriptionColumn, DurationColumn, PriceColumn, DiscountColumn, PublishColumn, ResourcesColumn, CreatedAtColumn, UpdatedAtColumn}
)
return mediasTable{
@@ -92,6 +94,7 @@ func newMediasTableImpl(schemaName, tableName, alias string) mediasTable {
TenantID: TenantIDColumn,
Title: TitleColumn,
Description: DescriptionColumn,
Duration: DurationColumn,
Price: PriceColumn,
Discount: DiscountColumn,
Publish: PublishColumn,