带阿里标识的版本
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// HttpdnsDB.h
|
||||
// AlicloudHttpDNS
|
||||
// TrustHttpDNS
|
||||
//
|
||||
// Created by xuyecan on 2025/3/15.
|
||||
// Copyright © 2025 alibaba-inc.com. All rights reserved.
|
||||
// Copyright © 2025 trustapp.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@@ -19,53 +19,53 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 初始化数据库
|
||||
* @param accountId 账户ID
|
||||
* @return 数据库实例
|
||||
* @return 数据库实<EFBFBD><EFBFBD>?
|
||||
*/
|
||||
- (instancetype)initWithAccountId:(NSInteger)accountId;
|
||||
|
||||
/**
|
||||
* 创建或更新记录
|
||||
* 创建或更新记<EFBFBD><EFBFBD>?
|
||||
* @param record 主机记录
|
||||
* @return 是否成功
|
||||
*/
|
||||
- (BOOL)createOrUpdate:(HttpdnsHostRecord *)record;
|
||||
|
||||
/**
|
||||
* 根据缓存键查询记录
|
||||
* @param cacheKey 缓存键
|
||||
* 根据缓存键查询记<EFBFBD><EFBFBD>?
|
||||
* @param cacheKey 缓存<EFBFBD><EFBFBD>?
|
||||
* @return 查询到的记录,如果不存在则返回nil
|
||||
*/
|
||||
- (nullable HttpdnsHostRecord *)selectByCacheKey:(NSString *)cacheKey;
|
||||
|
||||
/**
|
||||
* 根据缓存键删除记录
|
||||
* @param cacheKey 缓存键
|
||||
* 根据缓存键删除记<EFBFBD><EFBFBD>?
|
||||
* @param cacheKey 缓存<EFBFBD><EFBFBD>?
|
||||
* @return 是否成功
|
||||
*/
|
||||
- (BOOL)deleteByCacheKey:(NSString *)cacheKey;
|
||||
|
||||
/**
|
||||
* 根据主机名数组批量删除记录
|
||||
* @param hostNameArr 主机名数组
|
||||
* @return 成功删除的记录数量
|
||||
* 根据主机名数组批量删除记<EFBFBD><EFBFBD>?
|
||||
* @param hostNameArr 主机名数<EFBFBD><EFBFBD>?
|
||||
* @return 成功删除的记录数<EFBFBD><EFBFBD>?
|
||||
*/
|
||||
- (NSInteger)deleteByHostNameArr:(NSArray<NSString *> *)hostNameArr;
|
||||
|
||||
/**
|
||||
* 获取所有缓存记录
|
||||
* @return 所有缓存记录数组
|
||||
* 获取所有缓存记<EFBFBD><EFBFBD>?
|
||||
* @return 所有缓存记录数<EFBFBD><EFBFBD>?
|
||||
*/
|
||||
- (NSArray<HttpdnsHostRecord *> *)getAllRecords;
|
||||
|
||||
/**
|
||||
* 清理指定时间点已过期的记录
|
||||
* @param specifiedTime 指定的时间点(epoch时间)
|
||||
* @return 清理的记录数量
|
||||
* 清理指定时间点已过期的记<EFBFBD><EFBFBD>?
|
||||
* @param specifiedTime 指定的时间点(epoch时间<EFBFBD><EFBFBD>?
|
||||
* @return 清理的记录数<EFBFBD><EFBFBD>?
|
||||
*/
|
||||
- (NSInteger)cleanRecordAlreadExpiredAt:(NSTimeInterval)specifiedTime;
|
||||
|
||||
/**
|
||||
* 删除所有记录
|
||||
* 删除所有记<EFBFBD><EFBFBD>?
|
||||
* @return 是否成功
|
||||
*/
|
||||
- (BOOL)deleteAll;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
+ (NSString *)httpdnsDataDirectory;
|
||||
+ (NSString *)scheduleCenterResultDirectory;
|
||||
/// 多账号隔离:返回指定账号的调度结果目录
|
||||
/// 多账号隔离:返回指定账号的调度结果目<EFBFBD><EFBFBD>?
|
||||
+ (NSString *)scheduleCenterResultDirectoryForAccount:(NSInteger)accountId;
|
||||
|
||||
+ (BOOL)saveJSON:(id)JSON toPath:(NSString *)path;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#import "HttpdnsService.h"
|
||||
#import "HttpdnsUtil.h"
|
||||
|
||||
static NSString *const ALICLOUD_HTTPDNS_ROOT_DIR_NAME = @"HTTPDNS";
|
||||
static NSString *const ALICLOUD_HTTPDNS_HOST_CACHE_DIR_NAME = @"HostCache";
|
||||
static NSString *const Trust_HTTPDNS_ROOT_DIR_NAME = @"HTTPDNS";
|
||||
static NSString *const Trust_HTTPDNS_HOST_CACHE_DIR_NAME = @"HostCache";
|
||||
|
||||
static dispatch_queue_t _fileCacheQueue = 0;
|
||||
|
||||
@@ -33,7 +33,7 @@ static dispatch_queue_t _fileCacheQueue = 0;
|
||||
+ (void)initialize {
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_fileCacheQueue = dispatch_queue_create("com.alibaba.sdk.httpdns.fileCacheQueue", DISPATCH_QUEUE_SERIAL);
|
||||
_fileCacheQueue = dispatch_queue_create("com.Trust.sdk.httpdns.fileCacheQueue", DISPATCH_QUEUE_SERIAL);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user