linkdood-web-sdk 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/linkdoodWebSDK.js +59 -3
  3. package/lib/cache/MessageCache.js +1 -1
  4. package/lib/cache/OrganizationTimeStampCache.js +4 -4
  5. package/lib/cache/db/bean/Message.js +2 -2
  6. package/lib/constant/storageConstant.js +2 -2
  7. package/lib/core/action/ApplicationAction.js +1 -1
  8. package/lib/core/action/AuthAction.js +1 -1
  9. package/lib/core/action/BuddyAction.js +1 -1
  10. package/lib/core/action/ChatAction.js +1 -1
  11. package/lib/core/action/ConfigAction.js +1 -1
  12. package/lib/core/action/EnterpriseAction.js +1 -1
  13. package/lib/core/action/FeedBackAction.js +1 -1
  14. package/lib/core/action/FileAction.js +1 -1
  15. package/lib/core/action/GroupAction.js +1 -1
  16. package/lib/core/action/HelpAction.js +1 -1
  17. package/lib/core/action/MediaAction.js +1 -1
  18. package/lib/core/action/MessageAction.js +8 -8
  19. package/lib/core/action/OrgAction.js +1 -1
  20. package/lib/core/action/OrganizationAction.js +1 -1
  21. package/lib/core/action/SearchAction.js +1 -1
  22. package/lib/core/action/SubscribeAction.js +1 -1
  23. package/lib/core/action/SystemAction.js +1 -1
  24. package/lib/core/action/SystemMessageAction.js +1 -1
  25. package/lib/core/action/UserAction.js +1 -1
  26. package/lib/notify/NotifyHeartBeat.js +5 -5
  27. package/lib/notify/send/children/notifySendMessage.js +3 -3
  28. package/lib/service/ChatService.js +7 -6
  29. package/lib/service/EnterpriseService.js +1 -1
  30. package/lib/service/GroupMemberService.js +1 -1
  31. package/lib/service/HelpService.js +1 -1
  32. package/lib/service/MediaService.js +3 -3
  33. package/lib/service/MessageService.js +4 -4
  34. package/lib/service/OrganizationService.js +17 -17
  35. package/lib/thrift/lib/thrift.js +6 -6
  36. package/lib/utils/filesUtil.js +11 -4
  37. package/package.json +1 -1
  38. package/docs/thrift/gen-js/APHold.js +0 -129
  39. package/docs/thrift/gen-js/APNotify.js +0 -3598
  40. package/docs/thrift/gen-js/APService.js +0 -28698
  41. package/docs/thrift/gen-js/ap_types.js +0 -19492
  42. package/docs/thrift/gen-js/aphead_types.js +0 -21341
  43. package/docs/thrift/gen-js/aphold_types.js +0 -123
  44. package/docs/thrift/gen-js/apnotify_types.js +0 -2033
  45. package/docs/thrift/test.cpp +0 -210
