config.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. //
  2. // config.h
  3. // AIIM
  4. //
  5. // Created by gan on 2025/4/17.
  6. //
  7. #ifndef config_h
  8. #define config_h
  9. #import <UIKit/UIKit.h>
  10. //#ifdef DEBUG
  11. //static NSString *WebSocketUrl = @"ws://abt1.my-im.com:9326?";
  12. //#else
  13. //static NSString *WebSocketUrl = @"wss://aiim.my-im.com/wss?";
  14. //#endif
  15. //
  16. //#ifdef DEBUG
  17. //static NSString *httphost = @"http://abt1.my-im.com:8080";
  18. //#else
  19. //static NSString *httphost = @"https://aiim.my-im.com";
  20. //#endif
  21. static NSString *WebSocketUrl = @"wss://aiim.my-im.com/wss?";
  22. static NSString *httphost = @"https://aiim.my-im.com";
  23. //static NSString *WebSocketUrl = @"wss://aliaiim.my-im.com/wss?";
  24. //static NSString *httphost = @"https://aliaiim.my-im.com";
  25. //
  26. //static NSString *WebSocketUrl = @"wss://web.my-im.com/wss?";
  27. //static NSString *httphost = @"https://web.my-im.com";
  28. //static NSString *WebSocketUrl = @"ws://192.168.1.7:9326?";
  29. //static NSString *httphost = @"http://192.168.1.7:8080";
  30. //static NSString *httphost = @"http://br1.qihg091ew.com:8080";
  31. //本地数据库文件名称
  32. static NSString *locateDB = @"AlocateDB.sqlite";
  33. //JitsiMeet 服务器
  34. static NSString *JitsiMeetSV = @"https://rtc2.my-im.com/";
  35. //static NSString *JitsiMeetSV = @"https://rtc.my-im.com/";
  36. //static NSString *JitsiMeetSV = @"https://meet.jit.si/";
  37. //旧地址 @"https://rtc.my-im.com/"
  38. static NSString *filehttphost = @"http://upload.my-im.com";//生产文件服务器
  39. static NSString *ossfilehttphost = @"http://newweb.abtim-my.com/api/oss/uploadPart";//生产文件服务器
  40. static NSString * privacyPolicy = @"https://download.gobuy99.com/ynszc.html";//隐私政策
  41. //websocket
  42. //心跳
  43. static NSString *SendCode_PING= @"0";
  44. //准备
  45. static NSString *SendCode_READY= @"1";
  46. //消息
  47. static NSString *SendCode_MESSAGE= @"2";
  48. //读取消息
  49. static NSString *SendCode_READ= @"3";
  50. //其他设备登录
  51. static NSString *SendCode_OTHER_LOGIN= @"4";
  52. //好友申请
  53. static NSString *SendCode_NEW_FRIEND= @"5";
  54. //群申请验证
  55. static NSString *SendCode_GROUP_VALIDATE= @"6";
  56. //音视频通话结果
  57. static NSString *SendCode_WEBRTC_result= @"7";
  58. //视频通话
  59. static NSString *SendCode_WEBRTC_CALL= @"8";
  60. //关闭视频通话
  61. static NSString *SendCode_WEBRTC_CLOSE= @"9";
  62. //视频通话忙碌
  63. static NSString *SendCode_WEBRTC_BUSY= @"10";
  64. //webrtc信令
  65. static NSString *SendCode_WEBRTC_xinling= @"11";
  66. //对方正在忙
  67. static NSString *SendCode_WEBRTC_DFBUSY= @"12";
  68. //删除指令
  69. static NSString *SendCode_deletemsg= @"del";
  70. //消息已收到回执
  71. static NSString *SendCode_RECMsg = @"rec";
  72. //message
  73. //文本消息
  74. static NSString *MessageType_text= @"0";
  75. //图片消息
  76. static NSString *MessageType_image= @"1";
  77. //文件消息
  78. static NSString *MessageType_file= @"2";
  79. //语音消息
  80. static NSString *MessageType_voice= @"3";
  81. //撤回消息
  82. static NSString *MessageType_back= @"4";
  83. //删除消息
  84. static NSString *MessageType_delete= @"del";
  85. //视频消息
  86. static NSString *MessageType_video= @"5";
  87. //转发的消息
  88. static NSString *MessageType_forward= @"6";
  89. //音视频通话结果
  90. static NSString *MessageType_webrtcrs= @"7";
  91. //事件消息
  92. static NSString *MessageType_event= @"9";
  93. //webrtc 信令消息
  94. static NSString *MessageType_webrtc= @"webrtc";
  95. // 撤回
  96. static NSString *MessageType_CallBack2 = @"11"; // 撤回2
  97. // 删除
  98. static NSString *MessageType_Del = @"12";
  99. // 对方正在忙
  100. static NSString *MessageType_DFBUSY = @"13";
  101. static NSString *Type_FRIEND= @"0";
  102. static NSString *Type_GROUP= @"1";
  103. static int MAX_USERS = 100;
  104. typedef NS_ENUM(NSInteger, GlobalColorType) {
  105. GCTypeGreen,
  106. GCTypeGreend,
  107. GCTypeYellow,
  108. GCTypeBluel,
  109. GCTypeBlued,
  110. GCTypeRedd,
  111. GCTypeRedl,
  112. GCTypeOrangeR,
  113. GCTypeDark1,
  114. GCTypeDark2,
  115. GCTypeDark3,
  116. GCTypeDark4,
  117. GCTypeDark5,
  118. GCTypeDark6,
  119. GCTypeDark7,
  120. GCTypeWhite,
  121. GCTypeBlack,
  122. };
  123. static inline UIColor *globalColor(GlobalColorType type) {
  124. switch (type) {
  125. case GCTypeGreen:
  126. return [UIColor colorWithRed:0x1E/255.0 green:0xEC/255.0 blue:0x99/255.0 alpha:1.0];
  127. case GCTypeGreend:
  128. return [UIColor colorWithRed:0x50/255.0 green:0xCA/255.0 blue:0x75/255.0 alpha:1.0];
  129. case GCTypeYellow:
  130. return [UIColor colorWithRed:0xF0/255.0 green:0xFB/255.0 blue:0x60/255.0 alpha:1.0];
  131. case GCTypeBluel:
  132. return [UIColor colorWithRed:0x2E/255.0 green:0xF6/255.0 blue:0xE6/255.0 alpha:1.0];
  133. case GCTypeBlued:
  134. return [UIColor colorWithRed:0x6E/255.0 green:0x75/255.0 blue:0xFB/255.0 alpha:1.0];
  135. case GCTypeRedd:
  136. return [UIColor colorWithRed:0xFF/255.0 green:0x3A/255.0 blue:0x00/255.0 alpha:1.0];
  137. case GCTypeRedl:
  138. return [UIColor colorWithRed:0xFF/255.0 green:0x5F/255.0 blue:0x00/255.0 alpha:1.0];
  139. case GCTypeOrangeR:
  140. return [UIColor colorWithRed:0xFF/255.0 green:0x66/255.0 blue:0x00/255.0 alpha:1.0];
  141. case GCTypeDark1:
  142. return [UIColor colorWithRed:0xF6/255.0 green:0xF6/255.0 blue:0xF6/255.0 alpha:1.0];
  143. case GCTypeDark2:
  144. return [UIColor colorWithRed:0xD2/255.0 green:0xD2/255.0 blue:0xD2/255.0 alpha:1.0];
  145. case GCTypeDark3:
  146. return [UIColor colorWithRed:0xA1/255.0 green:0xA1/255.0 blue:0xA1/255.0 alpha:1.0];
  147. case GCTypeDark4:
  148. return [UIColor colorWithRed:0x78/255.0 green:0x7C/255.0 blue:0x85/255.0 alpha:1.0];
  149. case GCTypeDark5:
  150. return [UIColor colorWithRed:0x34/255.0 green:0x34/255.0 blue:0x34/255.0 alpha:1.0];
  151. case GCTypeDark6:
  152. return [UIColor colorWithRed:0x2F/255.0 green:0x32/255.0 blue:0x37/255.0 alpha:1.0];
  153. case GCTypeDark7:
  154. return [UIColor colorWithRed:0x83/255.0 green:0x89/255.0 blue:0x99/255.0 alpha:1.0];
  155. case GCTypeWhite:
  156. return [UIColor colorWithRed:0xFF/255.0 green:0xFF/255.0 blue:0xFF/255.0 alpha:1.0];
  157. case GCTypeBlack:
  158. return [UIColor colorWithRed:0x00/255.0 green:0x00/255.0 blue:0x00/255.0 alpha:1.0];
  159. default:
  160. return [UIColor blackColor]; // 默认颜色或者其他颜色
  161. }
  162. }
  163. /// 屏幕宽度,会根据横竖屏的变化而变化
  164. #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
  165. /// 屏幕高度,会根据横竖屏的变化而变化
  166. #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
  167. #define SCREEN_TOP [UIDevice navigationFullHeight] //顶部状态栏加导航栏高度
  168. #define NAVIGATIONBAR_HEIGHT [UIDevice navigationBarHeight]
  169. #define SCREEN_BOTTOM (isIphoneX ? 83 : 49) //底部tabbar高度
  170. #define SCREEN_X_BTM [UIDevice safeDistanceBottom] //刘海屏底部高度
  171. #define STATUS_Height [UIDevice statusBarHeight] //状态栏高度
  172. #define WINDOW [UIApplication sharedApplication].delegate.window
  173. #pragma mark - Image
  174. #define kImageMake(name) [UIImage imageNamed:name]
  175. #pragma mark - Font
  176. #define SYSFONT(size) [UIFont systemFontOfSize:size]
  177. #define SYSMFONT(size) [UIFont systemFontOfSize:size weight:UIFontWeightMedium]
  178. #define SYSBFONT(size) [UIFont systemFontOfSize:size weight:UIFontWeightBold]
  179. #define SYSHFONT(size) [UIFont systemFontOfSize:size weight:UIFontWeightHeavy]
  180. /* URL*/
  181. #define getURL(x) [NSURL URLWithString:x]
  182. #pragma mark weak
  183. #define weakSelf(var) __weak typeof(var) weak##var = var;
  184. #endif /* config_h */