import asyncio import time from pprint import pprint from core.models.video_item import VideoItem # 你的 Pydantic 模型路径 async def main(): fake_video_data = { "user_id": "uid456", "user_name": "测试用户", "out_video_id": "out789", "out_user_id": "out_user", "video_url": "http://example.com/video.mp4", "cover_url": "http://example.com/cover.jpg", "video_title": " 测试 视频 标题!!!", "publish_time_stamp": int(time.time()) - 86400, # 昨天 "strategy": "recommend", "classname": "test_platform" } item = VideoItem(**fake_video_data) result = await item.produce_item() print("✅ 校验通过的最终结构:") pprint(result) if __name__ == "__main__": asyncio.run(main())