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,44 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"config.go",
"event.go",
"eventhistory.go",
"eventmsg.go",
"factor.go",
"factor_group.go",
"log.go",
"page.go",
"punishment.go",
"report.go",
"service.go",
"setting.go",
"stat.go",
"userinfo.go",
],
importpath = "go-common/app/admin/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
const (
LimitBlockCount = "limitBlockCount"
LessBlockScore = "lessBlockScore"
AutoBlock = "autoBlock"
)

View File

@@ -0,0 +1,16 @@
package model
import (
"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,49 @@
package model
import (
"time"
)
// EventHistory def.
type EventHistory struct {
ID int64
Mid int64 // 用户ID
EventID int64 // 事件ID
Score int8 // 用户真实分
BaseScore int8 // 基础信息得分
EventScore int8 // 事件得分
Remark string // 备注
Reason string // 原因
FactorVal float32 // 风险因子
Ctime time.Time // 创建时间
TargetID int64 // 目标id
TargetMid int64 // 目标mid
SpyTime time.Time // 作弊时间
}
// EventHistoryDto dto.
type EventHistoryDto struct {
ID int64 `json:"id"`
Score int8 `json:"score"` // 用户真实分
BaseScore int8 `json:"base_score"` // 基础信息得分
EventScore int8 `json:"event_score"` // 事件得分
Reason string `json:"reason"` // 原因
Ctime int64 `json:"ctime"` // 创建时间
TargetID int64 `json:"target_id"` // 目标id
TargetMid int64 `json:"target_mid"` // 目标mid
SpyTime int64 `json:"spy_time"` // 作弊时间
}
// HisParamReq def.
type HisParamReq struct {
Mid int64
Pn, Ps int
}
// HistoryPage def.
type HistoryPage struct {
TotalCount int `json:"total_count"`
Pn int `json:"pn"`
Ps int `json:"ps"`
Items []*EventHistoryDto `json:"items"`
}

View File

@@ -0,0 +1,16 @@
package model
// EventMessage event from bigdata def.
type EventMessage struct {
Time int64 `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"`
}

View File

@@ -0,0 +1,28 @@
package model
import (
"time"
)
// Factor def.
type Factor struct {
ID int64 `json:"id"`
NickName string `json:"nick_name"` //风险因子名字
ServiceID int64 `json:"service_id"` //服务ID
EventID int64 `json:"event_id"` //事件ID
GroupID int64 `json:"group_id"` //分组ID
RiskLevel int8 `json:"risk_level"` //风险等级1-9
FactorVal float32 `json:"factor_val"` //因子值
CTime time.Time `json:"ctime"` //创建时间
MTime time.Time `json:"mtime"` //修改时间
CategoryID int8 `json:"category_id"` //CategoryID
}
// Factors etc.
type Factors struct {
ID int64 `json:"id"`
GroupID int64 `json:"group_id"` //分组ID
GroupName string `json:"group_name"` //分组名称
NickName string `json:"nick_name"` //风险因子名字
FactorVal float32 `json:"factor_val"` //因子值
}

View File

@@ -0,0 +1,12 @@
package model
import (
"time"
)
// FactorGroup etc.
type FactorGroup struct {
ID int64
Name string //风险因子组名
CTime time.Time
}

View File

@@ -0,0 +1,29 @@
package model
import "time"
// Module etc.
const (
UpdateFactor int8 = iota + 1 // 修改因子操作
UpdateSetting
UpdateStat
)
// stat check text.
const (
WaiteCheck = "待确认"
HadCheck = "已确认"
MaxRemarkLen = 100
)
// Log def.
type Log struct {
ID int64 `json:"id"`
RefID int64 `json:"ref_id"` // 关联ID
Name string `json:"name"` //操作用户
Module int8 `json:"module"` //操作名称
Context string `json:"context"` //操作内容
Ctime time.Time `json:"ctime"` //创建时间
CtimeUnix int64 `json:"ctime_unix"` //创建时间
}

View File

@@ -0,0 +1,8 @@
package model
// page etc.
const (
DefPn = 1
DefPs = 10
NoParam = -1
)

View File

@@ -0,0 +1,14 @@
package model
import (
"go-common/library/time"
)
// Punishment def.
type Punishment struct {
ID int64
Mid int64
Type int8 //惩罚类型 1.自动封禁
Reason string //惩罚原因
CTime time.Time
}

View File

@@ -0,0 +1,36 @@
package model
import "time"
// Report etc.
type Report struct {
ID int64
Name string
DateVersion string
Val int64
Ctime time.Time
}
// ReportDto etc.
type ReportDto struct {
ID int64 `json:"id"`
Name string `json:"name"`
DateVersion string `json:"date_version"`
Val int64 `json:"val"`
Ctime int64 `json:"ctime"`
}
// ReportPage def.
type ReportPage struct {
TotalCount int `json:"total_count"`
Pn int `json:"pn"`
Ps int `json:"ps"`
Items []*ReportDto `json:"items"`
}
const (
//BlockCount block count
BlockCount = "封禁总数"
// SecurityLoginCount security login count
SecurityLoginCount = "二次验证总数"
)

View File

@@ -0,0 +1,15 @@
package model
import (
"time"
)
// Service def.
type Service struct {
ID int64
Name string //服务标识
NickName string //服务可读昵称
Status int8
CTime time.Time
MTime time.Time
}

View File

@@ -0,0 +1,15 @@
package model
import (
"go-common/library/time"
)
// Setting def.
type Setting struct {
ID int64 `json:"id"`
Property string `json:"property"`
Name string `json:"name"`
Val string `json:"val"`
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
}

View File

@@ -0,0 +1,35 @@
package model
import "time"
// type def.
const (
AccountType = iota
ArchiveType
ActivityType
)
// 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"`
Isdel int8 `json:"is_del"`
Quantity int64 `json:"quantity"`
EventName string `json:"event_name"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
CtimeUnix int64 `json:"ctimeunix"`
MtimeUnix int64 `json:"mtimeunix"`
}
// StatPage def.
type StatPage struct {
TotalCount int64 `json:"total_count"`
Pn int `json:"pn"`
Ps int `json:"ps"`
Items []*Statistics `json:"items"`
}

View File

@@ -0,0 +1,30 @@
package model
import (
"time"
)
// UserInfo def.
type UserInfo struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
State int8 `json:"state"` //状态 0.正常 1.封禁
Score int8 `json:"score"` //真实分值
BaseScore int8 `json:"base_score"` //基础信息得分
EventScore int8 `json:"event_score"` //事件得分
ReliveTimes int8 `json:"relive_times"` //累计重绘次数
Mtime time.Time `json:"mtime"`
}
// UserInfoDto dto.
type UserInfoDto struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Name string `json:"name"` //昵称
State int8 `json:"state"` //状态 0.正常 1.封禁
Score int8 `json:"score"` //真实分值
BaseScore int8 `json:"base_score"` //基础信息得分
EventScore int8 `json:"event_score"` //事件得分
ReliveTimes int8 `json:"relive_times"` //累计重绘次数
Mtime int64 `json:"mtime"` //更新时间
}