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,32 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["relation.go"],
importpath = "go-common/app/interface/main/app-interface/model/relation",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/main/account/api:go_default_library",
"//app/service/main/relation/model: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,43 @@
package relation
import (
accv1 "go-common/app/service/main/account/api"
relation "go-common/app/service/main/relation/model"
)
type Vip struct {
Type int `json:"vipType"`
DueDate int64 `json:"vipDueDate"`
DueRemark string `json:"dueRemark"`
AccessStatus int `json:"accessStatus"`
VipStatus int `json:"vipStatus"`
VipStatusWarn string `json:"vipStatusWarn"`
}
// Following is user followinng info.
type Following struct {
*relation.Following
Uname string `json:"uname"`
Face string `json:"face"`
Sign string `json:"sign"`
OfficialVerify accv1.OfficialInfo `json:"official_verify"`
Vip Vip `json:"vip"`
Live int `json:"live"`
}
type Tag struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
Face string `json:"face"`
Sign string `json:"sign"`
OfficialVerify accv1.OfficialInfo `json:"official_verify"`
Vip Vip `json:"vip"`
Live int `json:"live"`
}
// ByMTime implements sort.Interface for []model.Following based on the MTime field.
type ByMTime []*relation.Following
func (mt ByMTime) Len() int { return len(mt) }
func (mt ByMTime) Swap(i, j int) { mt[i], mt[j] = mt[j], mt[i] }
func (mt ByMTime) Less(i, j int) bool { return mt[i].MTime < mt[j].MTime }