CNLiveBusinessTools.h
2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//
// CNLiveBusinessTools.h
// CNLiveBusinessTools
//
// Created by 张旭 on 2020/4/14.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, CNStatType) {
CNStatTypeContentCount = 0, //内容次数统计
CNStatTypeContentDuration, //内容时长统计
CNStatTypeShareCount //分享次数统计
};
#pragma mark 文件类型
typedef NS_ENUM(NSInteger, CNFileType) {
CNFileTypeReadAndLook = 0,//识别和预览
CNFileTypeOnlyRead, //只能识别,不能预览
CNFileTypeUnkown, //未知文件
};
@interface CNLiveBusinessTools : NSObject
#pragma mark -- 统计
/**
统计eventId
@param statType 统计类型
@param type 内容类型 例如:szzg/sxzg/daren/app
@param userId 用户Id
@C端/B端
@return eventId
*/
+ (NSString *)cnStatWithType:(CNStatType)statType type:(NSString *)type userId:(NSString *)userId programId:(NSString *)programId title:(NSString *)title;
// 分享单独使用
+ (NSString *)cnStatWithType:(CNStatType)statType type:(NSString *)type userId:(NSString *)userId programId:(NSString *)programId title:(NSString *)title shareToType:(NSString *)shareToType;
#pragma mark --
#pragma mark -- UUID
// 获取UUID
+ (NSString *)getUidForStat:(NSDate *)date;
#pragma mark --
#pragma mark -- 获取 GIF 处理
+ (BOOL)isGif:(id)asset;
+ (BOOL)isGifWithImageData: (NSData *)data;
#pragma mark --
#pragma mark -- 文件
///文件类型
+ (NSDictionary *)fileTypeDic;
//通过文件后缀名判断是否为可读文件
+ (CNFileType)isReadedFileByType:(NSString *)suffixType;
#pragma mark --
#pragma mark -- 拼接需要的参数
+ (NSString *)uuid;
+ (NSString *)getSpid;
+ (NSString *)getSidIdfv;
#pragma mark --
#pragma mark --
+ (NSString *)signvalue:(NSDictionary *)parameter;
+ (NSString *)sha1:(NSString *)string;
//sha1签名
+ (NSMutableDictionary *_Nullable)encryptionSignWithParameter:(NSMutableDictionary *_Nullable)parameter encryptionKey:(NSString *_Nullable)encryptionKey;
#pragma mark --
#pragma mark -- 缓存
/**
GIF表情存放位置
@return 地址
*/
+ (NSString *)newChatGifFacePath;
/**
@param userId 单聊为对方ID,群聊为群聊 ID,图片和视频存放位置
@return 地址
*/
+ (NSString *)newChatFilePathByUserId:(NSString *)userId;
+ (nullable NSString *)chatFileWithCachePathByUserId:(NSString *_Nonnull)userId;
//用户ID
+ (nullable NSString *)chatFilePathByUserId:(NSString *_Nonnull)userId;
/**
@param userId 单聊为对方ID,群聊为群聊 ID
@return 返回聊天发送的文件 所保存的文件夹地址
*/
+ (NSString *)getChatFilesPathByUserId:(NSString *)userId;
/**
0
@param userId 单聊为对方ID,群聊为群聊 ID ,语音文件保存路径
*/
+ (NSString *)audioChatFilePathByUserId:(NSString *)userId;
/**
聊天背景图图片地址
@return file
*/
+ (NSString *)chatBackgroupImagefilePath;
#pragma mark --
@end
NS_ASSUME_NONNULL_END