diff --git a/client/ios/Podfile.lock b/client/ios/Podfile.lock index 83289842..aedb1a88 100644 --- a/client/ios/Podfile.lock +++ b/client/ios/Podfile.lock @@ -30,4 +30,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0 diff --git a/client/lib/protos/pkg/pr12er/messages.pb.dart b/client/lib/protos/pkg/pr12er/messages.pb.dart index 52f999f4..dd6719f5 100644 --- a/client/lib/protos/pkg/pr12er/messages.pb.dart +++ b/client/lib/protos/pkg/pr12er/messages.pb.dart @@ -22,6 +22,8 @@ class Video extends $pb.GeneratedMessage { ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'category', $pb.PbFieldType.OE, defaultOrMaker: Category.CATEGORY_UNSPECIFIED, valueOf: Category.valueOf, enumValues: Category.values) ..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numberOfLike', $pb.PbFieldType.O3) ..pPS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'keywords') + ..a<$core.int>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numberOfViews', $pb.PbFieldType.O3) + ..aOS(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'publishedDate') ..hasRequiredFields = false ; @@ -34,6 +36,8 @@ class Video extends $pb.GeneratedMessage { Category? category, $core.int? numberOfLike, $core.Iterable<$core.String>? keywords, + $core.int? numberOfViews, + $core.String? publishedDate, }) { final _result = create(); if (id != null) { @@ -57,6 +61,12 @@ class Video extends $pb.GeneratedMessage { if (keywords != null) { _result.keywords.addAll(keywords); } + if (numberOfViews != null) { + _result.numberOfViews = numberOfViews; + } + if (publishedDate != null) { + _result.publishedDate = publishedDate; + } return _result; } factory Video.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -136,6 +146,24 @@ class Video extends $pb.GeneratedMessage { @$pb.TagNumber(7) $core.List<$core.String> get keywords => $_getList(6); + + @$pb.TagNumber(8) + $core.int get numberOfViews => $_getIZ(7); + @$pb.TagNumber(8) + set numberOfViews($core.int v) { $_setSignedInt32(7, v); } + @$pb.TagNumber(8) + $core.bool hasNumberOfViews() => $_has(7); + @$pb.TagNumber(8) + void clearNumberOfViews() => clearField(8); + + @$pb.TagNumber(9) + $core.String get publishedDate => $_getSZ(8); + @$pb.TagNumber(9) + set publishedDate($core.String v) { $_setString(8, v); } + @$pb.TagNumber(9) + $core.bool hasPublishedDate() => $_has(8); + @$pb.TagNumber(9) + void clearPublishedDate() => clearField(9); } class Detail extends $pb.GeneratedMessage { diff --git a/client/lib/protos/pkg/pr12er/messages.pbjson.dart b/client/lib/protos/pkg/pr12er/messages.pbjson.dart index bf6c23eb..27559156 100644 --- a/client/lib/protos/pkg/pr12er/messages.pbjson.dart +++ b/client/lib/protos/pkg/pr12er/messages.pbjson.dart @@ -47,11 +47,13 @@ const Video$json = const { const {'1': 'category', '3': 5, '4': 1, '5': 14, '6': '.pkg.pr12er.Category', '10': 'category'}, const {'1': 'number_of_like', '3': 6, '4': 1, '5': 5, '10': 'numberOfLike'}, const {'1': 'keywords', '3': 7, '4': 3, '5': 9, '10': 'keywords'}, + const {'1': 'number_of_views', '3': 8, '4': 1, '5': 5, '10': 'numberOfViews'}, + const {'1': 'published_date', '3': 9, '4': 1, '5': 9, '10': 'publishedDate'}, ], }; /// Descriptor for `Video`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List videoDescriptor = $convert.base64Decode('CgVWaWRlbxIOCgJpZBgBIAEoBVICaWQSFAoFdGl0bGUYAiABKAlSBXRpdGxlEhIKBGxpbmsYAyABKAlSBGxpbmsSHAoJcHJlc2VudGVyGAQgASgJUglwcmVzZW50ZXISMAoIY2F0ZWdvcnkYBSABKA4yFC5wa2cucHIxMmVyLkNhdGVnb3J5UghjYXRlZ29yeRIkCg5udW1iZXJfb2ZfbGlrZRgGIAEoBVIMbnVtYmVyT2ZMaWtlEhoKCGtleXdvcmRzGAcgAygJUghrZXl3b3Jkcw=='); +final $typed_data.Uint8List videoDescriptor = $convert.base64Decode('CgVWaWRlbxIOCgJpZBgBIAEoBVICaWQSFAoFdGl0bGUYAiABKAlSBXRpdGxlEhIKBGxpbmsYAyABKAlSBGxpbmsSHAoJcHJlc2VudGVyGAQgASgJUglwcmVzZW50ZXISMAoIY2F0ZWdvcnkYBSABKA4yFC5wa2cucHIxMmVyLkNhdGVnb3J5UghjYXRlZ29yeRIkCg5udW1iZXJfb2ZfbGlrZRgGIAEoBVIMbnVtYmVyT2ZMaWtlEhoKCGtleXdvcmRzGAcgAygJUghrZXl3b3JkcxImCg9udW1iZXJfb2Zfdmlld3MYCCABKAVSDW51bWJlck9mVmlld3MSJQoOcHVibGlzaGVkX2RhdGUYCSABKAlSDXB1Ymxpc2hlZERhdGU='); @$core.Deprecated('Use detailDescriptor instead') const Detail$json = const { '1': 'Detail', diff --git a/client/lib/screens/detail_screen.dart b/client/lib/screens/detail_screen.dart index bda491f4..b3062b1c 100644 --- a/client/lib/screens/detail_screen.dart +++ b/client/lib/screens/detail_screen.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; import 'package:pr12er/protos/pkg/pr12er/messages.pb.dart'; -import 'package:youtube_player_flutter/youtube_player_flutter.dart'; +import 'package:pr12er/widgets/detail/header.dart'; import 'package:pr12er/utils/extractor.dart'; +import 'package:pr12er/widgets/detail/youtube.dart'; class DetailScreenArguments { final Video video; @@ -12,6 +13,15 @@ class DetailScreenArguments { class DetailScreen extends StatelessWidget { static const String routeName = "detail_app"; + Widget getHorizontalLine() { + return const Divider( + height: 5, + color: Colors.black, + indent: 5, + endIndent: 5, + ); + } + @override Widget build(BuildContext context) { final args = @@ -19,52 +29,35 @@ class DetailScreen extends StatelessWidget { ModalRoute.of(context)!.settings.arguments as DetailScreenArguments; return Scaffold( - appBar: AppBar( - leading: IconButton( - icon: const Icon(Icons.arrow_back), - onPressed: () { - Navigator.pop(context); - }, - ), - title: Text(args.video.title, - key: const ValueKey("$routeName/appBar/title")), + appBar: AppBar( + leading: IconButton( + icon: const Icon(Icons.arrow_back), + onPressed: () { + Navigator.pop(context); + }, ), - body: Detail(youtubeId: extractYoutubeId(args.video.link))); - } -} - -class Detail extends StatefulWidget { - final String youtubeId; - - const Detail({required this.youtubeId}); - - @override - _DetailState createState() => _DetailState(); -} - -class _DetailState extends State { - late final YoutubePlayerController _controller; - - @override - void initState() { - super.initState(); - - _controller = YoutubePlayerController( - initialVideoId: widget.youtubeId, - ); - } - - @override - Widget build(BuildContext context) { - return YoutubePlayerBuilder( - player: YoutubePlayer( - controller: _controller, + title: Text(args.video.title, + key: const ValueKey("$routeName/appBar/title")), + ), + body: CustomScrollView( + slivers: [ + SliverList( + delegate: SliverChildListDelegate([ + YoutubeWidget(youtubeId: extractYoutubeId(args.video.link)), + Container( + margin: const EdgeInsets.only(top: 5, left: 10, right: 10), + child: Column( + children: [ + HeaderWidget(video: args.video), + const SizedBox(height: 10), + getHorizontalLine(), + const SizedBox(height: 10), + ], + ), + ) + ])) + ], ), - builder: (context, player) { - return Column( - children: [player], - ); - }, ); } } diff --git a/client/lib/widgets/detail/abstract.dart b/client/lib/widgets/detail/abstract.dart new file mode 100644 index 00000000..f18f886d --- /dev/null +++ b/client/lib/widgets/detail/abstract.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class AbstractWidget extends StatelessWidget { + const AbstractWidget({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/client/lib/widgets/detail/header.dart b/client/lib/widgets/detail/header.dart new file mode 100644 index 00000000..321e35a0 --- /dev/null +++ b/client/lib/widgets/detail/header.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:pr12er/protos/pkg/pr12er/messages.pb.dart'; + +// ignore: must_be_immutable +class HeaderWidget extends StatelessWidget { + // this is a placeholder + // didILIkedIt should be replaced in the next future PR + // after defining user related information + bool didILikedIt = false; + + late Video video; + + HeaderWidget({Key? key, required this.video}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.only(top: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ...getPresenterWidgets(), + const SizedBox(width: 25), + ...getViewNumbersWidgets(), + const SizedBox(width: 25), + ...getDateWidgets(), + ], + ), + ); + } + + Widget getLikeIcon() { + if (didILikedIt) { + return const Icon(Icons.thumb_up_alt); + } + return const Icon(Icons.thumb_up_alt_outlined); + } + + List getViewNumbersWidgets() { + return [ + const SizedBox(width: 8), + const Icon(Icons.remove_red_eye), + const SizedBox(width: 8), + Text(video.numberOfViews.toString(), + style: const TextStyle(fontSize: 18)), + const SizedBox(width: 15), + getLikeIcon(), + const SizedBox(width: 8), + Text(video.numberOfLike.toString(), style: const TextStyle(fontSize: 18)), + ]; + } + + List getPresenterWidgets() { + return [ + Text(video.presenter, + style: const TextStyle( + color: Colors.black54, fontSize: 18, fontStyle: FontStyle.italic)) + ]; + } + + List getDateWidgets() { + return [ + const Icon(Icons.today), + const SizedBox(width: 8), + Text(video.publishedDate, style: const TextStyle(fontSize: 18)) + ]; + } +} diff --git a/client/lib/widgets/detail/recommendataion.dart b/client/lib/widgets/detail/recommendataion.dart new file mode 100644 index 00000000..ab0c8c29 --- /dev/null +++ b/client/lib/widgets/detail/recommendataion.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class RecommentationWidget extends StatelessWidget { + const RecommentationWidget({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/client/lib/widgets/detail/repository.dart b/client/lib/widgets/detail/repository.dart new file mode 100644 index 00000000..8ff603ee --- /dev/null +++ b/client/lib/widgets/detail/repository.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class RepositoryWidget extends StatelessWidget { + const RepositoryWidget({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/client/lib/widgets/detail/youtube.dart b/client/lib/widgets/detail/youtube.dart new file mode 100644 index 00000000..4bae1562 --- /dev/null +++ b/client/lib/widgets/detail/youtube.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:youtube_player_flutter/youtube_player_flutter.dart'; + +class YoutubeWidget extends StatefulWidget { + final String youtubeId; + + const YoutubeWidget({Key? key, required this.youtubeId}) : super(key: key); + + @override + _DetailState createState() => _DetailState(); +} + +class _DetailState extends State { + late final YoutubePlayerController _controller; + + @override + void initState() { + super.initState(); + + _controller = YoutubePlayerController( + initialVideoId: widget.youtubeId, + ); + } + + @override + Widget build(BuildContext context) { + return YoutubePlayerBuilder( + player: YoutubePlayer( + controller: _controller, + ), + builder: (context, player) { + return Column( + children: [player], + ); + }, + ); + } +} diff --git a/server/pkg/pr12er/messages.pb.go b/server/pkg/pr12er/messages.pb.go index 3bc340ad..4544f4aa 100644 --- a/server/pkg/pr12er/messages.pb.go +++ b/server/pkg/pr12er/messages.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.2 +// protoc v3.17.0 // source: pkg/pr12er/messages.proto package pr12er @@ -135,13 +135,15 @@ type Video struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` - Presenter string `protobuf:"bytes,4,opt,name=presenter,proto3" json:"presenter,omitempty"` - Category Category `protobuf:"varint,5,opt,name=category,proto3,enum=pkg.pr12er.Category" json:"category,omitempty"` - NumberOfLike int32 `protobuf:"varint,6,opt,name=number_of_like,json=numberOfLike,proto3" json:"number_of_like,omitempty"` - Keywords []string `protobuf:"bytes,7,rep,name=keywords,proto3" json:"keywords,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` + Presenter string `protobuf:"bytes,4,opt,name=presenter,proto3" json:"presenter,omitempty"` + Category Category `protobuf:"varint,5,opt,name=category,proto3,enum=pkg.pr12er.Category" json:"category,omitempty"` + NumberOfLike int32 `protobuf:"varint,6,opt,name=number_of_like,json=numberOfLike,proto3" json:"number_of_like,omitempty"` + Keywords []string `protobuf:"bytes,7,rep,name=keywords,proto3" json:"keywords,omitempty"` + NumberOfViews int32 `protobuf:"varint,8,opt,name=number_of_views,json=numberOfViews,proto3" json:"number_of_views,omitempty"` + PublishedDate string `protobuf:"bytes,9,opt,name=published_date,json=publishedDate,proto3" json:"published_date,omitempty"` } func (x *Video) Reset() { @@ -225,6 +227,20 @@ func (x *Video) GetKeywords() []string { return nil } +func (x *Video) GetNumberOfViews() int32 { + if x != nil { + return x.NumberOfViews + } + return 0 +} + +func (x *Video) GetPublishedDate() string { + if x != nil { + return x.PublishedDate + } + return "" +} + type Detail struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -546,7 +562,7 @@ var File_pkg_pr12er_messages_proto protoreflect.FileDescriptor var file_pkg_pr12er_messages_proto_rawDesc = []byte{ 0x0a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x70, 0x6b, 0x67, - 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x22, 0xd3, 0x01, 0x0a, 0x05, 0x56, 0x69, 0x64, 0x65, + 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x22, 0xa2, 0x02, 0x0a, 0x05, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, @@ -559,73 +575,78 @@ var file_pkg_pr12er_messages_proto_rawDesc = []byte{ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4c, 0x69, 0x6b, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x22, 0xc3, 0x01, - 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, - 0x05, 0x70, 0x61, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, - 0x05, 0x70, 0x61, 0x70, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, - 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x70, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x70, - 0x65, 0x72, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x50, 0x61, 0x70, 0x65, - 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x12, 0x73, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x5f, 0x70, 0x61, 0x70, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x03, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x26, 0x0a, + 0x0f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, + 0x56, 0x69, 0x65, 0x77, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x44, 0x61, 0x74, 0x65, 0x22, 0xc3, 0x01, 0x0a, + 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x05, + 0x70, 0x61, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x05, + 0x70, 0x61, 0x70, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, + 0x74, 0x5f, 0x70, 0x61, 0x70, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x70, 0x65, - 0x72, 0x52, 0x10, 0x73, 0x61, 0x6d, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x50, 0x61, 0x70, - 0x65, 0x72, 0x73, 0x22, 0xf6, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x70, 0x65, 0x72, 0x12, 0x19, 0x0a, - 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x61, 0x70, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x72, 0x78, 0x69, - 0x76, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x72, 0x78, 0x69, - 0x76, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x62, 0x73, 0x72, 0x61, 0x63, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x62, 0x73, 0x72, 0x61, 0x63, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x70, 0x75, 0x62, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x75, 0x62, 0x44, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, - 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2c, - 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0xd4, 0x01, 0x0a, - 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x69, - 0x73, 0x5f, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x69, 0x73, 0x4f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, - 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, - 0x31, 0x32, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x09, - 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0d, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x53, 0x74, 0x61, 0x72, - 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x2a, 0x82, 0x01, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, - 0x14, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x41, 0x54, 0x45, 0x47, - 0x4f, 0x52, 0x59, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, - 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4e, 0x4c, 0x50, 0x10, 0x02, 0x12, 0x10, - 0x0a, 0x0c, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4f, 0x43, 0x52, 0x10, 0x03, - 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x55, 0x44, - 0x49, 0x4f, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, - 0x5f, 0x52, 0x53, 0x10, 0x05, 0x2a, 0x6d, 0x0a, 0x09, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, - 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x15, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, 0x4f, 0x52, 0x4b, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, - 0x14, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x54, 0x45, 0x4e, 0x53, 0x4f, - 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x52, 0x41, 0x4d, 0x45, - 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x4f, 0x52, 0x43, 0x48, 0x10, 0x02, 0x12, 0x14, - 0x0a, 0x10, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x4f, 0x54, 0x48, 0x45, - 0x52, 0x53, 0x10, 0x03, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x74, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x50, 0x61, 0x70, 0x65, 0x72, + 0x73, 0x12, 0x3f, 0x0a, 0x12, 0x73, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x5f, 0x70, 0x61, 0x70, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, + 0x52, 0x10, 0x73, 0x61, 0x6d, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x50, 0x61, 0x70, 0x65, + 0x72, 0x73, 0x22, 0xf6, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x70, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x61, 0x70, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x61, 0x70, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x72, 0x78, 0x69, 0x76, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x72, 0x78, 0x69, 0x76, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x62, 0x73, 0x72, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x62, 0x73, 0x72, 0x61, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x75, 0x62, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x75, 0x62, 0x44, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, + 0x31, 0x32, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x0a, + 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0xd4, 0x01, 0x0a, 0x0a, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x69, 0x73, 0x4f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x31, + 0x32, 0x65, 0x72, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x09, 0x66, + 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0d, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x53, 0x74, 0x61, 0x72, 0x73, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, + 0x82, 0x01, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x14, + 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, + 0x52, 0x59, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x43, + 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4e, 0x4c, 0x50, 0x10, 0x02, 0x12, 0x10, 0x0a, + 0x0c, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4f, 0x43, 0x52, 0x10, 0x03, 0x12, + 0x12, 0x0a, 0x0e, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x41, 0x55, 0x44, 0x49, + 0x4f, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, + 0x52, 0x53, 0x10, 0x05, 0x2a, 0x6d, 0x0a, 0x09, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, + 0x6b, 0x12, 0x19, 0x0a, 0x15, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, + 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x54, 0x45, 0x4e, 0x53, 0x4f, 0x52, + 0x46, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, + 0x4f, 0x52, 0x4b, 0x5f, 0x50, 0x59, 0x54, 0x4f, 0x52, 0x43, 0x48, 0x10, 0x02, 0x12, 0x14, 0x0a, + 0x10, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x4f, 0x54, 0x48, 0x45, 0x52, + 0x53, 0x10, 0x03, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x31, 0x32, 0x65, 0x72, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/server/pkg/pr12er/messages.proto b/server/pkg/pr12er/messages.proto index b04b686c..72bdba7b 100644 --- a/server/pkg/pr12er/messages.proto +++ b/server/pkg/pr12er/messages.proto @@ -27,6 +27,8 @@ message Video { Category category = 5; int32 number_of_like = 6; repeated string keywords = 7; + int32 number_of_views = 8; + string published_date = 9; } message Detail { diff --git a/server/pkg/pr12er/metadata.pb.go b/server/pkg/pr12er/metadata.pb.go index b527f51b..e643f456 100644 --- a/server/pkg/pr12er/metadata.pb.go +++ b/server/pkg/pr12er/metadata.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.2 +// protoc v3.17.0 // source: pkg/pr12er/metadata.proto package pr12er diff --git a/server/pkg/pr12er/service.pb.go b/server/pkg/pr12er/service.pb.go index 8da61c33..64715936 100644 --- a/server/pkg/pr12er/service.pb.go +++ b/server/pkg/pr12er/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.17.2 +// protoc v3.17.0 // source: pkg/pr12er/service.proto package pr12er