//
//  ChatFileModel.m
//  AIIM
//
//  Created by qitewei on 2025/5/26.
//

#import "ChatFileModel.h"
#import "FileInfoUtils.h"
@implementation ChatFileModel
- (instancetype)initWithName:(NSString *)name size:(NSString *)size isOversize:(BOOL)isOversize {
    self = [super init];
    if (self) {
        _fileName = name;
        _fileSize = size;
        _isOverSize = isOversize;
        if (isOversize) {
            _isSelected = NO;
        }else{
            _isSelected = YES;
        }
        
    }
    return self;
}
- (instancetype)initWithURL:(NSURL *)url{
    self = [super init];
    if (self) {
        _fileName = [FileInfoUtils getFileNameWithURL:url];
        _fileSize = [FileInfoUtils getFileSizeStringWithURL:url error:nil] ;
        _isOverSize = [FileInfoUtils isFileGreaterThan100MB:url error:nil];
        _bySize = [FileInfoUtils getFileSizeWithURL:url error:nil];
        if (_isOverSize) {
            _isSelected = NO;
        }else{
            _isSelected = YES;
        }
        
    }
    return self;
}
@end
