models

package
v0.0.0-...-305b679 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_DEMAND_INDEX = 10

Variables

This section is empty.

Functions

func Connect

func Connect()

数据库连接

func GetAvbDemandMap

func GetAvbDemandMap(adDate string) (avbDemandMap map[string]*AvbDemand, err error)

adDate: 2006-01-02

func GetDemandInfo

func GetDemandInfo() (demandMap map[int]DemandInfo, err error)

func GetMatrixData

func GetMatrixData() (adspaceMap map[string]AdspaceData, adspaceDemandMap map[string][]string, err error)

func GetPmpInfo

func GetPmpInfo() (pmpAdspaceMap map[string]PmpInfo, err error)

func GetTplSet

func GetTplSet() (tplHashSet *lib.HashSet, err error)

Types

type AdRequest

type AdRequest struct {
	Bid              string  `form:"bid"`
	AdspaceKey       string  `form:"adspaceid"`
	DemandAdspaceKey string  `form:"dkey"`
	AdType           string  `form:"adtype"`
	Pkgname          string  `form:"pkgname"`
	Appname          string  `form:"appname"`
	Conn             string  `form:"conn"`
	Carrier          string  `form:"carrier"`
	Os               int     `form:"os"`
	Osv              string  `form:"osv"`
	Imei             string  `form:"imei"`
	Wma              string  `form:"wma"`
	Aid              string  `form:"aid"`
	Aaid             string  `form:"aaid"`
	Idfa             string  `form:"idfa"`
	Oid              string  `form:"oid"`
	Uid              string  `form:"uid"`
	Device           string  `form:"device"`
	Ua               string  `form:"ua"`
	Ip               string  `form:"ip"`
	Width            int     `form:"width"`
	Height           int     `form:"height"`
	Pcat             string  `form:"pcat"`
	Density          string  `form:"density"`
	Lon              float32 `form:"lon"`
	Lat              float32 `form:"lat"`
	StatusCode       int
	RequestTime      int64
	ProcessDuration  int64
	Did              string `form:"did"`
	Cuk              string `form:"cuk"`
}

type AdResponse

type AdResponse struct {
	StatusCode        int
	AdspaceKey        string
	DemandAdspaceKey  string
	ResponseTime      int64
	Bid               string
	Did               string
	Adunit            *AdUnit
	ResBody           string
	PmpClkTrackingUrl string
	Priority          int
	ClickUrlCacheKey  string
}

func (*AdResponse) AddClkTracking

func (this *AdResponse) AddClkTracking(url string)

func (*AdResponse) AddImpTracking

func (this *AdResponse) AddImpTracking(url string)

func (*AdResponse) GenerateCommonResponse

func (this *AdResponse) GenerateCommonResponse() CommonResponse

func (*AdResponse) GetDemandAdspaceKey

func (this *AdResponse) GetDemandAdspaceKey() string

func (*AdResponse) GetResponseTime

func (this *AdResponse) GetResponseTime() int64

func (*AdResponse) SetDemandAdspaceKey

func (this *AdResponse) SetDemandAdspaceKey(dkey string)

func (*AdResponse) SetResponseTime

func (this *AdResponse) SetResponseTime(responseTime int64)

type AdUnit

type AdUnit struct {
	Cid             string   `json:"cid"`
	ClickUrl        string   `json:"clickUrl"`
	CreativeType    int      `json:"creativeType"`
	CreativeUrls    []string `json:"creativeUrls"`
	ImpTrackingUrls []string `json:"impTrackingUrls"`
	ClkTrackingUrls []string `json:"clkTrackingUrls"`
	AdWidth         int      `json:"adWidth"`
	AdHeight        int      `json:"adHeight"`
	DisplayTitle    string   `json:"displayTitle"`
	DisplayText     string   `json:"displayText"`
}

