123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- //
- // RQTreeListModel.m
- // jiaPei
- //
- // Created by 张嵘 on 2021/10/25.
- // Copyright © 2021 JCZ. All rights reserved.
- //
- #import "RQTreeListModel.h"
- @implementation VideosItem
- + (NSDictionary *)modelCustomPropertyMapper {
- return @{
- @"video_url" : @"fileUrl",
- };
- }
- + (id)videoItemModelWithDictionary:(NSDictionary *)dic {
- VideosItem *item = [[VideosItem alloc] init];
- item.video_url = RQStringIsEmpty(item.video_url)? dic[@"videoPath"] : item.video_url;
- item.coverFileUrl = RQStringIsEmpty(item.coverFileUrl)? dic[@"image"] : item.coverFileUrl;
- item.title = RQStringIsEmpty(item.title)? dic[@"title"] : item.title;
- item.videoDescribe = RQStringIsEmpty(item.videoDescribe)? dic[@"content"] : item.videoDescribe;
- item.videoDuration = RQStringIsEmpty(item.videoDuration)? [NSString stringWithFormat:@"%@",dic[@"times"]] : item.videoDuration;
- return item;
- }
- @end
- @implementation ChildrenItem
- // 返回容器类中的所需要存放的数据类型 (以 Class 或 Class Name 的形式)。
- + (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
- return @{
- @"children" : [ChildrenItem class],
- @"videos" : [VideosItem class],
- };
- }
- @end
- @implementation RQTreeListModel
- // 返回容器类中的所需要存放的数据类型 (以 Class 或 Class Name 的形式)。
- + (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
- return @{
- @"children" : [ChildrenItem class],
- @"videos" : [VideosItem class],
- };
- }
- @end
|