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,34 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"academy.go",
"archive.go",
"monitor.go",
"msg.go",
"newcomer.go",
],
importpath = "go-common/app/job/main/creative/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,15 @@
package model
const (
//BusinessForArchvie 稿件
BusinessForArchvie = 1
//BusinessForArticle 专栏
BusinessForArticle = 2
)
//OArchive for academy.
type OArchive struct {
ID int64
OID int64
Business int
}

View File

@@ -0,0 +1,14 @@
package model
//Archive for db.
type Archive struct {
AID int64 `json:"aid"`
MID int64 `json:"mid"`
State int `json:"state"`
UpFrom int8 `json:"up_from"`
}
// ArcVideo str
type ArcVideo struct {
Archive *Archive
}

View File

@@ -0,0 +1,13 @@
package model
// BAP for wechat msg.
type BAP struct {
UserName string `json:"username"`
Title string `json:"title"`
Content string `json:"content"`
URL string `json:"url"`
Ty string `json:"type"`
Token string `json:"token"`
Signature string `json:"signature"`
TimeStamp int64 `json:"timestamp"`
}

View File

@@ -0,0 +1,128 @@
package model
import "encoding/json"
//Msg for databus.
type Msg struct {
MID int64 `json:"mid"`
From int `json:"from"`
IsAuthor int `json:"is_author"`
TimeStamp int64 `json:"timestamp"`
}
// CanalMsg canal databus msg.
type CanalMsg struct {
Action string `json:"action"`
Table string `json:"table"`
New json.RawMessage `json:"new"`
Old json.RawMessage `json:"old"`
}
//TaskMsg for task notify.
type TaskMsg struct {
MID int64 `json:"mid"`
Count int64 `json:"count"`
From int `json:"from"`
TimeStamp int64 `json:"timestamp"`
}
// ShareMsg share databus msg.
type ShareMsg struct {
OID int64 `json:"oid"`
MID int64 `json:"mid"`
TP int `json:"tp"`
Time int64 `json:"time"`
}
// StatLike archive like count
type StatLike struct {
MID int64 `json:"mid"`
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
DislikeCount int64 `json:"dislike_count"`
TimeStamp int64 `json:"timestamp"`
}
// StatView ViewMsg archive view count
type StatView struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// StatDM archive DM count
type StatDM struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// StatReply archive reply count
type StatReply struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// StatFav archive collection count
type StatFav struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// StatCoin archive coin count
type StatCoin struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// StatShare archive share count
type StatShare struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// StatRank archive rank
type StatRank struct {
Type string `json:"type"`
ID int64 `json:"id"`
Count int64 `json:"count"`
TimeStamp int64 `json:"timestamp"`
}
// RelaMessage Message define relation binlog databus message.
type RelaMessage struct {
Action string `json:"action"`
Table string `json:"table"`
New json.RawMessage `json:"new"`
Old json.RawMessage `json:"old"`
}
// Relation user_relation_mid_0~user_relation_mid_49
type Relation struct {
MID int64 `json:"mid,omitempty"`
FID int64 `json:"fid,omitempty"`
Attribute uint32 `json:"attribute"`
Status int `json:"status"`
MTime string `json:"mtime"`
CTime string `json:"ctime"`
}
// Stat user_relation_stat
type Stat struct {
MID int64 `json:"mid,omitempty"`
Following int64 `json:"following"`
Whisper int64 `json:"whisper"`
Black int64 `json:"black"`
Follower int64 `json:"follower"`
}

View File

@@ -0,0 +1,117 @@
package model
import "time"
const (
_ int8 = iota
// TargetType001 该UID下开放浏览的稿件≥1
TargetType001
// TargetType002 该UID分享自己视频的次数≥1
TargetType002
// TargetType003 该UID在创作学院的观看记录≥1
TargetType003
// TargetType004 该UID下所有avid的获得评论数≥3
TargetType004
// TargetType005 该UID下所有avid获得分享数≥3
TargetType005
// TargetType006 该UID的所有avid的获得收藏数≥5
TargetType006
// TargetType007 该UID下所有avid的获得硬币数≥5
TargetType007
// TargetType008 该UID下所有avid获得点赞数≥5
TargetType008
// TargetType009 该UID下所有avid的获得弹幕数≥5
TargetType009
// TargetType010 该UID的粉丝数≥10
TargetType010
// TargetType011 任务完成期间该UID的水印开关为打开状态
TargetType011
// TargetType012 该UID的关注列表含有“哔哩哔哩创作中心”
TargetType012
// TargetType013 用手机投稿上传视频
TargetType013
// TargetType014 该UID下开放浏览的稿件≥5
TargetType014
// TargetType015 该UID下任意avid的获得点击量≥1000
TargetType015
// TargetType016 该UID下任意avid的评论≥30
TargetType016
// TargetType017 该UID下任意avid的获得分享数≥10
TargetType017
// TargetType018 该UID下任意avid的获得收藏数≥30
TargetType018
// TargetType019 该UID下任意avid的获得硬币数≥50
TargetType019
// TargetType020 该UID下任意avid的获得点赞数≥50
TargetType020
// TargetType021 该UID下任意avid的获得弹幕数≥50
TargetType021
// TargetType022 该UID的粉丝数≥1000
TargetType022
// TargetType023 该UID的激励计划状态为已开通
TargetType023
// TargetType024 该UID粉丝勋章为开启状态
TargetType024
)
const (
//TaskIncomplete 任务未完成
TaskIncomplete = -1
//TaskCompleted 任务已完成
TaskCompleted = 0
//MsgForWaterMark 发送用户设置水印消息
MsgForWaterMark = 1
//MsgForAcademyFavVideo 发送用户已在创作学院观看过自己喜欢的视频的消息
MsgForAcademyFavVideo = 2
//MsgForGrowAccount 发送用户已在参加激励计划的消息
MsgForGrowAccount = 3
//MsgForOpenFansMedal 成功开通粉丝勋章
MsgForOpenFansMedal = 4
)
// UserTask for def user task struct.
type UserTask struct {
ID int64 `json:"id"`
MID int64 `json:"mid"`
TaskID int64 `json:"task_id"`
TaskGroupID int64 `json:"task_group_id"`
TaskType int8 `json:"task_type"`
State int8 `json:"state"`
TaskBindTime time.Time `json:"task_bind_time"`
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
}
// Task for def task struct.
type Task struct {
ID int64 `json:"id"`
GroupID int64 `json:"-"`
Type int8 `json:"type"`
State int8 `json:"-"`
Title string `json:"title"`
Desc string `json:"desc"`
Comment string `json:"-"`
TargetType int8 `json:"-"`
TargetValue int64 `json:"-"`
CompleteSate int8 `json:"complete_state"`
CTime time.Time `json:"-"`
MTime time.Time `json:"-"`
}
// GiftReward for gift reward
type GiftReward struct {
ID int64 `json:"id"`
TaskType int8 `json:"task_type"`
RewardID int64 `json:"reward_id"`
State int8 `json:"state"`
Comment string `json:"comment"`
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
}
// Up for up new arc.
type Up struct {
AID int64
MID int64
}