enum CreativeType { 1:文字 2:图片 3:HTML 4:视频 5:图文

type AdspaceData

type AdspaceData struct {
	DemandId       int
	AdspaceKey     string
	RealAdspaceKey string
	SecretKey      string
	Priority       int
	AppName        string
	PkgName        string
	Pcat           int
	Ua             string
}

type AllocationDetail

type AllocationDetail struct {
	Id            int
	AllocationId  int
	TargetingType string
	TargetingCode string
	PlanImp       int
	PlanClk       int
	ActualImp     int
	ActualClk     int
}

type AppInfo

type AppInfo struct {
	Id      int
	AppName string
	PkgName string
	Pcat    int
	Ua      string
}

type AvbDemand

type AvbDemand struct {
	AllocationId     int
	PmpAdspaceId     int
	DemandAdspaceId  int
	PmpAdspaceKey    string
	DemandAdspaceKey string
	PlanImp          int
	PlanClk          int
	ActualImp        int
	ActualClk        int
	// contains filtered or unexported fields
}

func (*AvbDemand) CheckAvailable

func (this *AvbDemand) CheckAvailable(adRequest *AdRequest) (avbFlg bool, targetingCode string)

func (*AvbDemand) SetDetailAllocation

func (this *AvbDemand) SetDetailAllocation(detail *AllocationDetail)

type CommonResponse

type CommonResponse struct {
	StatusCode int     `json:"statusCode"`
	AdspaceKey string  `json:"adspaceKey"`
	Bid        string  `json:"bid"`
	Adunit     *AdUnit `json:"adunit"`
}

func (*CommonResponse) SetHtmlCreativeUrl

func (this *CommonResponse) SetHtmlCreativeUrl(url string)

type DemandInfo

type DemandInfo struct {
	DemandId           int
	Name               string
	RequestUrlTemplate string
	Timeout            int
	InvokeFuncName     string
}

type MHAdUnit

type MHAdUnit struct {
	Adspaceid    string
	Returncode   int
	Bid          string
	Cid          string
	Adwidth      int
	Adheight     int
	Adtype       int
	Imgurl       string
	Clickurl     string
	Imgtracking  []string
	Thclkurl     []string
	Displaytitle string
	Displaytext  string
}

type PmpAdplaceInfo

type PmpAdplaceInfo struct {
	PmpAdspaceKey    string
	DemandId         int
	RealAdspaceKey   string
	DemandAdspaceKey string
	DemandSecretKey  string
	Priority         int
	AppName          string
	PkgName          string
	Pcat             int
	Ua               string
}

type PmpCampaignCreative

type PmpCampaignCreative struct {
	Id          int    `orm:"column(id);auto"`
	Name        string `orm:"column(name);size(45);null"`
	StartDate   string `orm:"column(start_date);type(date);null"`
	EndDate     string `orm:"column(end_date);type(date);null"`
	Width       int    `orm:"column(width);null"`
	Height      int    `orm:"column(height);null"`
	CreativeUrl string `orm:"column(creative_url);size(255);null"`
	Status      int    `orm:"column(status);null"`
	LandingUrl  string `orm:"column(landing_url);size(500);null"`
}

func GetCampaigns

func GetCampaigns(demandAdspaceKey string, adDate string, width int, height int) (campaigns []*PmpCampaignCreative, err error)

type PmpDemandInfo

type PmpDemandInfo struct {
	AdspaceKey string
	//DemandIds        []int
	AryDemandAdspaceKey []string
	// contains filtered or unexported fields
}

func (*PmpDemandInfo) AddDemandAdspace

func (this *PmpDemandInfo) AddDemandAdspace(demandAdspace string)

func (*PmpDemandInfo) GetDemandAdspaceKeys

func (this *PmpDemandInfo) GetDemandAdspaceKeys() []string

func (*PmpDemandInfo) InitDemandAdspace

func (this *PmpDemandInfo) InitDemandAdspace()

type PmpInfo

type PmpInfo struct {
	PmpAdspaceKey string
	CreativeType  int
	TplName       string
}

type TrackResponse

type TrackResponse struct {
	StatusCode int
}

type UrlResponse

type UrlResponse struct {
	StatusCode int    `json:"statusCode"`
	AdspaceKey string `json:"adspaceKey"`
	Bid        string `json:"bid"`
	DisplayUrl string `json:"displayUrl"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL