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,39 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"model.go",
"roomAdmin.go",
],
importpath = "go-common/app/service/live/xuser/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/live/xuser/api/grpc:go_default_library",
"//library/time:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//app/service/live/xuser/model/dhh:all-srcs",
"//app/service/live/xuser/model/exp:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["model.go"],
importpath = "go-common/app/service/live/xuser/model/dhh",
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,69 @@
package dhh
import "time"
// DHHDB 大航海信息DB层
type DHHDB struct {
ID int64
UID int64
TargetId int64
PrivilegeType int64
StartTime time.Time
ExpiredTime time.Time
Ctime time.Time
Utime time.Time
}
// DHHDBTime 大航海信息验DB层(时间转换)
type DHHDBTime struct {
ID int64
UID int64
TargetId int64
PrivilegeType int64
StartTime string
ExpiredTime string
Ctime string
Utime string
}
// ModelDHHList dhh list
type ModelDHHList struct {
Data []DHHDB
}
// ModelExpLog 行为日志上报结构
type ModelExpLog struct {
Mid int64
Uexp int64
Rexp int64
Ts int64
// 业务来源
ReqBizDesc string
Buvid string
// 具体描述
Content map[string]string
}
// DaHangHaiRedis 等级基础结构
type DaHangHaiRedis struct {
Id int64 `json:"id"`
Uid int64 `json:"uid"`
TargetId int64 `json:"target_id"`
PrivilegeType int64 `json:"privilege_type"`
StartTime string `json:"start_time"`
ExpiredTime string `json:"expired_time"`
Ctime string `json:"ctime"`
Utime string `json:"utime"`
}
// DaHangHaiRedis2 等级基础结构
type DaHangHaiRedis2 struct {
Id string `json:"id"`
Uid string `json:"uid"`
TargetId string `json:"target_id"`
PrivilegeType string `json:"privilege_type"`
StartTime string `json:"start_time"`
ExpiredTime string `json:"expired_time"`
Ctime string `json:"ctime"`
Utime string `json:"utime"`
}

View File

@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["model.go"],
importpath = "go-common/app/service/live/xuser/model/exp",
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,66 @@
package exp
// Exp 经验DB层
type Exp struct {
UID int64
Uexp int64
Rexp int64
CTime string
MTime string
}
// ModelExpList exp list
type ModelExpList struct {
Data []Exp
}
// ModelExpLog 行为日志上报结构
type ModelExpLog struct {
Mid int64
Uexp int64
Rexp int64
Ts int64
// 业务来源
ReqBizDesc string
Buvid string
// 具体描述
Content map[string]string
}
// LevelInfo 等级结构
type LevelInfo struct {
UID int64
UserLevel UserLevelInfo
AnchorLevel AnchorLevelInfo
CTime string
MTime string
}
// UserLevelInfo 等级基础结构
type UserLevelInfo struct {
Level int64 `json:"level"`
NextLevel int64 `json:"nextLevel"`
UserExpLeft int64 `json:"userExpLeft"`
UserExpRight int64 `json:"userExpRight"`
UserExp int64 `json:"userExp"`
UserExpNextLevel int64 `json:"userExpNextLevel"`
Color int64 `json:"color"`
UserExpNextLeft int64 `json:"userExpNextLeft"`
UserExpNextRight int64 `json:"userExpNextRight"`
IsLevelTop int64 `json:"isLevelTop"`
}
// AnchorLevelInfo 等级基础结构
type AnchorLevelInfo struct {
Level int64 `json:"level"`
NextLevel int64 `json:"nextLevel"`
UserExpLeft int64 `json:"userExpLeft"`
UserExpRight int64 `json:"userExpRight"`
UserExp int64 `json:"userExp"`
UserExpNextLevel int64 `json:"userExpNextLevel"`
Color int64 `json:"color"`
UserExpNextLeft int64 `json:"userExpNextLeft"`
UserExpNextRight int64 `json:"userExpNextRight"`
AnchorScore int64 `json:"anchorScore"`
IsLevelTop int64 `json:"isLevelTop"`
}

View File

@ -0,0 +1,85 @@
package model
import (
"go-common/app/service/live/xuser/api/grpc"
"time"
)
// VipBuy buy vip request struct
type VipBuy struct {
Uid int64
OrderID string
GoodID int
GoodNum int
Platform grpc.Platform
Source string
}
// VipInfo vip info struct
type VipInfo struct {
Vip int `json:"vip"`
VipTime string `json:"vip_time"`
Svip int `json:"svip"`
SvipTime string `json:"svip_time"`
}
// VipRecord ap_vip_record log and notify message
type VipRecord struct {
Uid int64 `json:"uid"`
Opcode string `json:"opcode"`
BuyType int `json:"buy_type"`
BuyNum int `json:"buy_num"`
VipType int `json:"vip_type"`
BeforeVipTime string `json:"begin"`
AfterVipTime string `json:"end"`
Platform string
}
// GuardBuy buy guard request struct
type GuardBuy struct {
OrderId string
Uid int64
Ruid int64
GuardLevel int
Num int
Platform grpc.Platform
Source string
}
// GuardInfo guard info struct for ap_user_privilege
type GuardInfo struct {
Id int64
Uid int64
TargetId int64
PrivilegeType int
StartTime time.Time
ExpiredTime time.Time
}
// GuardEntryEffects entry effect message
type GuardEntryEffects struct {
Business int `json:"business"`
Data []GuardEntryEffect `json:"data"`
}
// GuardEntryEffect entry effect message
type GuardEntryEffect struct {
EffectId int `json:"effect_id"`
Uid int64 `json:"uid"`
TargetId int64 `json:"target_id"`
EndTime string `json:"end_time"`
}
// Vip constants
var (
Vip = 1 // 月费姥爷
Svip = 2 // 年费姥爷
BuyStatusSuccess = 1 // 购买成功
BuyStatusRetry = 2 // 需要重试
TimeNano = "2006-01-02 15:04:05"
TimeEmpty = "0000-00-00 00:00:00"
OpcodeAdd = "add"
)

View File

@ -0,0 +1,34 @@
package model
import xtime "go-common/library/time"
// TableName is used to identify table name in gorm
func (ra *RoomAdmin) TableName() string {
return "ap_room_admin"
}
// RoomAdmin .
type RoomAdmin struct {
Id int64 `json:"id" gorm:"column:id"`
Uid int64 `json:"uid" gorm:"column:uid"`
Roomid int64 `json:"roomid" gorm:"column:roomid"`
Ctime xtime.Time `json:"ctime" gorm:"comumn:ctime"`
}
// RoomAdmins multi RoomAdmin .
type RoomAdmins []*RoomAdmin
// Len returns length of RoomAdmins.
func (ras RoomAdmins) Len() int {
return len(ras)
}
// Swap .
func (ras RoomAdmins) Swap(i, j int) {
ras[i], ras[j] = ras[j], ras[i]
}
// Less returns sorting rule.
func (ras RoomAdmins) Less(i, j int) bool {
return ras[i].Ctime < ras[j].Ctime
}