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,38 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"active.go",
"config.go",
"event.go",
"eventmsg.go",
"report.go",
"stat.go",
"user_event_history.go",
"user_info.go",
],
importpath = "go-common/app/job/main/spy/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = ["//library/time:go_default_library"],
)
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,7 @@
package model
type Active struct {
Mid int64
Active int64
Watched int64
}

View File

@ -0,0 +1,33 @@
package model
import "time"
// config properties.
const (
LimitBlockCount = "limitBlockCount"
LessBlockScore = "lessBlockScore"
AutoBlock = "autoBlock"
AutoBlockOpen = 1
)
const (
//PunishmentTypeBlock 封禁
PunishmentTypeBlock = 1
//BlockReasonSize block reason size
BlockReasonSize = 3
//BlockLockKey cycle block
BlockLockKey = "cycleblock"
//ReportJobKey report job
ReportJobKey = "reportjob"
//DefLockTime def.
DefLockTime int64 = 60
)
// Config def.
type Config struct {
ID int64
Property string
Name string
Val string
Ctime time.Time
}

View File

@ -0,0 +1,14 @@
package model
import "go-common/library/time"
// Event def.
type Event struct {
ID int64
Name string // 事件标示
NickName string // 事件可读昵称
ServiceID int64
Status int8 // 0:删除 1:未删除
Ctime time.Time
Mtime time.Time
}

View File

@ -0,0 +1,27 @@
package model
// EventMessage event from bigdata.
type EventMessage struct {
Time string `json:"time"`
IP string `json:"ip"`
Service string `json:"service"`
Event string `json:"event"`
ActiveMid int64 `json:"active_mid"`
TargetMid int64 `json:"target_mid"`
TargetID int64 `json:"target_id"`
Args interface{} `json:"args"`
Result string `json:"result"`
Effect string `json:"effect"`
RiskLevel int8 `json:"risk_level"`
}
// SpyStatMessage sin stat message.
type SpyStatMessage struct {
TargetMid int64 `json:"target_mid"`
TargetID int64 `json:"target_id"`
Type int8 `json:"type"`
Quantity int64 `json:"quantity"`
Time int64 `json:"time"`
EventName string `json:"event_name"`
UUID string `json:"uuid"`
}

View File

@ -0,0 +1,19 @@
package model
import "time"
// Report etc.
type Report struct {
ID int64
Name string
DateVersion string
Val int64
Ctime time.Time
}
const (
//BlockCount block count
BlockCount = "封禁总数"
// SecurityLoginCount security login count
SecurityLoginCount = "二次验证总数"
)

View File

@ -0,0 +1,40 @@
package model
import "time"
const (
// IncreaseStat increase spy stat.
IncreaseStat int8 = 1
// ResetStat reset spy stat.
ResetStat int8 = 2
// WaiteCheck waite for check.
WaiteCheck = 0
)
// type def.
const (
ArchiveType int8 = 1
ActivityType int8 = 2
)
// Statistics def.
type Statistics struct {
ID int64 `json:"id"`
TargetMid int64 `json:"target_mid"`
TargetID int64 `json:"target_id"`
EventID int64 `json:"event_id"`
State int8 `json:"state"`
Type int8 `json:"type"`
Quantity int64 `json:"quantity"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// SpyLog def.
type SpyLog struct {
ID int64 `json:"id"`
TargetMid int64 `json:"target_mid"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}

View File

@ -0,0 +1,19 @@
package model
import (
"go-common/library/time"
)
// UserEventHistory history of user event def.
type UserEventHistory struct {
ID int64
Mid int64
EventID int64
Score int8
BaseScore int8
EventScore int8
Remark string
Reason string // 事件原因 == eventmsg.Effect
FactorVal float64
CTime time.Time
}

View File

@ -0,0 +1,24 @@
package model
import (
"go-common/library/time"
)
const (
// StateNormal UserInfo 正常状态
StateNormal = 0
// StateBlock UserInfo 封禁状态
StateBlock = 1
)
// UserInfo def.
type UserInfo struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Score int8 `json:"score"` //真实得分
BaseScore int8 `json:"base_score"` //基础信息得分
EventScore int8 `json:"event_score"` //事件得分
State int8 `json:"state"` //状态 : 正常/封禁
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
}