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).
88 lines
2.3 KiB
Go
88 lines
2.3 KiB
Go
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
|
|
|
|
package scrabblefb
|
|
|
|
import (
|
|
flatbuffers "github.com/google/flatbuffers/go"
|
|
)
|
|
|
|
type BannerCampaign struct {
|
|
_tab flatbuffers.Table
|
|
}
|
|
|
|
func GetRootAsBannerCampaign(buf []byte, offset flatbuffers.UOffsetT) *BannerCampaign {
|
|
n := flatbuffers.GetUOffsetT(buf[offset:])
|
|
x := &BannerCampaign{}
|
|
x.Init(buf, n+offset)
|
|
return x
|
|
}
|
|
|
|
func FinishBannerCampaignBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
|
|
builder.Finish(offset)
|
|
}
|
|
|
|
func GetSizePrefixedRootAsBannerCampaign(buf []byte, offset flatbuffers.UOffsetT) *BannerCampaign {
|
|
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
|
|
x := &BannerCampaign{}
|
|
x.Init(buf, n+offset+flatbuffers.SizeUint32)
|
|
return x
|
|
}
|
|
|
|
func FinishSizePrefixedBannerCampaignBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
|
|
builder.FinishSizePrefixed(offset)
|
|
}
|
|
|
|
func (rcv *BannerCampaign) Init(buf []byte, i flatbuffers.UOffsetT) {
|
|
rcv._tab.Bytes = buf
|
|
rcv._tab.Pos = i
|
|
}
|
|
|
|
func (rcv *BannerCampaign) Table() flatbuffers.Table {
|
|
return rcv._tab
|
|
}
|
|
|
|
func (rcv *BannerCampaign) Weight() int32 {
|
|
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
|
if o != 0 {
|
|
return rcv._tab.GetInt32(o + rcv._tab.Pos)
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (rcv *BannerCampaign) MutateWeight(n int32) bool {
|
|
return rcv._tab.MutateInt32Slot(4, n)
|
|
}
|
|
|
|
func (rcv *BannerCampaign) Messages(j int) []byte {
|
|
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
|
|
if o != 0 {
|
|
a := rcv._tab.Vector(o)
|
|
return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4))
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (rcv *BannerCampaign) MessagesLength() int {
|
|
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
|
|
if o != 0 {
|
|
return rcv._tab.VectorLen(o)
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func BannerCampaignStart(builder *flatbuffers.Builder) {
|
|
builder.StartObject(2)
|
|
}
|
|
func BannerCampaignAddWeight(builder *flatbuffers.Builder, weight int32) {
|
|
builder.PrependInt32Slot(0, weight, 0)
|
|
}
|
|
func BannerCampaignAddMessages(builder *flatbuffers.Builder, messages flatbuffers.UOffsetT) {
|
|
builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(messages), 0)
|
|
}
|
|
func BannerCampaignStartMessagesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
|
|
return builder.StartVector(4, numElems, 4)
|
|
}
|
|
func BannerCampaignEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
|
return builder.EndObject()
|
|
}
|