From 2c9bf4cc60bc549acbbbf8c9508a194d4112aaeb Mon Sep 17 00:00:00 2001 From: Leon <147289645+LeoninCS@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:35:36 +0800 Subject: [PATCH] =?UTF-8?q?chore:=E4=B8=80=E4=BA=9B=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/feed/repo.go | 6 +++--- test/account.json | 14 +------------- test/feed.json | 2 +- test/video.json | 2 +- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/internal/feed/repo.go b/internal/feed/repo.go index 8ab7544..e5c636f 100644 --- a/internal/feed/repo.go +++ b/internal/feed/repo.go @@ -2,7 +2,7 @@ package feed import ( "context" - "feedsystem_video_go/internal/video" // 引入视频实体 + "feedsystem_video_go/internal/video" "time" "gorm.io/gorm" @@ -32,9 +32,9 @@ func (repo *FeedRepository) ListLatest(ctx context.Context, limit int, latestBef func (repo *FeedRepository) ListLikesCount(ctx context.Context, limit int, likesCountBefore int64) ([]video.Video, error) { var videos []video.Video query := repo.db.WithContext(ctx).Model(&video.Video{}). - Order("like_count DESC") + Order("likes_count DESC") if likesCountBefore > 0 { - query = query.Where("like_count < ?", likesCountBefore) + query = query.Where("likes_count < ?", likesCountBefore) } if err := query.Limit(limit).Find(&videos).Error; err != nil { return nil, err diff --git a/test/account.json b/test/account.json index 39853ae..bfa965f 100644 --- a/test/account.json +++ b/test/account.json @@ -66,15 +66,11 @@ { "key": "Content-Type", "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{jwt_token}}" } ], "body": { "mode": "raw", - "raw": "{\n \"old_password\": \"{{password}}\",\n \"new_password\": \"{{newPassword}}\"\n}" + "raw": "{\n \"username\": \"{{username}}\",\n \"old_password\": \"{{password}}\",\n \"new_password\": \"{{newPassword}}\"\n}" }, "url": { "raw": "{{host}}/account/changePassword", @@ -96,10 +92,6 @@ { "key": "Content-Type", "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{jwt_token}}" } ], "body": { @@ -126,10 +118,6 @@ { "key": "Content-Type", "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{jwt_token}}" } ], "body": { diff --git a/test/feed.json b/test/feed.json index ccbb93e..2814b07 100644 --- a/test/feed.json +++ b/test/feed.json @@ -2,7 +2,7 @@ "info": { "name": "FeedSystem Feed API", "_postman_id": "4c2fd555-b880-4b14-8023-55a944936352", - "description": "Feed endpoints.\n\nPagination:\n- /feed/listLatest: copy response.next_time into feedLatestTime\n- /feed/listLikesCount: copy response.next_likes_count_before into feedLikesCountBefore", + "description": "Feed endpoints.\n\nPagination:\n- /feed/listLatest: copy response.next_time (unix seconds) into feedLatestTime\n- /feed/listLikesCount: copy response.next_likes_count_before into feedLikesCountBefore", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ diff --git a/test/video.json b/test/video.json index df123bd..d598d0b 100644 --- a/test/video.json +++ b/test/video.json @@ -48,7 +48,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"title\": \"demo video\",\n \"description\": \"manual request\",\n \"play_url\": \"http://example.com/demo.mp4\"\n}" + "raw": "{\n \"title\": \"demo video\",\n \"description\": \"manual request\",\n \"play_url\": \"http://example.com/demo.mp4\",\n \"cover_url\": \"http://example.com/demo.jpg\"\n}" }, "url": { "raw": "{{host}}/video/publish",