feat: 添加内容置顶过滤选项,更新内容列表查询功能;添加创作者设置 ID 字段;优化租户信息获取逻辑;更新租户 API 接口
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user