feat(personalized_feed): added video and multiple images handling to detailed blog post screen

This commit is contained in:
misha
2026-07-22 14:41:26 +03:00
parent dcf7b25989
commit 2cccc9e253
17 changed files with 595 additions and 246 deletions

View File

@@ -0,0 +1,39 @@
{
"id": 4,
"state": "active",
"image": "media/4/a.jpg",
"images": [
{
"id": 40,
"url": "media/4/a.jpg",
"position": 1,
"orientation": "horizontal"
},
{
"id": 41,
"url": "media/4/b.jpg",
"position": 2,
"orientation": "horizontal"
}
],
"description": "Галерея и видео",
"author": {
"author_slug": "author-slug",
"author_name": "Автор",
"author_profile_icon": "https://example.com/photo.jpg",
"author_is_me": false,
"is_entity_subscribed_by_me": true,
"author_place_in_rating": null
},
"video_url": "https://rutube.ru/video/6a62f217aa99daf00af8fa6cebebf218/",
"video_url_embed": "https://rutube.ru/play/embed/6a62f217aa99daf00af8fa6cebebf218/",
"video_url_thumb": "media/4/thumb.jpg",
"created_at": "2024-01-18T12:00:00Z",
"updated_at": "2024-01-18T12:00:00Z",
"title": "Галерея и видео",
"total_likes": 12,
"total_views": 200,
"total_comments": 4,
"was_liked_by_me": false,
"is_favorite": false
}

View File

@@ -0,0 +1,45 @@
{
"id": 2,
"state": "active",
"image": "media/2/a.jpg",
"images": [
{
"id": 20,
"url": "media/2/a.jpg",
"position": 1,
"orientation": "horizontal"
},
{
"id": 21,
"url": "media/2/b.jpg",
"position": 2,
"orientation": "horizontal"
},
{
"id": 22,
"url": "media/2/c.jpg",
"position": 3,
"orientation": "vertical"
}
],
"description": "Пост только с галереей",
"author": {
"author_slug": "author-slug",
"author_name": "Автор",
"author_profile_icon": "https://example.com/photo.jpg",
"author_is_me": false,
"is_entity_subscribed_by_me": false,
"author_place_in_rating": null
},
"video_url": "",
"video_url_embed": null,
"video_url_thumb": null,
"created_at": "2024-01-16T12:00:00Z",
"updated_at": "2024-01-16T12:00:00Z",
"title": "Галерея",
"total_likes": 3,
"total_views": 40,
"total_comments": 1,
"was_liked_by_me": false,
"is_favorite": false
}

View File

@@ -1,7 +1,21 @@
{
"id": 1,
"state": "published",
"image": "https://example.com/image.jpg",
"state": "active",
"image": "media/1/cover.jpg",
"images": [
{
"id": 10,
"url": "media/1/a.jpg",
"position": 1,
"orientation": "horizontal"
},
{
"id": 11,
"url": "media/1/b.jpg",
"position": 2,
"orientation": "vertical"
}
],
"description": "Описание поста",
"author": {
"author_slug": "author-slug",
@@ -11,13 +25,15 @@
"is_entity_subscribed_by_me": null,
"author_place_in_rating": null
},
"video_url": "",
"video_url": "https://rutube.ru/video/6a62f217aa99daf00af8fa6cebebf218/",
"video_url_embed": "https://rutube.ru/play/embed/6a62f217aa99daf00af8fa6cebebf218/",
"video_url_thumb": "media/1/thumb.jpg",
"created_at": "2024-01-15T12:00:00Z",
"updated_at": "2024-01-15T12:00:00Z",
"title": "Заголовок",
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"was_liked_by_me": false
"was_liked_by_me": false,
"is_favorite": false
}

View File

@@ -0,0 +1,26 @@
{
"id": 3,
"state": "active",
"image": "images/element-image-placeholder.svg",
"images": [],
"description": "Пост только с видео",
"author": {
"author_slug": "author-slug",
"author_name": "Автор",
"author_profile_icon": "https://example.com/photo.jpg",
"author_is_me": false,
"is_entity_subscribed_by_me": false,
"author_place_in_rating": null
},
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"video_url_embed": "https://www.youtube.com/embed/dQw4w9WgXcQ",
"video_url_thumb": "media/3/thumb.jpg",
"created_at": "2024-01-17T12:00:00Z",
"updated_at": "2024-01-17T12:00:00Z",
"title": "Видео",
"total_likes": 8,
"total_views": 90,
"total_comments": 2,
"was_liked_by_me": true,
"is_favorite": false
}

View File

@@ -23,6 +23,18 @@ class FeedFixtures {
return FixtureReader.readAsMap('feed/feed_blog_post_response.json');
}
static Map<String, dynamic> feedBlogPostGalleryResponseJson() {
return FixtureReader.readAsMap('feed/feed_blog_post_gallery_response.json');
}
static Map<String, dynamic> feedBlogPostVideoOnlyResponseJson() {
return FixtureReader.readAsMap('feed/feed_blog_post_video_only_response.json');
}
static Map<String, dynamic> feedBlogPostGalleryAndVideoResponseJson() {
return FixtureReader.readAsMap('feed/feed_blog_post_gallery_and_video_response.json');
}
static PostFeedPaginationModel postFeedPaginationModel() {
return PostFeedPaginationModel.fromJson(postFeedResponseJson());
}
@@ -48,4 +60,16 @@ class FeedFixtures {
static FeedBlogPostModel feedBlogPostModel() {
return FeedBlogPostModel.fromJson(feedBlogPostResponseJson());
}
static FeedBlogPostModel feedBlogPostWithGallery() {
return FeedBlogPostModel.fromJson(feedBlogPostGalleryResponseJson());
}
static FeedBlogPostModel feedBlogPostVideoOnly() {
return FeedBlogPostModel.fromJson(feedBlogPostVideoOnlyResponseJson());
}
static FeedBlogPostModel feedBlogPostGalleryAndVideo() {
return FeedBlogPostModel.fromJson(feedBlogPostGalleryAndVideoResponseJson());
}
}