import 'package:flutter_samples/logics/entities/api/api_poetry.dart'; import 'package:flutter_samples/logics/entities/page/poetry.dart'; class PoetryAdapter { // 格式化诗词数据(将ApiPoetry转换为Poetry) // 真实开发这里会处理成需要的格式, 这里仅仅是一个示例 static Poetry fromAPIPoetryToPoetry(ApiPoetry v) { return Poetry( id: v.id, title: v.title, content: v.content, authorId: v.authorId, authorName: v.authorName, authorAvatar: v.authorAvatar, authorBio: v.authorBio, dynastyId: v.dynastyId, dynastyName: v.dynastyName, favorNum: v.favorNum, shareNum: v.shareNum, commentNum: v.commentNum, collectNum: v.collectNum, sealNum: v.sealNum, honorPoints: v.honorPoints, version: v.version, deleted: v.deleted, favored: v.favored, ); } }