Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"click.go",
"forbid.go",
"message.go",
],
importpath = "go-common/app/job/main/click/model",
tags = ["automanaged"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,64 @@
package model
//web+h5+outside+ios+android
const (
TypeForWeb = "web"
TypeForH5 = "h5"
TypeForOutside = "outside"
TypeForIOS = "ios"
TypeForAndroid = "android"
TypeForAndroidTv = "android_tv"
PlatForWeb = int8(0)
PlatForH5 = int8(1)
PlatForOuter = int8(2)
PlatForIos = int8(3)
PlatForAndroid = int8(4)
PlatForAndroidTV = int8(5)
PlatForAutoPlayIOS = int8(6)
PlafForAutoPlayInlineIOS = int8(7)
PlatForAutoPlayAndroid = int8(8)
PlatForAutoPlayInlineAndroid = int8(9)
_maxDBTimes = 6
)
// ClickInfo is
type ClickInfo struct {
Aid int64
Web int64
H5 int64
Outer int64
Ios int64
Android int64
AndroidTV int64
Sum int64
DBTimes int
LastChangeTime int64
}
// NeedRelease is
func (c *ClickInfo) NeedRelease() bool {
if c.DBTimes > _maxDBTimes {
return true
}
return false
}
// ArcDuration is
type ArcDuration struct {
Duration int64
GotTime int64
}
// Ready is
func (c *ClickInfo) Ready(ts int64) {
c.Sum = c.Sum + c.GetSum()
c.LastChangeTime = ts
c.Web, c.H5, c.Outer, c.Ios, c.Android, c.AndroidTV = 0, 0, 0, 0, 0, 0
c.DBTimes++
}
// GetSum is
func (c *ClickInfo) GetSum() (sum int64) {
sum = c.Web + c.H5 + c.Outer + c.Ios + c.Android + c.AndroidTV
return
}

View File

@@ -0,0 +1,14 @@
package model
// is
const (
ValueForLocked = int8(1)
)
// Forbid is
type Forbid struct {
AID int64
Plat int8
Lv int8
Locked int8
}

View File

@@ -0,0 +1,47 @@
package model
// plat(web:0,h5:1,outer:2,ios:3,android:4),avid,cid,part,mid,lv,ftime,stime,buvid(device),ip,agent(version)
// is
const (
LogTypeForNotUse = int8(0)
LogTypeForTurly = int8(1)
LogTypeForInlineBegin = int8(2)
)
// ClickMsg is
type ClickMsg struct {
Plat int8
AID int64
MID int64
Lv int8
Buvid string
Did string
CTime int64
STime int64
IP string
KafkaBs []byte
EpID int64
SeasonType int
UserAgent string
}
// StatMsg is
type StatMsg struct {
AID int64 `json:"aid"`
Click int `json:"click"`
}
// StatViewMsg is
type StatViewMsg struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int `json:"count"`
Ts int64 `json:"timestamp"`
}
// BigDataMsg is
type BigDataMsg struct {
Info string `json:"info"`
Tp int8 `json:"type"`
}