common_const.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // common_const.h
  3. // RA TradeFiling
  4. //
  5. // Created by Rui Zhang on 11/18/20.
  6. //
  7. #ifndef common_const_h
  8. #define common_const_h
  9. //
  10. //#define DEBUGLOG 1
  11. //
  12. //#ifdef DEBUGLOG
  13. //#ifdef DEBUG
  14. //// #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])//
  15. //#define DebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
  16. //
  17. //#define blockDebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n",weakself, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
  18. //
  19. //#else
  20. //#define DebugLog( s, ... )
  21. //
  22. //#define blockDebugLog( s, ... )
  23. //#endif
  24. //#else
  25. //#define DebugLog( s, ... )
  26. //
  27. //#define blockDebugLog( s, ... )
  28. //#endif
  29. #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  30. #define UIColorFromRGBAlpha(rgbValue,alp) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(alp)]
  31. // 接口json 的result值
  32. #define RESULT_LOGIN_ON_OTHER_DEVICE -1
  33. #define RESULT_NO_RESPONSE -1024
  34. #define RESULT_NET_ERROR -3
  35. #define RESULT_NET_NOTAVAILABLE -4
  36. #define RESULT_ERROR -5
  37. #define RESULT_LOCALFILE_ERROR -7
  38. #define RESULT_USERAUTH_ERROR -9
  39. #define RESULT_VER_LOW -15
  40. //#define RESULT_FALSE 0
  41. #define RESULT_FALSE 1
  42. #define RESULT_TRUE 2
  43. #define RESULT_FAILED_WITH_MESSAGE 9
  44. #define RESULT_TIMEOUT 99
  45. // 如何处理commoneditor action 类型调用的返回值
  46. #define ACTION_SAVE_DATA 0
  47. #define ACTION_FILL_SECTION 1
  48. // 如何处理commoneditor 数据加载类型
  49. #define URL_REMOTE 1
  50. #define URL_LOCAL 0
  51. #define URL_NONE 2
  52. #define URL_RESTORE 3
  53. #define URL_FILE 4
  54. // 对应接口状态的部分message
  55. #define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting."
  56. #define MSG_NET_ERROR @"Net Error. Cannot connect to server for now. Please retry later."
  57. #define MSG_USERAUTH_ERROR @"Username or password is incorrect.Please check."
  58. #define MSG_VER_LOW @"Current App version is out of date, please update to the latest version."
  59. #define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server."
  60. #define MSG_SUCCESS @"Success."
  61. #define MSG_LOGIN_DEVICE @"You are currently signed in on another device. Please check."
  62. #define MSG_TIMEOUT @"Request timeout."
  63. //
  64. #define RA_NOTIFICATION_KICKOUT @"RA_NOTIFICATION_KICKOUT"
  65. #endif /* common_const_h */