chore:一些测试文件的小修改

This commit is contained in:
Leon
2025-12-16 14:35:36 +08:00
parent a93521f8ab
commit 2c9bf4cc60
4 changed files with 6 additions and 18 deletions

View File

@@ -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

View File

@@ -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": {

View File

@@ -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": [

View File

@@ -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",