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,17 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//app/service/openplatform/pgc-season/api/grpc/episode/v1:all-srcs",
],
tags = ["automanaged"],
)

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);
}

View File

@@ -0,0 +1,17 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//app/service/openplatform/pgc-season/api/grpc/season/v1:all-srcs",
],
tags = ["automanaged"],
)

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/season/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/season/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) (SeasonClient, error) {
client := warden.NewClient(cfg, opts...)
conn, err := client.Dial(context.Background(), "discovery://default/"+DiscoveryID)
if err != nil {
return nil, err
}
return NewSeasonClient(conn), nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
syntax = "proto3";
option java_package = "pleiades.business.service.season.season.v1";
package pgc.service.season.season.v1;
option java_multiple_files = true;
option go_package = "v1";
// CardInfoProto .
message CardInfoProto {
// season_id
int32 season_id = 1;
// media_id
int32 media_id = 2;
// season类型 1番剧2电影3纪录片4国漫5电视剧
int32 season_type = 3;
// season类型显示名 1番剧2电影3纪录片4国漫5电视剧
string season_type_name = 4;
// 标题
string title = 5;
// 封面
string cover = 6;
// 总集数
int32 total_count = 7;
// 是否完结 1完结 0未完结
int32 is_finish = 8;
// 是否开播 1开播 0未开播
int32 is_started = 9;
// 是否可以播放 0-不可以 1-可以
int32 is_play = 10;
// 角标文字,如“抢先”这种
string badge = 11;
// 角标类型0粉色1蓝色2橙色
int32 badge_type = 12;
// 扩展字段开关
RightsProto rights = 13;
// 计数统计
StatsProto stat = 14;
// 最新一话相关信息
NewEpProto new_ep = 15;
// 评分信息
RatingProto rating = 16;
// 方图
string square_cover = 17;
// season付费状态
int32 season_status = 18;
// 分季标题 第一季
string season_title = 19;
}
// ProfileInfoProto .
message ProfileInfoProto {
// season_id
int32 season_id = 1;
// media_id
int32 media_id = 2;
// season类型 1番剧2电影3纪录片4国漫5电视剧
int32 season_type = 3;
// season类型显示名 1番剧2电影3纪录片4国漫5电视剧
string season_type_name = 4;
// 标题
string title = 5;
// 封面
string cover = 6;
// 方图
string square_cover = 7;
// 总集数
int32 total_count = 8;
// 是否完结 1完结 0未完结
int32 is_finish = 9;
// 是否开播 1开播 0未开播
int32 is_started = 10;
// 是否可以播放 0-不可以 1-可以
int32 is_play = 11;
// 角标文字,如“抢先”这种
string badge = 12;
// 角标类型0粉色1蓝色2橙色
int32 badge_type = 13;
// season付费状态
int32 season_status = 14;
// 扩展字段开关
RightsProto rights = 15;
// 计数统计
StatsProto stat = 16;
// 最新一话相关信息
NewEpProto new_ep = 17;
// 评分信息
RatingProto rating = 18;
// 系列信息
SeriesProto series = 19;
// 分节信息
repeated SectionProto section = 20;
// 分季标题 第一季
string season_title = 21;
// 剧集模式 1单集 2多集
int32 mode = 22;
// 简介
string evaluate = 23;
// publish
PublishProto publish = 24;
// mid
int64 mid = 25;
// 备案号
string record = 26;
// 更新时间信息
string renewal_time = 27;
}
// RatingProto 评分信息
message RatingProto {
// 评分数
float score = 1;
// 评分人数
int32 count = 2;
}
// NewEpProto 最新一话相关信息
message NewEpProto {
// epid
int32 id = 1;
// 更新至xx话
string index_show = 2;
// 最新一话封面
string cover = 3;
// 最新一话短标题
string title = 4;
// 最新一话长标题
string long_title = 5;
// 上线时间
string pub_time = 6;
}
// StatsProto 计数
message StatsProto {
// 追番数
int64 follow = 1;
// 播放数
int64 view = 2;
// 弹幕数
int64 danmaku = 3;
}
// RightsProto 扩展字段开关
message RightsProto {
// 是否允许点评 1 允许点评 0 禁止点评
int32 allow_review = 1;
// 是否允许承包
int32 allow_bp = 2;
// 是否允许下周
int32 allow_download = 3;
// 是否允许预览
int32 allow_preview = 4;
}
// SeriesProto 系列信息
message SeriesProto {
// 系列id
int32 series_id = 1;
// 系列标题
string title = 2;
}
// SectionProto 分节信息
message SectionProto {
// 系列id
int32 section_id = 1;
// seasonId
int32 season_id = 2;
// 地区限制
int32 limit_group = 3;
// 平台限制
int32 watch_platform = 4;
// 类别 0正片1预告片2其他
int32 type = 5;
// 版权
string copyright = 6;
// 分节标题
string title = 7;
//禁播地区展示1.版权受限 2.隐藏剧集 3.下架剧集
int32 ban_area_show = 8;
}
// SeriesSeasonProto season信息
message SeriesSeasonProto {
// season_id
int32 season_id = 1;
// season_title
string season_title = 2;
// new_ep
NewEpProto new_ep = 3;
}
// SeriesSeasonsProto season信息
message SeriesSeasonsProto {
// seriesSeasons
repeated SeriesSeasonProto seriesSeasons = 1;
}
// PublishProto publish信息
message PublishProto {
// pub_time
string pub_time = 1;
// pub_time_show
string pub_time_show = 2;
}
// TimelineProto 时间表信息
message TimelineProto {
// 日期
string date = 1;
// 日期时间戳
int64 date_ts = 2;
// 周几
int32 day_of_week = 3;
// 是否是今天
int32 is_today = 4;
// 该日期对应上线的剧集
repeated TimelineEpisodeProto episodes = 5;
}
// TimelineEpisodeProto 时间表下剧集信息
message TimelineEpisodeProto {
// 分季封面
string cover = 1;
// 剧集id
int32 episode_id = 2;
// 收藏数
int64 favorites = 3;
// 是否收藏过
int32 follow = 4;
// 是否已发布
int32 published = 5;
// 第x话
string pub_index = 6;
// 发布时间
string pub_time = 7;
// 上线时间戳
int64 pub_ts = 8;
// 分季id
int32 season_id = 9;
// 分季方图
string square_cover = 10;
// 分季标题
string title = 11;
// 是否delay
int32 delay = 12;
// delay id
int32 delay_id = 13;
// 停更原因
string delay_reason = 14;
// 停更那一话的短标题
string delay_index = 15;
}
// EmptyProto
message EmptyProto {
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,97 @@
syntax = "proto3";
option java_package = "pleiades.business.service.season.season.v1";
package pgc.service.season.season.v1;
option java_multiple_files = true;
option go_package = "v1";
import "app/service/openplatform/pgc-season/api/grpc/season/v1/model.proto";
// SeasonInfoReq season请求参数
message SeasonInfoReq {
// season_ids
repeated int32 season_ids = 1;
}
// CardsInfoReply 卡片列表返回值
message CardsInfoReply {
// cards
map<int32, CardInfoProto> cards = 1;
}
// SeasonIdReq season请求参数
message SeasonIdReq {
// season_id
int32 season_id = 1;
}
// ProfileInfoReply 详情返回值
message ProfileInfoReply {
// prfile
ProfileInfoProto profile = 1;
}
// SeasonAidReq aids请求参数
message SeasonAidReq {
//aids
repeated int32 aids = 1;
}
// SectionReq 请求参数
message SectionReq {
// season_ids
repeated int32 season_ids = 1;
}
// SectionReply 分节信息返回值
message SectionReply {
// sections
map<int32, SectionProto> sections = 1;
}
// SeriesReq 请求参数
message SeriesSeasonReq {
// series_ids
repeated int32 series_ids = 1;
}
// SeriesReply series
message SeriesSeasonReply {
// seriesSeason
map<int32, SeriesSeasonsProto> seasons = 1;
}
// TimelineReq 时间表请求参数
message TimelineReq {
// 开始时间戳
int64 start = 1;
// 结束时间戳
int64 end = 2;
// 类型
repeated int32 types = 3;
// 排序方式默认0按照更新时间正序1表示按照更新时间倒序
int32 sort = 4;
}
// TimelineReply 时间表返回
message TimelineReply {
repeated TimelineProto timeline = 1;
}
// Season service
service Season {
// 根据season_ids返回卡片信息
rpc Cards (SeasonInfoReq) returns (CardsInfoReply);
// 根据aids返回卡片信息
rpc CardsByAids (SeasonAidReq) returns (CardsInfoReply);
// 根据season_id返回详情
rpc Profile (SeasonIdReq) returns (ProfileInfoReply);
// 根据开始结束时间和type获取时间表信息
rpc Timeline (TimelineReq) returns (TimelineReply);
// 根据season_ids返回分节信息
rpc Sections (SectionReq) returns (SectionReply);
// 根据series返回season信息
rpc SeriesSeason (SeriesSeasonReq) returns (SeriesSeasonReply);
// 根据season_id清除season相关mc 缓存
rpc ClearCache (SeasonIdReq) returns (EmptyProto);
}