couldPhoneFileListModel.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // couldPhoneFileListModel.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2024/1/8.
  6. //
  7. #import "couldPhoneFileListModel.h"
  8. @implementation couldPhoneFileModel
  9. - (NSString*)getFileNameFun
  10. {
  11. if(!_changeFileName){
  12. _changeFileName = [[NSString alloc] initWithFormat:@"%ld_%@",self.length,self.name];
  13. }
  14. return _changeFileName;
  15. }
  16. - (NSString*)fileUrl
  17. {
  18. if(!_fileUrl || _fileUrl.length ==0)
  19. {
  20. NSString *urlStr = ksharedAppDelegate.NASFileByBoxService;
  21. _fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,self.path];
  22. }
  23. return _fileUrl;
  24. }
  25. #pragma mark - get download info
  26. // 构造回调信息
  27. - (NSDictionary *)downLoadInfoWithFinished:(BOOL)finished {
  28. return @{
  29. @"fileType" : self.fileType,
  30. @"path" : self.path,
  31. //@"path" : self.path,
  32. @"name" : self.name,
  33. @"length" : @(self.length),
  34. @"time" : @(self.time),
  35. @"curDownloadStateType" : @(self.curDownloadStateType),
  36. @"didDownloadBytes" : @(self.didDownloadBytes),
  37. @"isFinished" : @(finished)
  38. };
  39. }
  40. /**
  41. 设置不需要存储的属性, 在模型.m文件中实现该函数.
  42. */
  43. +(NSArray *)bg_ignoreKeys{
  44. return @[@"preTimeInterval",@"curTimeInterval",@"isSelectType"];
  45. }
  46. @end
  47. @implementation couldPhoneFileArrModel
  48. /**
  49. 设置不需要存储的属性, 在模型.m文件中实现该函数.
  50. */
  51. +(NSArray *)bg_ignoreKeys{
  52. return @[@"list"];
  53. }
  54. @end
  55. @implementation couldPhoneFileListModel
  56. @end