解决了语音上传到问题,接下来要解决下载播放问题

This commit is contained in:
joywayer
2025-06-15 12:36:47 +08:00
parent bba3ed1cb4
commit c11fc62bf1
513 changed files with 31197 additions and 2969 deletions

View File

@@ -0,0 +1,58 @@
//
// QNDnsCacheKey.m
// QnDNS
//
// Created by yangsen on 2020/3/26.
// Copyright © 2020 com.qiniu. All rights reserved.
//
#import "QNDnsCacheInfo.h"
@interface QNDnsCacheInfo()
///
@property(nonatomic, copy)NSString *currentTime;
/// IP
@property(nonatomic, copy)NSString *localIp;
///
@property(nonatomic, copy)NSDictionary *info;
@end
@implementation QNDnsCacheInfo
+ (instancetype)dnsCacheInfo:(NSData *)jsonData{
NSDictionary *info = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
if (!info || info.count == 0 ||
(!info[@"currentTime"] && !info[@"localIp"] && !info[@"info"])) {
return nil;
}
return [QNDnsCacheInfo dnsCacheInfo:info[@"currentTime"]
localIp:info[@"localIp"]
info:info[@"info"]];;
}
+ (instancetype)dnsCacheInfo:(NSString *)currentTime
localIp:(NSString *)localIp
info:(NSDictionary *)info{
QNDnsCacheInfo *cacheInfo = [[QNDnsCacheInfo alloc] init];
cacheInfo.currentTime = currentTime;
cacheInfo.localIp = localIp;
cacheInfo.info = info;
return cacheInfo;
}
- (NSData *)jsonData{
NSMutableDictionary *cacheInfo = [NSMutableDictionary dictionary];
if (self.currentTime) {
cacheInfo[@"currentTime"] = self.currentTime;
}
if (self.localIp) {
cacheInfo[@"localIp"] = self.localIp;
}
if (self.info) {
cacheInfo[@"info"] = self.info;
}
return [NSJSONSerialization dataWithJSONObject:cacheInfo options:NSJSONWritingPrettyPrinted error:nil];
}
@end