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 @@
- 本场演出汇集了当今京剧界的老中青三代名家,精彩呈现了《四郎探母》、《红鬃烈马》等经典剧目的核心唱段。高清多机位拍摄,还原现场震撼效果...
+梅派传人小林,师从著名京剧表演艺术家,深耕京剧艺术二十余年。致力于通过新媒体形式传播国粹文化,让更多年轻人爱上戏曲。
-本频道主要发布:
-2023年全国巡演剧照
-商务合作:business@example.com (点击查看)
+{{ tenant.description || '暂无详细介绍' }}