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,57 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v1_proto",
srcs = [
"model.proto",
"service.proto",
],
tags = ["automanaged"],
)
go_proto_library(
name = "v1_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "go-common/app/service/openplatform/pgc-season/api/grpc/episode/v1",
proto = ":v1_proto",
tags = ["automanaged"],
)
go_library(
name = "go_default_library",
srcs = ["client.go"],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/openplatform/pgc-season/api/grpc/episode/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/rpc/warden:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_x_net//context: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,22 @@
package v1
import (
"context"
"go-common/library/net/rpc/warden"
"google.golang.org/grpc"
)
// DiscoveryID season
const DiscoveryID = "season.service"
// NewClient new identify grpc client
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (EpisodeClient, error) {
client := warden.NewClient(cfg, opts...)
conn, err := client.Dial(context.Background(), "discovery://default/"+DiscoveryID)
if err != nil {
return nil, err
}
return NewEpisodeClient(conn), nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,128 @@
syntax = "proto3";
option java_package = "pleiades.business.service.season.episode.v1";
package pgc.service.season.episode.v1;
option java_multiple_files = true;
option go_package = "v1";
// EpisodeInfoProto .
message EpisodeInfoProto {
// episode_id
int32 episode_id = 1;
// aid
int32 aid = 2;
// cid
int32 cid = 3;
// 排序值 ord
int32 index = 4;
// 短标题
string index_title = 5;
// 长标题
string long_title = 6;
// ep封面
string cover = 7;
// ep status
int32 episode_status = 8;
// season_id
int32 season_id = 9;
// 定时上线上线时是否设置对应番剧为已完结0不设置1设置
int32 online_finish = 10;
// ep对应分节id
int32 section_id = 11;
// 视频来源 bangumi,cid,vupload,pptv,qq
string from = 12;
// vid
string vid = 13;
// pub_real_time format:yyyy-mm-dd HH:mm:ss
string pub_real_time = 14;
// badge
string badge = 15;
// badge_type
int32 badge_type = 16;
// ep时长
int32 duration = 17;
}
// EpisodeCardsProto .
message EpisodeCardsProto {
// episode_id
int32 episode_id = 1;
// ep status
int32 episode_status = 2;
// 短标题
string title = 3;
// 长标题
string long_title = 4;
//封面
string cover = 5;
//seasonBrief
EpisodeSeasonProto season = 6;
// ep时长
int32 duration = 7;
// 第x集 xxx
string show_title = 8;
}
// EpisodeSeasonProto .
message EpisodeSeasonProto {
// season_id
int32 season_id = 1;
// 标题
string title = 2;
// season status
int32 season_status = 3;
// 是否完结 1完结 0未完结
int32 is_finish = 4;
// 总集数
int32 total_count = 5;
// 更新至xx话
string new_ep_show = 6;
// 最新一话epid
int32 new_ep_id = 7;
// season类型 1番剧2电影3纪录片4国漫5电视剧
int32 season_type = 8;
// cover
string cover = 9;
// 播放数(已废弃,请使用: stat.view)
int64 play_count = 10;
// episode 所属 season 计数信息
StatsProto stat = 11;
// season类型名称
string season_type_name = 12;
// 角标
string badge = 13;
// 角标颜色
int32 badge_type = 14;
// 最新一话短标题
string new_ep_index = 15;
// 模式1单集 2多集
int32 mode = 16;
}
message StatsProto {
// 追番数
int64 follow = 1;
// 播放数
int64 view = 2;
// 弹幕数
int64 danmaku = 3;
}
// SectionEpisodeProto .
message SectionEpisodeProto {
// info
repeated EpisodeInfoProto info = 1;
}
// EmptyProto .
message EmptyProto {
}
// EpisodeBadgeProto .
message EpisodeBadgeProto {
// 角标类型0粉色1蓝色2橙色
int32 badge_type = 1;
// 角标文字,如“抢先”这种
string badge = 2;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,100 @@
syntax = "proto3";
option java_package = "pleiades.business.service.season.episode.v1";
package pgc.service.season.episode.v1;
option java_multiple_files = true;
option go_package = "v1";
import "app/service/openplatform/pgc-season/api/grpc/episode/v1/model.proto";
// EpisodeInfoReq ep request param
message EpisodeInfoReq {
// episode_ids
repeated int32 episode_ids = 1;
}
// EpAidReq aids request param
message EpAidReq {
// aids
repeated int32 aids = 1;
}
// EpisodeInfoReply ep response
message EpisodeInfoReply {
// infos
map<int32, EpisodeInfoProto> infos = 1;
}
// EpisodeCardsReply cards
message EpisodeCardsReply {
// cards
map<int32, EpisodeCardsProto> cards = 1;
}
// EpReq epids请求参数
message EpReq {
// aids
repeated int32 epids = 1;
// 是否要查出下架的 默认0
int32 need_all = 2;
}
// SectionEeq 请求参数
message SectionEpisodeReq {
// sections
repeated int32 sections = 1;
// season_type
int32 season_type = 2;
}
// SectionReply 分节eps
message SectionEpisodeReply {
// infos
map<int32, SectionEpisodeProto> episodes = 1;
}
// EpClearReq ClearCache请求参数
message EpClearReq {
// ep_id
int32 ep_id = 1;
// aid
int32 aid = 2;
}
// EpisodeBadgeReq 请求参数
message EpisodeBadgeReq {
//ep_id
int32 ep_id = 1;
// ep_status
int32 ep_status = 2;
// is_finished
int32 is_finished = 3;
}
// EpisodeBadgesReq 请求参数
message EpisodeBadgesReq {
repeated EpisodeBadgeReq episode_badges = 1;
}
// EpisodeBadgesReply .
message EpisodeBadgesReply {
map<int32, EpisodeBadgeProto> badges = 1;
}
// Episode service
service Episode {
// 根据ep_ids 返回ep详情
rpc List (EpisodeInfoReq) returns (EpisodeInfoReply);
// 根据aids 返回ep详情
rpc ListByAids (EpAidReq) returns (EpisodeInfoReply);
// 根据section返回eps
rpc ListBySection (SectionEpisodeReq) returns (SectionEpisodeReply);
// 根据epid返回season,episode基本信息
rpc Cards (EpReq) returns (EpisodeCardsReply);
// 根据ep_id or aid清除mc缓存
rpc ClearCache (EpClearReq) returns (EmptyProto);
// 根据ep_ids 返回ep对应的badge
rpc Badges (EpisodeBadgesReq) returns (EpisodeBadgesReply);
// 根据aids 返回ep对应的EpisodeCards
rpc CardsByAids (EpAidReq) returns (EpisodeCardsReply);
}