@@ -1,210 +0,0 @@
1
- bool entLogic::ent_getVisibleOrgUsers(void *param, void *result) {
2
- req_getVisibleOrgUsers *clireq = (req_getVisibleOrgUsers *)param;
3
- resp_getOrgUserAndChildNodes *cliresp = (resp_getOrgUserAndChildNodes *)result;
4
-
5
- if (clireq->flag) {
6
- /// 离线登陆,直接从本地数据库获取数据
7
- getPluginSlot(m_plugin)->sdklog(enlog_info, LogTagEnt, __FUNCTION__, "orgAndEntuser: offline login getVisibleOrgUsers");
8
-
9
- st_dbOperator op16(ldd_eOrg, eGetDatas, &clireq->orgID, &cliresp->vtOrgInfo);
10
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op16, sizeof(op16), true);
11
-
12
- st_dbOperator op17(ldd_eEntUser, eGetAllDatas, &clireq->orgID, &cliresp->vtEntUser);
13
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op17, sizeof(op17), true);
14
-
15
- return true;
16
- }
17
-
18
- int64 retflg = 0;
19
-
20
- /// 获取entID
21
- st_userInfo userInf;
22
- getldd_Plugin(m_plugin)->getUserInfo(userInf);
23
- if (!checkEntID(cliresp->code, userInf.entID)) {
24
- return true;
25
- }
26
- int64 entID = userInf.entID;
27
-
28
- /// 老版本 获取最新的组织时间戳和高管状态
29
- int8 ret = getldd_Plugin(m_plugin)->getIsNewEntOrg();
30
- if (ret == 0 && clireq->type == 1) {
31
- getTSfromNet(entID);
32
- compareNewAndOldStatus(entID);
33
- }
34
-
35
- /// 查找本地时间戳
36
- st_orgInfo orgInf;
37
- orgInf.orgID = clireq->orgID;
38
- st_dbOperator op1(ldd_eOrgInfo, eGetData, &clireq->orgID, &orgInf);
39
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op1, sizeof(op1), true);
40
- int64 orgTmp = orgInf.orgTimeStamp;
41
-
42
- st_userInfo tsuseInfo;
43
- st_dbOperator opuInfo(ldd_eUserInfo, eGetData, &clireq->orgID, &tsuseInfo);
44
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &opuInfo, sizeof(opuInfo), true);
45
-
46
- ///修改父组织名称,无法通过时间戳更新,只能每次登陆时更新所有组织信息来规避
47
- #if 0
48
- /// 如果是根组织,并且本地也有,则直接获取
49
- if (clireq->orgID == 0) {
50
- bool isExit = false;
51
- st_dbOperator op2(ldd_eOrg, eIsExist, 0, &isExit);
52
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op2, sizeof(op2), true);
53
- if (isExit) {
54
- getPluginSlot(m_plugin)->sdklog(enlog_info, LogTagEnt, __FUNCTION__,"orgAndEntuser: get root org from DB");
55
-
56
- st_dbOperator op3(ldd_eOrg, eGetDatas, &retflg, &cliresp->vtOrgInfo);
57
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op3, sizeof(op3), true);
58
-
59
- cliresp->code = 0;
60
- return true;
61
- }
62
- }
63
- #endif
64
-
65
- /// 发数据到服务器
66
- int type = 0;
67
- if (ret == 1 || compareNewAndOld(clireq->orgID, orgTmp)) {
68
- type = getVisibleOrgUsers(entID, clireq->orgID, cliresp, orgTmp, &tsuseInfo, &orgInf, false);
69
- }
70
- else {
71
- type = 3;
72
- }
73
- getPluginSlot(m_plugin)->sdklog(enlog_info, LogTagEnt, __FUNCTION__,
74
- "orgAndEntuser: orgID = %lld, orgTmp = %lld, type = %d", clireq->orgID, orgTmp, type);
75
-
76
- /// 从服务器获取新数据
77
- if (type == 0) {
78
- /// 删除时间戳
79
- st_dbOperator op16(ldd_eOrgInfo, eDeleteData, 0, 0);
80
- op16.appendID = clireq->orgID;
81
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op16, sizeof(op16));
82
-
83
- /// 删除组织
84
- st_dbOperator op4(ldd_eOrg, eDeleteData, 0, 0);
85
- op4.appendID = clireq->orgID;
86
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op4, sizeof(op4));
87
-
88
- /// 写组织
89
- if (!cliresp->vtOrgInfo.empty()) {
90
- std::vector<st_organizationInfo> *pVtOrg =
91
- (std::vector<st_organizationInfo> *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eOrg);
92
- *pVtOrg = cliresp->vtOrgInfo;
93
- st_dbOperator op5(ldd_eOrg, eSetDatas, pVtOrg, 0);
94
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op5, sizeof(op5));
95
- }
96
-
97
- /// 删除人员
98
- st_dbOperator op6(ldd_eEntUser, eDeleteData, 0, 0);
99
- op6.appendID = clireq->orgID;
100
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op6, sizeof(op6));
101
-
102
- /// 写人员
103
- if (!cliresp->vtEntUser.empty()) {
104
- std::vector<st_entpriseUserInfo> *pVtEntU =
105
- (std::vector<st_entpriseUserInfo> *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eEntUser);
106
- *pVtEntU = cliresp->vtEntUser;
107
- st_dbOperator op7(ldd_eEntUser, eSetDatas, pVtEntU, 0);
108
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op7, sizeof(op7));
109
- for (int index = 0; index < cliresp->vtEntUser.size(); index++) {
110
- if (!cliresp->vtEntUser[index].userHead.empty())
111
- cliresp->vtEntUser[index].userHead = tools::getUniqueNameByUrl(cliresp->vtEntUser[index].userHead);
112
- }
113
- }
114
-
115
- if (ret == 1) {
116
- /// 写组织时间戳
117
- st_orgInfo *pOr = (st_orgInfo *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eOrgInfo, false);
118
- *pOr = orgInf;
119
- st_dbOperator op8(ldd_eOrgInfo, eSetData, pOr, 0);
120
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op8, sizeof(op8));
121
-
122
- if (clireq->orgID != 0) {
123
- if (tsuseInfo.orgSwitch) {
124
- cliresp->allowChat = orgInf.allowChat;
125
- cliresp->contactVisiable = orgInf.contactVisiable;
126
- }
127
- }
128
- else {
129
- getldd_Plugin(m_plugin)->setUserInfo(tsuseInfo);
130
- st_userInfo *pUs = (st_userInfo *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eUserInfo, false);
131
- *pUs = tsuseInfo;
132
- st_dbOperator op9(ldd_eUserInfo, eSetData, pUs, 0);
133
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op9, sizeof(op9));
134
- }
135
- }
136
- else {
137
- if (clireq->orgID != 0) {
138
- std::map<int64, int64> mp_orgTs;
139
- int64 newTm = getNewOrgTs(clireq->orgID);
140
- if (newTm != 0) {
141
- orgInf.orgTimeStamp = newTm;
142
-
143
- st_orgInfo *pOrgI = (st_orgInfo *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eOrgInfo, false);
144
- *pOrgI = orgInf;
145
- st_dbOperator op10(ldd_eOrgInfo, eSetData, pOrgI, 0);
146
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op10, sizeof(op10));
147
- }
148
- }
149
- }
150
-
151
- cliresp->code = 0;
152
- }
153
- /// 被移除了组织机构
154
- else if (type == 1) {
155
- tsuseInfo.entID = -1;
156
- getldd_Plugin(m_plugin)->setUserInfo(tsuseInfo); /// 如果没有企业,设置-1来标志
157
- dropAllEntTable(); /// 删除所有企业相关的表
158
- cliresp->code = 16004; /// 用户不在组织机构中
159
- }
160
- /// 从根组织开始重新拉取
161
- else if (type == 2) {
162
- //st_dbOperator op11(ldd_eOrg, eGetDatas, &retflg, &cliresp->vtOrgInfo);
163
- //getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op11, sizeof(op11), true);
164
-
165
- dropAllEntTable(true);
166
-
167
- /*std::vector<st_organizationInfo> *pO =
168
- (std::vector<st_organizationInfo> *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eOrg);
169
- *pO = cliresp->vtOrgInfo;
170
- st_dbOperator op12(ldd_eOrg, eSetDatas, pO, 0);
171
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op12, sizeof(op12));*/
172
-
173
- getldd_Plugin(m_plugin)->setUserInfo(tsuseInfo);
174
- st_userInfo *pUse = (st_userInfo *)getldd_Plugin(m_plugin)->getInnerDbCmdData(ldd_eUserInfo, false);
175
- *pUse = tsuseInfo;
176
- st_dbOperator op13(ldd_eUserInfo, eSetData, pUse, 0);
177
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op13, sizeof(op13));
178
-
179
- cliresp->code = err_sdk_orgTacticsChaged; /// 从根组织重新获取
180
- }
181
- /// 本地数据就是最新的
182
- else if (type == 3) {
183
- st_dbOperator op14(ldd_eOrg, eGetDatas, &clireq->orgID, &cliresp->vtOrgInfo);
184
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op14, sizeof(op14), true);
185
-
186
- st_dbOperator op15(ldd_eEntUser, eGetAllDatas, &clireq->orgID, &cliresp->vtEntUser);
187
- getPluginSlot(m_plugin)->sendtoDb(getldd_Plugin(m_plugin)->getDbChannle(), ldd_db_op, &op15, sizeof(op15), true);
188
-
189
- std::vector<st_entpriseUserInfo>::iterator iter = cliresp->vtEntUser.begin();
190
- while (iter != cliresp->vtEntUser.end()) {
191
- iter->userHead = getldd_Plugin(m_plugin)->checkBuddyHI(iter->userID, iter->userHead);
192
- iter++;
193
- }
194
-
195
- if (clireq->orgID != 0 && tsuseInfo.orgSwitch) {
196
- cliresp->allowChat = orgInf.allowChat;
197
- cliresp->contactVisiable = orgInf.contactVisiable;
198
- }
199
-
200
- cliresp->code = 0;
201
- }
202
- else {
203
- /// do nothing
204
- }
205
-
206
- getPluginSlot(m_plugin)->sdklog(enlog_info, LogTagEnt, __FUNCTION__,
207
- "orgAndEntuser: orgSize = %d, userSize = %d", cliresp->vtOrgInfo.size(), cliresp->vtEntUser.size());
208
-
209
- return true;
210
- }