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,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["live.go"],
importpath = "go-common/app/interface/main/app-show/model/live",
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,58 @@
package live
import "encoding/json"
// Feed is live feed
type Feed struct {
Count int `json:"count"`
Lives []*Room `json:"lives"`
}
// Recommend is live recommend
type Recommend struct {
Count int `json:"count"`
Lives struct {
Subject []*Room `json:"subject"`
Hot []*Room `json:"hot"`
} `json:"lives"`
}
type Room struct {
Owner struct {
Face string `json:"face"`
Mid int `json:"mid"`
Name string `json:"name"`
} `json:"owner"`
Cover struct {
Src string `json:"src"`
Height int `json:"height"`
Width int `json:"width"`
} `json:"cover"`
Title string `json:"title"`
ID int64 `json:"room_id"`
Online int `json:"online"`
Area string `json:"area"`
AreaID int `json:"area_id"`
}
type TopicHot struct {
TID int `json:"topic_id"`
TName string `json:"topic_name"`
Picture string `json:"picture"`
ImageURL string `json:"-"`
}
type TopicImage struct {
ImageSrc string `json:"image_src"`
ImageWidth int `json:"image_width"`
ImageHeight int `json:"image_height"`
}
func (t *TopicHot) TopicJSONChange() (err error) {
var tmp TopicImage
if err = json.Unmarshal([]byte(t.Picture), &tmp); err != nil {
return
}
t.ImageURL = tmp.ImageSrc
return
}