0946a3f66c
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 14s
CI / ui (pull_request) Successful in 49s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m12s
Turn the gated-off mock banner into a real advertising subsystem (backend + admin half; the UI rotation lands in PR2). - internal/ads: campaigns (percent weight + validity window; a perpetual, undeletable default that fills the remainder up to 100%), 1..N bilingual messages (en+ru), global display timings; ActiveSet computes the window-filtered, default-remainder, GCD-reduced, language-resolved rotation feed. Smooth-weighted-round-robin math is unit-tested. - migration 00006 (+ jetgen): ad_campaigns / ad_messages / ad_settings, seeded default campaign + house message + default timings. - eligibility = !paid_account && hint_balance==0 && !no_banner role (new role; guests qualify). The resolved feed rides the profile.get response (no new RPC, works for guests, nothing distinct to filter); language by service_language. - live update: a notify `banner` sub-kind (re-poll signal) published when an operator grants hints or grants/revokes no_banner, so the client shows/hides in place. - admin console /_gm/banners (+ /_gm/banner-settings): campaign + message CRUD with reorder, default protection, clamped timings. - wire: fbs BannerInfo/BannerCampaign on Profile; gateway transcode forwards it. - docs: ARCHITECTURE §10, FUNCTIONAL (+ _ru), backend README, PRERELEASE tracker (incl. the deferred app.load aggregator note).
100 lines
3.3 KiB
Go
100 lines
3.3 KiB
Go
//
|
|
// Code generated by go-jet DO NOT EDIT.
|
|
//
|
|
// WARNING: Changes to this file may cause incorrect behavior
|
|
// and will be lost if the code is regenerated
|
|
//
|
|
|
|
package table
|
|
|
|
import (
|
|
"github.com/go-jet/jet/v2/postgres"
|
|
)
|
|
|
|
var AdSettings = newAdSettingsTable("backend", "ad_settings", "")
|
|
|
|
type adSettingsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnBool
|
|
HoldMs postgres.ColumnInteger
|
|
EdgePauseMs postgres.ColumnInteger
|
|
ScrollPxPerSec postgres.ColumnInteger
|
|
FadeOutMs postgres.ColumnInteger
|
|
GapMs postgres.ColumnInteger
|
|
FadeInMs postgres.ColumnInteger
|
|
UpdatedAt postgres.ColumnTimestampz
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type AdSettingsTable struct {
|
|
adSettingsTable
|
|
|
|
EXCLUDED adSettingsTable
|
|
}
|
|
|
|
// AS creates new AdSettingsTable with assigned alias
|
|
func (a AdSettingsTable) AS(alias string) *AdSettingsTable {
|
|
return newAdSettingsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new AdSettingsTable with assigned schema name
|
|
func (a AdSettingsTable) FromSchema(schemaName string) *AdSettingsTable {
|
|
return newAdSettingsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new AdSettingsTable with assigned table prefix
|
|
func (a AdSettingsTable) WithPrefix(prefix string) *AdSettingsTable {
|
|
return newAdSettingsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new AdSettingsTable with assigned table suffix
|
|
func (a AdSettingsTable) WithSuffix(suffix string) *AdSettingsTable {
|
|
return newAdSettingsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newAdSettingsTable(schemaName, tableName, alias string) *AdSettingsTable {
|
|
return &AdSettingsTable{
|
|
adSettingsTable: newAdSettingsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newAdSettingsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newAdSettingsTableImpl(schemaName, tableName, alias string) adSettingsTable {
|
|
var (
|
|
IDColumn = postgres.BoolColumn("id")
|
|
HoldMsColumn = postgres.IntegerColumn("hold_ms")
|
|
EdgePauseMsColumn = postgres.IntegerColumn("edge_pause_ms")
|
|
ScrollPxPerSecColumn = postgres.IntegerColumn("scroll_px_per_sec")
|
|
FadeOutMsColumn = postgres.IntegerColumn("fade_out_ms")
|
|
GapMsColumn = postgres.IntegerColumn("gap_ms")
|
|
FadeInMsColumn = postgres.IntegerColumn("fade_in_ms")
|
|
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
|
allColumns = postgres.ColumnList{IDColumn, HoldMsColumn, EdgePauseMsColumn, ScrollPxPerSecColumn, FadeOutMsColumn, GapMsColumn, FadeInMsColumn, UpdatedAtColumn}
|
|
mutableColumns = postgres.ColumnList{HoldMsColumn, EdgePauseMsColumn, ScrollPxPerSecColumn, FadeOutMsColumn, GapMsColumn, FadeInMsColumn, UpdatedAtColumn}
|
|
defaultColumns = postgres.ColumnList{IDColumn, UpdatedAtColumn}
|
|
)
|
|
|
|
return adSettingsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
HoldMs: HoldMsColumn,
|
|
EdgePauseMs: EdgePauseMsColumn,
|
|
ScrollPxPerSec: ScrollPxPerSecColumn,
|
|
FadeOutMs: FadeOutMsColumn,
|
|
GapMs: GapMsColumn,
|
|
FadeInMs: FadeInMsColumn,
|
|
UpdatedAt: UpdatedAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|