From aa233779e1a909168338d7252b0a7a11f167592d Mon Sep 17 00:00:00 2001 From: SocialSisterYi <1440239038@qq.com> Date: Tue, 11 Jul 2023 22:36:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0gRPC=20proto=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bilibili/app/dynamic/v2/dynamic.proto | 10 ++ .../dagw/component/avatar/common/common.proto | 109 ++++++++++++++++- .../dagw/component/avatar/v1/avatar.proto | 113 +++++++++++++++++- .../dagw/component/avatar/v1/plugin.proto | 91 ++++++++++++++ 4 files changed, 321 insertions(+), 2 deletions(-) create mode 100644 grpc_api/bilibili/dagw/component/avatar/v1/plugin.proto diff --git a/grpc_api/bilibili/app/dynamic/v2/dynamic.proto b/grpc_api/bilibili/app/dynamic/v2/dynamic.proto index 0cb27da..5ca37c9 100644 --- a/grpc_api/bilibili/app/dynamic/v2/dynamic.proto +++ b/grpc_api/bilibili/app/dynamic/v2/dynamic.proto @@ -785,6 +785,16 @@ message CampusHomePagesReq { int32 page_type = 6; } +// +enum CampusRcmdReqFrom { + CAMPUS_RCMD_FROM_UNKNOWN = 0; + CAMPUS_RCMD_FROM_HOME_UN_OPEN = 1; + CAMPUS_RCMD_FROM_VISIT_OTHER = 2; + CAMPUS_RCMD_FROM_HOME_MOMENT = 3; + CAMPUS_RCMD_FROM_DYN_MOMENT = 4; + CAMPUS_RCMD_FROM_PAGE_SUBORDINATE_MOMENT = 5; +} + // enum CampusHomePageType { // diff --git a/grpc_api/bilibili/dagw/component/avatar/common/common.proto b/grpc_api/bilibili/dagw/component/avatar/common/common.proto index 0ffdd02..4823322 100644 --- a/grpc_api/bilibili/dagw/component/avatar/common/common.proto +++ b/grpc_api/bilibili/dagw/component/avatar/common/common.proto @@ -1 +1,108 @@ -// TODO \ No newline at end of file +syntax = "proto3"; + +package bilibili.dagw.component.avatar.common; + +// +message BasicRenderSpec { + // + double opacity = 1; +} + +// +message ColorConfig { + // + bool is_dark_mode_aware = 1; + // + ColorSpec day = 2; + // + ColorSpec night = 3; +} + +// +message ColorSpec { + // + string argb = 1; +} + +// +message LayerGeneralSpec { + // + PositionSpec pos_spec = 1; + // + SizeSpec size_spec = 2; + // + BasicRenderSpec render_spec = 3; +} + +// +message MaskProperty { + // + LayerGeneralSpec general_spec = 1; + // + ResourceSource mask_src = 2; +} + +// +message NativeDrawRes { + // + int32 draw_type = 1; + // + int32 fill_mode = 2; + // + ColorConfig color_config = 3; + // + double edge_weight = 4; +} + +// +message PositionSpec { + // + int32 coordinate_pos = 1; + // + double axis_x = 2; + // + double axis_y = 3; +} + +// +message RemoteRes { + // + string url = 1; + // + string bfs_style = 2; +} + +// +message ResourceSource { + // + enum LocalRes { + LOCAL_RES_INVALID = 0; + LOCAL_RES_ICON_VIP = 1; + LOCAL_RES_ICON_SMALL_VIP = 2; + LOCAL_RES_ICON_PERSONAL_VERIFY = 3; + LOCAL_RES_ICON_ENTERPRISE_VERIFY = 4; + LOCAL_RES_ICON_NFT_MAINLAND = 5; + LOCAL_RES_DEFAULT_AVATAR = 6; + } + // + int32 src_type = 1; + // + int32 placeholder = 2; + // + oneof res { + // + RemoteRes remote = 3; + // + LocalRes local = 4; + // + NativeDrawRes draw = 5; + } +} + +// +message SizeSpec { + // + double width = 1; + // + double height = 2; +} \ No newline at end of file diff --git a/grpc_api/bilibili/dagw/component/avatar/v1/avatar.proto b/grpc_api/bilibili/dagw/component/avatar/v1/avatar.proto index 0ffdd02..f4ced14 100644 --- a/grpc_api/bilibili/dagw/component/avatar/v1/avatar.proto +++ b/grpc_api/bilibili/dagw/component/avatar/v1/avatar.proto @@ -1 +1,112 @@ -// TODO \ No newline at end of file +syntax = "proto3"; + +package bilibili.dagw.component.avatar.v1; + +import "bilibili/dagw/component/avatar/common/common.proto"; +import "bilibili/dagw/component/avatar/v1/plugin.proto"; + +// +message AvatarItem { + // + bilibili.dagw.component.avatar.common.SizeSpec container_size = 1; + // + repeated LayerGroup layers = 2; + // + LayerGroup fallback_layers = 3; + // + int64 mid = 4; +} + +// +message BasicLayerResource { + // + int32 res_type = 1; + // + oneof payload { + // + ResImage res_image = 2; + // + ResAnimation res_animation = 3; + /// + ResNativeDraw res_native_draw = 4; + }; +} + +// +message GeneralConfig { + // + map web_css_style = 1; +} + +// +message Layer { + // + string layer_id = 1; + // + bool visible = 2; + // + LayerGeneralSpec general_spec = 3; + // + LayerConfig layer_config = 4; + // + BasicLayerResource resource = 5; +} + +// +message LayerConfig { + // + map tags = 1; + // + bool is_critical = 2; + // + bool allow_over_paint = 3; + // + MaskProperty layer_mask = 4; +} + +// +message LayerGroup { + // + string group_id = 1; + // + repeated Layer layers = 2; + // + MaskProperty group_mask = 3; + // + bool is_critical_group = 4; +} + +// +message LayerTagConfig { + // + int32 config_type = 1; + // + oneof config { + // + GeneralConfig general_config = 2; + // + bilibili.dagw.component.avatar.v1.plugin.GyroConfig gyro_config = 3; + // + bilibili.dagw.component.avatar.v1.plugin.CommentDoubleClickConfig comment_doubleClick_config = 4; + // + bilibili.dagw.component.avatar.v1.plugin.LiveAnimeConfig live_anime_config = 5; + }; +} + +// +message ResAnimation { + // + ResourceSource webp_src = 1; +} + +// +message ResImage { + // + ResourceSource image_src = 1; +} + +// +message ResNativeDraw { + // + ResourceSource draw_src = 1; +} \ No newline at end of file diff --git a/grpc_api/bilibili/dagw/component/avatar/v1/plugin.proto b/grpc_api/bilibili/dagw/component/avatar/v1/plugin.proto new file mode 100644 index 0000000..a5d3702 --- /dev/null +++ b/grpc_api/bilibili/dagw/component/avatar/v1/plugin.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package bilibili.dagw.component.avatar.v1.plugin; + +// +message CommentDoubleClickConfig { + // + Interaction interaction = 1; + // + double animation_scale = 2; +} + +// +message GyroConfig { + // + NFTImageV2 gyroscope = 1; +} + +// +message GyroscopeContentV2 { + // + string file_url = 1; + // + float scale = 2; + // + repeated PhysicalOrientationV2 physical_orientation = 3; +} + +// +message GyroscopeEntityV2 { + // + string display_type = 1; + // + repeated GyroscopeContentV2 contents = 2; +} + +// +message Interaction { + // + string nft_id = 1; + // + bool enabled = 2; + // + string itype = 3; + // + string metadata_url = 4; +} + +// +message LiveAnimeConfig { + // + bool is_live = 1; +} + +// +message LiveAnimeItem { + // + ColorConfig color = 1; + // + double start_ratio = 2; + // + double end_ratio = 3; + // + double start_stroke = 4; + // + double start_opacity = 5; + // + int64 phase = 6; +} + +// +message NFTImageV2 { + // + repeated GyroscopeEntityV2 gyroscope = 1; +} + +// +message PhysicalOrientationAnimation { + // + string type = 1; + // + string bezier = 3; +} + +// +message PhysicalOrientationV2 { + // + string type = 1; + // + repeated PhysicalOrientationAnimation animations = 3; +} \ No newline at end of file