chore: Initial clean commit

- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
This commit is contained in:
edwinQQQ
2025-10-09 16:19:14 +08:00
commit a35a711be6
5582 changed files with 408913 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
//
// Timestamp.m
// YUMI
//
// Created by YUMI on 2022/1/12.
//
#import "Timestamp.h"
#import "YUMIMacroUitls.h"
@implementation Timestamp
///
/// @param succes
/// @param failure
+ (void)getInternetDateWithSuccess:(void(^)(NSTimeInterval timeInterval))succes
failure:(void(^)(NSError *error))failure{
//1.URL
NSString *urlString = [HttpRequestHelper getHostUrl];
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
//2.request
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString: urlString]];
[request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
[request setTimeoutInterval:5];
[request setHTTPShouldHandleCookies:FALSE];
[request setHTTPMethod:@"GET"];
//3.URLSession
NSURLSession *session = [NSURLSession sharedSession];
//4.block
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error == nil && response != nil) {
//MMMMM
NSArray *monthEnglishArray = @[@"Jan",@"Feb",@"Mar",@"Apr",@"May",@"Jun",@"Jul",@"Aug",@"Sept",@"Sep",@"Oct",@"Nov",@"Dec"];
NSArray *monthNumArray = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"09",@"10",@"11",@"12"];
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
NSDictionary *allHeaderFields = [httpResponse allHeaderFields];
NSString *dateStr = [allHeaderFields objectForKey:@"Date"];
dateStr = [dateStr substringFromIndex:5];
dateStr = [dateStr substringToIndex:[dateStr length]-4];
dateStr = [dateStr stringByAppendingString:@" +0000"];
//
for (NSInteger i = 0 ; i < monthEnglishArray.count ; i++) {
NSString *monthEngStr = monthEnglishArray[i];
NSString *monthNumStr = monthNumArray[i];
dateStr = [dateStr stringByReplacingOccurrencesOfString:monthEngStr withString:monthNumStr];
}
NSDateFormatter *dMatter = [[NSDateFormatter alloc] init];
[dMatter setDateFormat:@"dd MM yyyy HH:mm:ss Z"];
NSDate *netDate = [dMatter dateFromString:dateStr];
NSTimeInterval timeInterval = [netDate timeIntervalSince1970];
dispatch_async(dispatch_get_main_queue(), ^{
succes(timeInterval);
});
}else{
dispatch_async(dispatch_get_main_queue(), ^{
failure(error);
});
}
}];
//5
[task resume];
}
@end