diff --git a/backend/app/http/v1/dto/content.go b/backend/app/http/v1/dto/content.go index c1df632..aa0a3b4 100644 --- a/backend/app/http/v1/dto/content.go +++ b/backend/app/http/v1/dto/content.go @@ -8,6 +8,7 @@ type ContentListFilter struct { Genre *string `query:"genre"` TenantID *string `query:"tenantId"` Sort *string `query:"sort"` + IsPinned *bool `query:"is_pinned"` } type ContentItem struct { diff --git a/backend/app/http/v1/dto/creator.go b/backend/app/http/v1/dto/creator.go index f0e3c3b..e0a833d 100644 --- a/backend/app/http/v1/dto/creator.go +++ b/backend/app/http/v1/dto/creator.go @@ -106,6 +106,7 @@ type RefundForm struct { } type Settings struct { + ID string `json:"id"` Name string `json:"name"` Bio string `json:"bio"` Avatar string `json:"avatar"` diff --git a/backend/app/services/content.go b/backend/app/services/content.go index a84c4e7..ace4592 100644 --- a/backend/app/services/content.go +++ b/backend/app/services/content.go @@ -34,6 +34,9 @@ func (s *content) List(ctx context.Context, filter *content_dto.ContentListFilte tid := cast.ToInt64(*filter.TenantID) q = q.Where(tbl.TenantID.Eq(tid)) } + if filter.IsPinned != nil { + q = q.Where(tbl.IsPinned.Is(*filter.IsPinned)) + } // Sort sort := "latest" diff --git a/backend/app/services/creator.go b/backend/app/services/creator.go index 58c1491..e496ca7 100644 --- a/backend/app/services/creator.go +++ b/backend/app/services/creator.go @@ -663,6 +663,7 @@ func (s *creator) GetSettings(ctx context.Context, userID int64) (*creator_dto.S } cfg := t.Config.Data() return &creator_dto.Settings{ + ID: cast.ToString(t.ID), Name: t.Name, Bio: cfg.Bio, Avatar: cfg.Avatar, diff --git a/backend/app/services/tenant.go b/backend/app/services/tenant.go index b0ee820..e1b9c14 100644 --- a/backend/app/services/tenant.go +++ b/backend/app/services/tenant.go @@ -3,6 +3,7 @@ package services import ( "context" "errors" + "fmt" "quyun/v2/app/errorx" "quyun/v2/app/http/v1/dto" @@ -42,10 +43,15 @@ func (s *tenant) GetPublicProfile(ctx context.Context, userID int64, id string) Exists() } + cfg := t.Config.Data() + fmt.Printf("DEBUG: Tenant Config: %+v\n", cfg) return &dto.TenantProfile{ - ID: cast.ToString(t.ID), - Name: t.Name, - Avatar: "", // Extract from config if available + ID: cast.ToString(t.ID), + Name: t.Name, + Avatar: cfg.Avatar, + Cover: cfg.Cover, + Bio: cfg.Bio, + Description: cfg.Description, Stats: dto.Stats{ Followers: int(followers), Contents: int(contents), diff --git a/frontend/portal/src/api/tenant.js b/frontend/portal/src/api/tenant.js new file mode 100644 index 0000000..56c3d7f --- /dev/null +++ b/frontend/portal/src/api/tenant.js @@ -0,0 +1,7 @@ +import { request } from '../utils/request'; + +export const tenantApi = { + get: (id) => request(`/tenants/${id}`), + follow: (id) => request(`/tenants/${id}/follow`, { method: 'POST' }), + unfollow: (id) => request(`/tenants/${id}/follow`, { method: 'DELETE' }), +}; diff --git a/frontend/portal/src/layout/LayoutCreator.vue b/frontend/portal/src/layout/LayoutCreator.vue index 79c7fef..ca737cf 100644 --- a/frontend/portal/src/layout/LayoutCreator.vue +++ b/frontend/portal/src/layout/LayoutCreator.vue @@ -57,7 +57,7 @@
- 预览我的主页 @@ -76,13 +76,27 @@ diff --git a/frontend/portal/src/views/tenant/HomeView.vue b/frontend/portal/src/views/tenant/HomeView.vue index fe8b5e2..f32395f 100644 --- a/frontend/portal/src/views/tenant/HomeView.vue +++ b/frontend/portal/src/views/tenant/HomeView.vue @@ -3,7 +3,7 @@
-
@@ -14,7 +14,7 @@
- +
@@ -46,10 +46,10 @@ class="h-11 w-11 border border-white/20 text-white rounded-full flex items-center justify-center hover:bg-white/10 backdrop-blur-md transition-colors">
-
-
1.2万 关注
-
458 内容
-
8.9k 获赞
+
+
{{ tenant.stats.followers }} 关注
+
{{ tenant.stats.contents }} 内容
+
{{ tenant.stats.likes }} 获赞
@@ -83,19 +83,20 @@
-
- +
+
置顶
-
[京剧] 经典唱段合集
-

程派《荒山泪》夜织选段:沉浸式视听体验

+
[{{ featuredContent.genre }}]
+

{{ featuredContent.title }}

-
¥ 19.90
+
¥ {{ featuredContent.price }}
+
免费
@@ -104,31 +105,25 @@

最新动态

-
+ @click="$router.push(`/contents/${item.id}`)">
- -
- 12:40 -
- 限免 +
-

- 梅兰芳大剧院现场实录:2024 京剧名家演唱会

-

- 本场演出汇集了当今京剧界的老中青三代名家,精彩呈现了《四郎探母》、《红鬃烈马》等经典剧目的核心唱段。高清多机位拍摄,还原现场震撼效果...

+

+ {{ item.title }}

-
2小时前 · 1.2w 阅读
-
¥ 9.90
+
+ {{ item.views }} + {{ item.likes }} +
+
¥ {{ item.price }}
+
免费
@@ -138,23 +133,9 @@
-
+

关于我们

-

梅派传人小林,师从著名京剧表演艺术家,深耕京剧艺术二十余年。致力于通过新媒体形式传播国粹文化,让更多年轻人爱上戏曲。

-

本频道主要发布:

-
    -
  • 经典剧目高清实录
  • -
  • 唱腔身段教学课程
  • -
  • 戏曲文化深度解析
  • -
-
- -

2023年全国巡演剧照

-
-

联系方式

-

商务合作:business@example.com (点击查看)

+

{{ tenant.description || '暂无详细介绍' }}

@@ -173,29 +154,58 @@ \ No newline at end of file