Compare commits

...

1590 Commits

Author SHA1 Message Date
Gordon
f2b0f54c0b test 2022-07-01 19:48:03 +08:00
Gordon
a1025d8eee test 2022-07-01 19:41:15 +08:00
Gordon
047ee6454b test 2022-07-01 19:32:56 +08:00
Gordon
71dd28eabd Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 19:29:37 +08:00
Gordon
b8cd9484dc test 2022-07-01 19:29:17 +08:00
wangchuxiao
2c823e094f v2.2.0 2022-07-01 18:11:30 +08:00
Gordon
a1bb9630d0 test 2022-07-01 17:27:51 +08:00
skiffer-git
e23d5926dd Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 17:24:24 +08:00
skiffer-git
5c4982a3f1 fix bug 2022-07-01 17:23:43 +08:00
Gordon
7d172d718f test 2022-07-01 17:23:21 +08:00
Gordon
804b5423e5 test 2022-07-01 17:11:41 +08:00
Gordon
5a825df6a1 test 2022-07-01 17:06:55 +08:00
Gordon
50d1646ce0 test 2022-07-01 17:05:16 +08:00
Gordon
1d01e61148 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 17:00:13 +08:00
Gordon
21e9958da9 test 2022-07-01 16:59:49 +08:00
wangchuxiao
7c18012ef2 mongo docker-compose 2022-07-01 16:59:16 +08:00
wangchuxiao
cbeae74fc0 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-07-01 16:53:50 +08:00
wangchuxiao
f3144f92c5 mongo docker-compose 2022-07-01 16:53:45 +08:00
Gordon
3dd9d51ca5 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 16:51:56 +08:00
Gordon
5f0873221a test 2022-07-01 16:51:44 +08:00
wangchuxiao
49cbb42d0d mongo docker-compose 2022-07-01 16:45:12 +08:00
wangchuxiao
519a8bee71 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-07-01 16:42:04 +08:00
wangchuxiao
834b88f68f mongo docker-compose 2022-07-01 16:41:47 +08:00
Gordon
e02150cdb0 test 2022-07-01 16:38:11 +08:00
Gordon
5b4f94832d Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 16:23:47 +08:00
Gordon
566d5e832c test 2022-07-01 16:23:28 +08:00
wangchuxiao
36667b8649 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-07-01 15:38:18 +08:00
wangchuxiao
088f9dae9b demo 2022-07-01 15:36:44 +08:00
Gordon
813b6a6a68 test 2022-07-01 15:33:35 +08:00
Gordon
c8d9fc7311 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 15:30:41 +08:00
Gordon
e555a047e6 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 15:29:52 +08:00
skiffer-git
ed52ecb259 fix bug 2022-07-01 15:29:45 +08:00
Gordon
f993ddf876 test 2022-07-01 15:29:22 +08:00
skiffer-git
54566997b2 fix bug 2022-07-01 15:25:06 +08:00
skiffer-git
4783e3d061 log 2022-07-01 15:11:33 +08:00
skiffer-git
658d97ff4e log 2022-07-01 15:07:22 +08:00
skiffer-git
3373925acf Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-07-01 15:00:13 +08:00
skiffer-git
9d84bf8f4c log 2022-07-01 14:59:53 +08:00
Gordon
1650165f4b group add verify 2022-07-01 14:47:29 +08:00
wangchuxiao
8849cd46c9 callback 2022-07-01 12:14:15 +08:00
wangchuxiao
0835ecf0ed Merge branch 'tuoyun' into superGroup
# Conflicts:
#	deploy_k8s/k8s_openim_deploy.md
2022-07-01 10:16:48 +08:00
wangchuxiao
8bedfca646 deploy_k8s 2022-07-01 00:14:59 +08:00
Gordon
1fa38a24b6 compose file update 2022-06-30 19:27:23 +08:00
Gordon
1d105dd345 compose file update 2022-06-30 19:19:00 +08:00
wangchuxiao
7823306045 demo 2022-06-30 19:11:44 +08:00
wangchuxiao
53b0d13342 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-30 18:50:28 +08:00
wangchuxiao
f51fbecfee callback 2022-06-30 18:50:10 +08:00
Gordon
1f968a606b compose file update 2022-06-30 18:46:34 +08:00
Gordon
a13397bc17 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-30 18:42:50 +08:00
Gordon
323e8e72cc compose file update 2022-06-30 18:42:30 +08:00
wangchuxiao
80a67d0970 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-30 17:12:46 +08:00
wangchuxiao
4e22970784 minio 2022-06-30 17:12:25 +08:00
Gordon
ddc07ee160 compose file update 2022-06-30 17:07:18 +08:00
Gordon
e96b9b8bf8 compose file update 2022-06-30 16:51:58 +08:00
Gordon
013828eb03 sms test 2022-06-30 16:42:27 +08:00
Gordon
10132879f2 sms test 2022-06-30 16:29:52 +08:00
Gordon
832871d49d sms test 2022-06-30 16:27:39 +08:00
wangchuxiao
e5ccc1dd36 minio 2022-06-30 10:28:11 +08:00
wangchuxiao
61951863ad minio 2022-06-30 10:24:47 +08:00
wangchuxiao
64c6a68d34 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-30 10:14:26 +08:00
wangchuxiao
0054c4cc58 minio 2022-06-30 10:14:12 +08:00
Gordon
5bf494ca7d code update 2022-06-29 19:06:08 +08:00
Gordon
da81f70161 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-29 19:01:16 +08:00
Gordon
f3e21ac814 code update 2022-06-29 19:00:48 +08:00
wangchuxiao
2314c99c36 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-29 18:49:41 +08:00
wangchuxiao
2907cac50f swagger 2022-06-29 18:48:17 +08:00
Gordon
536c62c137 config update 2022-06-29 18:46:27 +08:00
Gordon
c1b855ebf7 config update 2022-06-29 18:45:16 +08:00
Gordon
84d76f0749 config update 2022-06-29 18:37:39 +08:00
Gordon
3ae0a05422 config update 2022-06-29 18:36:35 +08:00
Gordon
f700c15bc7 config update 2022-06-29 18:35:26 +08:00
Gordon
46e24556ef config update 2022-06-29 18:34:07 +08:00
Gordon
e20f953c7f config update 2022-06-29 18:30:33 +08:00
Gordon
3c24d50bde Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-29 18:01:56 +08:00
Gordon
204d80d86f Tencent cloud 2022-06-29 18:01:42 +08:00
wangchuxiao
4eeef63724 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup
# Conflicts:
#	internal/api/group/group.go
2022-06-29 11:23:03 +08:00
wangchuxiao
0c7f57d55d swagger docs 2022-06-29 11:18:19 +08:00
Gordon
3a55f50723 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-29 11:05:35 +08:00
Gordon
6853c64479 mongo version update 2022-06-29 11:05:22 +08:00
skiffer-git
3da6597643 fix bug 2022-06-28 20:47:16 +08:00
skiffer-git
26bd3bf76d fix bug 2022-06-28 20:43:52 +08:00
skiffer-git
d17d7a792a fix bug 2022-06-28 20:39:27 +08:00
skiffer-git
dc9f7dc294 fix bug 2022-06-28 18:26:32 +08:00
skiffer-git
92b219769d fix bug 2022-06-28 17:26:18 +08:00
skiffer-git
3e630a3882 fix bug 2022-06-28 17:23:20 +08:00
skiffer-git
de32c46ea4 debug 2022-06-28 15:54:27 +08:00
skiffer-git
722b5d0726 debug 2022-06-28 15:47:55 +08:00
skiffer-git
d51af59f85 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-28 15:26:35 +08:00
skiffer-git
5102f83290 debug 2022-06-28 15:25:46 +08:00
skiffer-git
9da4da5fd6 debug 2022-06-28 15:25:26 +08:00
wangchuxiao
5213860919 docker-compose 2022-06-28 10:38:33 +08:00
wangchuxiao
20f78d214f swagger 2022-06-28 10:36:27 +08:00
wangchuxiao
5207e268de swagger doc 2022-06-28 10:29:14 +08:00
wangchuxiao
226108f558 docker-compose 2022-06-27 13:31:37 +08:00
wangchuxiao
7280ef42a9 docker-compose 2022-06-27 13:24:21 +08:00
wangchuxiao
919eacc0a9 docker-compose 2022-06-27 13:22:35 +08:00
wangchuxiao
ccd7be7276 docker-compose 2022-06-27 13:20:31 +08:00
wangchuxiao
5bdf4e51de Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-27 12:20:11 +08:00
wangchuxiao
25704e5ddd docker-compose 2022-06-27 12:19:54 +08:00
skiffer-git
cf15bd3697 Adjust api router 2022-06-27 11:32:43 +08:00
wangchuxiao
14b53276b9 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-24 20:30:29 +08:00
wangchuxiao
a6c63e7968 swagger init 2022-06-24 20:29:53 +08:00
Gordon
57e11c781b test 2022-06-24 20:01:37 +08:00
Gordon
1d2da05f66 test 2022-06-24 19:52:52 +08:00
Gordon
ceb0f778b8 test 2022-06-24 19:49:01 +08:00
Gordon
d8717bd0b4 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-24 19:04:39 +08:00
Gordon
cfcc5c1095 test 2022-06-24 19:04:06 +08:00
wangchuxiao
79b1a801b5 demo 2022-06-24 18:46:21 +08:00
wangchuxiao
79907b374a alter demo 2022-06-24 18:33:52 +08:00
wangchuxiao
278d09e4db add swagger demo 2022-06-24 17:46:50 +08:00
wangchuxiao
189a7d09a1 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-24 17:45:50 +08:00
wangchuxiao
99062805ec add swagger demo 2022-06-24 17:45:33 +08:00
wenxu12345
87dbdc07d1 verification joining group chat 2022-06-24 15:52:37 +08:00
wenxu12345
db7ef3ac4b Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-23 18:57:05 +08:00
wenxu12345
5b8ef3a17c verification gor joining group chat 2022-06-23 18:56:52 +08:00
Gordon
b7f257daf1 compose file update 2022-06-23 11:06:17 +08:00
Gordon
c27560ed44 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-23 10:18:58 +08:00
Gordon
ddddbf6987 remove old redis module 2022-06-23 10:18:44 +08:00
wenxu12345
2f5d8dfb80 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-23 09:24:20 +08:00
wenxu12345
218340e138 Rpc Register IP 2022-06-23 09:24:05 +08:00
wangchuxiao
c4ea10d0af fix bug 2022-06-22 20:23:04 +08:00
wangchuxiao
bb8dcd8b61 fix bug 2022-06-22 20:19:37 +08:00
wangchuxiao
2372340e0d fix bug 2022-06-22 20:13:26 +08:00
wangchuxiao
f78f7e97ee Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-22 19:48:49 +08:00
wangchuxiao
6b78b75638 fix bug 2022-06-22 19:48:35 +08:00
Gordon
2f2f72fe4b test 2022-06-21 21:27:00 +08:00
Gordon
34fe9596a9 test 2022-06-21 21:22:35 +08:00
Gordon
e4d35c2a86 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-21 21:13:36 +08:00
Gordon
af7dde61d6 model update 2022-06-21 21:13:27 +08:00
wenxu12345
a62388759a Handling token exceptions 2022-06-21 20:29:20 +08:00
wenxu12345
9337d150b9 Handling token exceptions 2022-06-21 20:25:34 +08:00
wenxu12345
910876f323 Handling token exceptions 2022-06-21 20:25:13 +08:00
wenxu12345
af152aa9b9 Handling token exceptions 2022-06-21 20:16:01 +08:00
wenxu12345
f34fedd822 Handling token exceptions 2022-06-21 20:13:19 +08:00
wenxu12345
ac7c0015db Handling token exceptions 2022-06-21 20:00:03 +08:00
wenxu12345
1a3b5d018a Handling token exceptions 2022-06-21 19:57:48 +08:00
wenxu12345
86c26793b7 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-21 19:48:47 +08:00
wenxu12345
d99d7ac63c debug 2022-06-21 19:48:26 +08:00
Gordon
5646db52a9 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-21 19:47:11 +08:00
Gordon
0fe838d588 compose limit memory 2022-06-21 19:46:58 +08:00
wenxu12345
c2686beb9b debug 2022-06-21 19:44:02 +08:00
wenxu12345
1bfae7627e debug 2022-06-21 19:39:46 +08:00
wenxu12345
06c523ea81 debug 2022-06-21 19:38:13 +08:00
wenxu12345
7f4e21d4ba debug 2022-06-21 19:24:09 +08:00
wenxu12345
c993bb2f5e debug 2022-06-21 18:58:57 +08:00
wenxu12345
5527f7c78a debug 2022-06-21 18:49:01 +08:00
wenxu12345
8e9ad57173 debug 2022-06-21 18:36:34 +08:00
wenxu12345
30ae608863 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-21 18:15:38 +08:00
wenxu12345
68e611794b debug 2022-06-21 18:15:22 +08:00
wangchuxiao
b5c20f5be9 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-21 17:37:30 +08:00
wangchuxiao
59a53c7c73 fix bug 2022-06-21 17:37:22 +08:00
wenxu12345
9b76eb6b55 debug 2022-06-21 17:15:24 +08:00
wenxu12345
08d9551230 debug 2022-06-21 16:50:18 +08:00
wenxu12345
c3bdd2f288 debug 2022-06-21 16:36:34 +08:00
wenxu12345
fae881c080 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-21 14:54:58 +08:00
wenxu12345
49797ce6ab super group notification 2022-06-21 14:54:42 +08:00
Gordon
7783e5b7cf jpush add config for ios env mode 2022-06-21 11:28:02 +08:00
Gordon
b242aac7cd jpush add config for ios env mode 2022-06-21 11:27:39 +08:00
skiffer-git
127ad802ff Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-20 18:13:13 +08:00
skiffer-git
f42a2c9434 kickoff 2022-06-20 18:12:02 +08:00
wangchuxiao
b80f510de5 quit superGroup add notification 2022-06-20 11:57:53 +08:00
wangchuxiao
134087c672 v2.1.0 2022-06-17 17:11:59 +08:00
wangchuxiao
91a2406827 Merge branch 'tuoyun'
# Conflicts:
#	internal/api/manage/management_chat.go
2022-06-17 17:08:11 +08:00
wangchuxiao
f82f9567c2 merge super 2 tuoyun 2022-06-17 15:56:19 +08:00
wangchuxiao
0a2951c2eb Merge branch 'superGroup' into tuoyun
# Conflicts:
#	internal/push/logic/push_to_client.go
2022-06-17 15:54:57 +08:00
Gordon
5601212f58 config file update 2022-06-17 15:48:40 +08:00
wangchuxiao
3451d22460 signal 2022-06-17 13:14:38 +08:00
wangchuxiao
0d5dc6bdd8 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-17 13:13:22 +08:00
Gordon
87e6aedb74 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-17 12:39:58 +08:00
Gordon
9b5bd47760 config file update 2022-06-17 12:39:26 +08:00
wangchuxiao
007065b40e 入职流程 2022-06-17 12:36:05 +08:00
wangchuxiao
2e52867df4 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-17 12:10:07 +08:00
wangchuxiao
c5eb8a3f9b 入职流程 2022-06-17 12:09:42 +08:00
skiffer-git
cacde08e99 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-17 11:50:13 +08:00
skiffer-git
9443ed5d49 log for etcd 2022-06-17 11:49:29 +08:00
wangchuxiao
e3c702aca1 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-17 11:09:54 +08:00
wangchuxiao
7fbdff391c fix bug 2022-06-17 11:09:48 +08:00
Gordon
92cb2e7eab config file update 2022-06-17 10:59:50 +08:00
Gordon
04136d5b9d Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-17 10:50:24 +08:00
Gordon
fd256a6c28 config file update 2022-06-17 10:50:15 +08:00
wangchuxiao
e64b8841c5 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-17 10:45:00 +08:00
wangchuxiao
52ae2c3655 fix bug 2022-06-17 10:44:23 +08:00
skiffer-git
f1b5f56294 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-17 10:43:44 +08:00
skiffer-git
ed3b62480c log for etcd 2022-06-17 10:43:24 +08:00
Gordon
365d282119 compose file update 2022-06-17 10:39:02 +08:00
Gordon
56d0c574f9 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-17 10:37:54 +08:00
Gordon
573937e1e5 msg transfer handle change 2022-06-17 10:37:43 +08:00
wangchuxiao
3892883470 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-17 10:37:03 +08:00
wangchuxiao
d1049b8022 fix bug 2022-06-17 10:36:46 +08:00
Gordon
8e3f090ffe msg transfer handle change 2022-06-16 21:15:24 +08:00
Gordon
903c39206f msg transfer handle change 2022-06-16 20:35:27 +08:00
Gordon
29dbb36961 user proto modify 2022-06-16 19:33:35 +08:00
wangchuxiao
20851f2a96 fix bug 2022-06-16 19:26:09 +08:00
wangchuxiao
7bbf2b200b fix bug 2022-06-16 19:18:17 +08:00
Gordon
e9ac9faa49 user proto modify 2022-06-16 19:12:50 +08:00
wangchuxiao
a15e644a51 fix bug 2022-06-16 19:09:13 +08:00
Gordon
479679a1c6 user proto modify 2022-06-16 19:02:08 +08:00
Gordon
a50001364f user proto modify 2022-06-16 18:59:17 +08:00
wangchuxiao
7ea7dffd4a fix bug 2022-06-16 17:57:44 +08:00
wangchuxiao
5ea620a4cd fix bug 2022-06-16 16:49:21 +08:00
wangchuxiao
4e11c7a9e2 fix bug 2022-06-16 16:44:12 +08:00
wangchuxiao
9503766a68 fix bug 2022-06-16 16:20:50 +08:00
skiffer-git
6b29d54b50 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 16:13:09 +08:00
skiffer-git
19bbd9b528 fix bug 2022-06-16 16:12:41 +08:00
Gordon
28721c7d20 add global recv opt 2022-06-16 15:34:58 +08:00
Gordon
7dbf0a3594 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 15:29:57 +08:00
Gordon
e2f7dd67a2 add global recv opt 2022-06-16 15:29:48 +08:00
skiffer-git
3f455199eb Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 15:22:14 +08:00
skiffer-git
24f2ffe82d Handling exception: getcdv3.GetConn == nil 2022-06-16 15:21:53 +08:00
wangchuxiao
86c5d694e5 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 15:21:52 +08:00
wangchuxiao
8c963c669b redis interface 2022-06-16 15:21:46 +08:00
skiffer-git
d058cacb38 Handling exception: getcdv3.GetConn == nil 2022-06-16 15:19:39 +08:00
skiffer-git
c3cb5f20d9 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 15:10:37 +08:00
skiffer-git
abb9ebaf76 Handling exception: getcdv3.GetConn == nil 2022-06-16 15:10:15 +08:00
skiffer-git
167ebd6975 Handling exception: getcdv3.GetConn == nil 2022-06-16 15:09:37 +08:00
Gordon
66d248ec8e Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 15:02:38 +08:00
Gordon
966cb24911 add global recv opt 2022-06-16 15:02:29 +08:00
skiffer-git
98821c95b6 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:55:38 +08:00
skiffer-git
ceaa0b61eb Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 14:51:58 +08:00
skiffer-git
89aef130a5 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:51:36 +08:00
Gordon
57d96b85f1 add global recv opt 2022-06-16 14:47:39 +08:00
wangchuxiao
dd4817a65a Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 14:45:53 +08:00
wangchuxiao
b3dcff2d76 redis interface 2022-06-16 14:45:39 +08:00
skiffer-git
8d3d41831d Handling exception: getcdv3.GetConn == nil 2022-06-16 14:39:31 +08:00
skiffer-git
066a7041d8 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:36:59 +08:00
skiffer-git
50df9bdf4e Handling exception: getcdv3.GetConn == nil 2022-06-16 14:35:24 +08:00
skiffer-git
eab9e4ab92 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:33:52 +08:00
skiffer-git
56cf46a3a4 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:31:41 +08:00
skiffer-git
90442e3e39 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:27:57 +08:00
skiffer-git
02c594d4ec Handling exception: getcdv3.GetConn == nil 2022-06-16 14:26:03 +08:00
skiffer-git
8c82f811cb Merge remote-tracking branch 'origin/superGroup' into superGroup
# Conflicts:
#	internal/rpc/user/user.go
2022-06-16 14:10:56 +08:00
skiffer-git
dbc2713495 Handling exception: getcdv3.GetConn == nil 2022-06-16 14:09:28 +08:00
wangchuxiao
89ac29a019 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 13:41:33 +08:00
wangchuxiao
96d3ae86cc Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 13:41:18 +08:00
Gordon
071a7fa629 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 12:58:19 +08:00
Gordon
0a44a8e78a add global recv opt 2022-06-16 12:53:39 +08:00
wangchuxiao
59743ef071 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 12:48:07 +08:00
wangchuxiao
077482d759 Merge branch 'tuoyun' into superGroup
# Conflicts:
#	internal/push/logic/push_to_client.go
2022-06-16 12:47:06 +08:00
Gordon
7e6e214f08 add global recv opt 2022-06-16 12:41:31 +08:00
wangchuxiao
b6634d26d1 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 12:36:00 +08:00
Gordon
5e51eebe8a msg handle 2022-06-16 12:21:49 +08:00
skiffer-git
310997f978 update chat.pb 2022-06-16 12:04:57 +08:00
wangchuxiao
b67643ed95 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup
# Conflicts:
#	go.sum
2022-06-16 11:58:18 +08:00
wangchuxiao
1b1f4464ee GlobalRecvMsgOpt 2022-06-16 11:53:43 +08:00
skiffer-git
1111cf48f3 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 11:46:25 +08:00
skiffer-git
41833712f0 has read default->true 2022-06-16 11:45:52 +08:00
wangchuxiao
f9a26e9195 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-16 11:35:22 +08:00
wangchuxiao
ea76f20825 GlobalRecvMsgOpt 2022-06-16 11:27:55 +08:00
skiffer-git
1a6a0d3592 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-16 10:27:02 +08:00
skiffer-git
0d2c0e91c8 use sarama v1.29.0 2022-06-16 10:26:37 +08:00
wangchuxiao
bc2a7b902e k8s 2022-06-16 00:19:41 +08:00
Gordon
2e7e278ba4 redis restore 2022-06-15 23:30:33 +08:00
skiffer-git
06915f5dc3 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-15 19:55:06 +08:00
skiffer-git
7cbd840060 Optimization for log 2022-06-15 19:51:16 +08:00
Gordon
cc8301cc6e redis replace to go_redis 2022-06-15 19:28:15 +08:00
skiffer-git
a9603f44f4 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-15 19:26:05 +08:00
skiffer-git
04ee5269fe Optimization for log 2022-06-15 19:25:47 +08:00
Gordon
afa93aaf9e Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-15 19:20:33 +08:00
Gordon
d74bea25aa redis replace to go_redis 2022-06-15 19:17:49 +08:00
skiffer-git
1af78c9bcb Optimization for log 2022-06-15 18:15:00 +08:00
skiffer-git
9f7cc1ae69 Optimization for log 2022-06-15 18:11:15 +08:00
skiffer-git
f4f6ea681e Optimization for log 2022-06-15 18:02:48 +08:00
wangchuxiao
21051900f9 hash userID 2022-06-15 17:33:48 +08:00
Gordon
f96e12a8b3 redis replace to go_redis 2022-06-15 16:50:45 +08:00
Gordon
eef47017a3 redis replace to go_redis 2022-06-15 16:39:03 +08:00
Gordon
4315d9dfbb redis replace to go_redis 2022-06-15 16:35:24 +08:00
Gordon
d7961bf226 redis replace to go_redis 2022-06-15 16:33:30 +08:00
wangchuxiao
7dbc8a4253 go-redis 2022-06-15 16:18:41 +08:00
wangchuxiao
1aee41e7e7 go-redis 2022-06-15 16:16:35 +08:00
wangchuxiao
f4cdbe985e alter rtc timeout 2022-06-15 14:57:21 +08:00
wangchuxiao
8a0c112072 alter rtc timeout 2022-06-15 13:55:37 +08:00
wangchuxiao
16641f0494 alter rtc timeout 2022-06-15 13:44:45 +08:00
wangchuxiao
5965dcd029 alter rtc timeout 2022-06-15 13:39:49 +08:00
wangchuxiao
e45ef5c49a alter rtc timeout 2022-06-15 13:30:58 +08:00
wangchuxiao
9a1682ebaf Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-15 13:24:35 +08:00
wangchuxiao
9eed6ce197 alter rtc timeout 2022-06-15 13:24:21 +08:00
Gordon
d3279694b7 add global msg recv opt 2022-06-15 13:12:16 +08:00
Gordon
8fe6231ebc add global msg recv opt 2022-06-15 13:11:08 +08:00
Gordon
6f0860d954 add global msg recv opt 2022-06-15 12:57:40 +08:00
Gordon
1e62ddce73 super update 2022-06-15 11:31:24 +08:00
wangchuxiao
956d745034 alter rtc timeout 2022-06-15 11:13:10 +08:00
Gordon
ccc69ac2d0 Merge remote-tracking branch 'origin/superGroup' into superGroup
# Conflicts:
#	pkg/proto/sdk_ws/ws.pb.go
2022-06-15 11:08:52 +08:00
wangchuxiao
68365aa3b7 alter rtc timeout 2022-06-15 10:34:32 +08:00
wangchuxiao
a0581618a4 Merge branch 'tuoyun' into superGroup
# Conflicts:
#	config/config.yaml
#	internal/msg_gateway/gate/logic.go
#	internal/msg_gateway/gate/ws_server.go
#	internal/push/logic/push_to_client.go
#	internal/rpc/group/group.go
#	internal/rpc/msg/send_msg.go
#	pkg/common/config/config.go
#	pkg/proto/sdk_ws/ws.pb.go
2022-06-15 10:31:58 +08:00
Gordon
cfcccd0240 user add global set message recv opt 2022-06-14 18:20:08 +08:00
Gordon
926de3fa94 log 2022-06-14 17:27:04 +08:00
Gordon
38ded2c43d send message remove online status split 2022-06-14 17:24:40 +08:00
wangchuxiao
f324bb603d rtc 2022-06-14 16:05:45 +08:00
wangchuxiao
d190616d34 rtc 2022-06-14 16:03:20 +08:00
wangchuxiao
d7884f89f5 rtc 2022-06-14 15:56:06 +08:00
Gordon
d8ce122254 redis model update 2022-06-14 15:47:34 +08:00
wangchuxiao
9c1ca78fed rtc 2022-06-14 15:27:11 +08:00
wangchuxiao
31c123a09b rtc 2022-06-14 15:25:18 +08:00
wangchuxiao
0e93295cdf rtc 2022-06-14 15:24:40 +08:00
wangchuxiao
5e7eda6781 rtc 2022-06-14 15:03:05 +08:00
wangchuxiao
f31179bb9a rtc 2022-06-14 13:21:30 +08:00
wangchuxiao
805b7705b2 rtc 2022-06-14 10:52:23 +08:00
wangchuxiao
ae649a0e31 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-06-14 10:42:56 +08:00
wangchuxiao
d797d7b47a rtc 2022-06-14 10:41:52 +08:00
skiffer-git
7308d0f9c6 config 2022-06-14 10:37:39 +08:00
skiffer-git
2ab1f3749c Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-13 21:08:53 +08:00
skiffer-git
52199fb5d3 config 2022-06-13 21:08:25 +08:00
wangchuxiao
ad497b7386 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-06-13 20:11:59 +08:00
wangchuxiao
257e98edb2 group 2022-06-13 20:11:43 +08:00
skiffer-git
5be23220e4 super group 2022-06-13 18:27:52 +08:00
skiffer-git
25310d5e88 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-13 17:20:13 +08:00
skiffer-git
4bc9da3910 set groupID 2022-06-13 17:19:48 +08:00
wangchuxiao
6dfba3c7b8 group 2022-06-13 16:25:03 +08:00
Gordon
034201a45b redis model update 2022-06-13 16:09:34 +08:00
Gordon
d43b9fc6c1 redis model update 2022-06-13 15:58:14 +08:00
wangchuxiao
94ec584dc3 signal 2022-06-13 15:42:48 +08:00
Gordon
043188ab5e push update 2022-06-13 15:24:13 +08:00
Gordon
2cbffb96fd push update 2022-06-13 15:20:23 +08:00
Gordon
50f7057f68 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-13 15:19:15 +08:00
Gordon
f3b083cafd push update 2022-06-13 15:19:04 +08:00
wangchuxiao
d881ab5fea signal 2022-06-13 15:04:36 +08:00
skiffer-git
464200e693 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-13 14:59:06 +08:00
skiffer-git
9ae84a69be SuperGroupOnlineBatchPushOneMsg 2022-06-13 14:56:24 +08:00
wangchuxiao
47184ca01e org 2022-06-13 14:27:41 +08:00
wangchuxiao
39d4d01814 org 2022-06-13 13:01:49 +08:00
wangchuxiao
5419478c48 org 2022-06-13 12:23:13 +08:00
wangchuxiao
52d8ab5389 singal 2022-06-13 11:53:12 +08:00
wangchuxiao
7d6701780c Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-13 10:38:15 +08:00
wangchuxiao
dbc055efb4 org 2022-06-13 10:38:00 +08:00
skiffer-git
f9c2b4c28e SuperGroupOnlineBatchPushOneMsg 2022-06-13 09:00:09 +08:00
Gordon
7c90baf7bf remove online offline split 2022-06-12 18:27:01 +08:00
skiffer-git
67807a3aa7 remove kick 2022-06-11 20:47:25 +08:00
skiffer-git
dca39d6eae set time out 2022-06-11 20:41:23 +08:00
skiffer-git
768d139789 set time out 2022-06-11 20:40:13 +08:00
skiffer-git
af612e4b92 log 2022-06-11 13:25:32 +08:00
skiffer-git
ef23fba147 log 2022-06-11 12:50:20 +08:00
skiffer-git
5f813c6f70 fix bug 2022-06-11 12:43:54 +08:00
skiffer-git
c171728749 fix bug 2022-06-11 12:16:32 +08:00
skiffer-git
85c0e1f330 debug log 2022-06-11 12:09:50 +08:00
skiffer-git
8269e61163 debug log 2022-06-11 12:03:12 +08:00
skiffer-git
ae6c09aae2 debug log 2022-06-11 11:53:04 +08:00
skiffer-git
9619584de5 debug 2022-06-11 11:27:58 +08:00
skiffer-git
dad40d60b3 debug 2022-06-11 10:54:17 +08:00
skiffer-git
9216a085cf log 2022-06-11 10:42:26 +08:00
skiffer-git
f232ffb5cc batch build 2022-06-11 09:50:24 +08:00
skiffer-git
952033f409 compile 2022-06-11 09:26:49 +08:00
skiffer-git
dc10c7e3e7 batch push 2022-06-11 09:23:51 +08:00
skiffer-git
a84c8bd273 SetWriteTimeoutWriteMsg 2022-06-11 09:19:06 +08:00
skiffer-git
2d3d351e26 log 2022-06-11 08:26:32 +08:00
skiffer-git
e375188889 log 2022-06-11 08:24:02 +08:00
skiffer-git
5860f1fa7a add send msg timeout 2022-06-10 22:59:45 +08:00
skiffer-git
6a149c74d1 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-10 22:54:43 +08:00
skiffer-git
6ae71dba4f add send msg timeout 2022-06-10 22:54:15 +08:00
skiffer-git
659cc7f1c6 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-10 21:43:20 +08:00
skiffer-git
a6a80a8b93 batch build 2022-06-10 21:37:48 +08:00
skiffer-git
722ada3f0e batch build 2022-06-10 18:55:21 +08:00
wangchuxiao
aeb479641f Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-10 18:39:12 +08:00
wangchuxiao
8a471a5455 base64 userID 2022-06-10 18:38:55 +08:00
skiffer-git
c8207b479e Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-10 18:24:40 +08:00
wangchuxiao
fdaf4380fa base64 userID 2022-06-10 18:23:31 +08:00
skiffer-git
89d228e605 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-10 18:22:01 +08:00
skiffer-git
556ed8413f batch build 2022-06-10 18:21:09 +08:00
wangchuxiao
e95f09191a Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-10 18:13:25 +08:00
wangchuxiao
fa02c20e1c fix signal 2022-06-10 18:13:11 +08:00
skiffer-git
f51a074f86 batch build 2022-06-10 18:11:46 +08:00
skiffer-git
915539ca0f batch build 2022-06-10 18:10:11 +08:00
skiffer-git
26353fd28f batch build 2022-06-10 18:08:33 +08:00
skiffer-git
0aa19ed1b0 batch build 2022-06-10 18:07:49 +08:00
skiffer-git
843a9cedaf batch build 2022-06-10 18:05:36 +08:00
skiffer-git
c9b25f73d3 batch build 2022-06-10 18:00:04 +08:00
skiffer-git
df7d2b54bd batch build 2022-06-10 17:53:34 +08:00
skiffer-git
5cb907b0f1 batch build 2022-06-10 17:49:00 +08:00
skiffer-git
832f9c042d batch build 2022-06-10 17:42:45 +08:00
skiffer-git
eaa416c394 batch build 2022-06-10 17:39:58 +08:00
skiffer-git
16645bc568 batch build 2022-06-10 17:37:31 +08:00
wangchuxiao
25f9e28230 fix signal 2022-06-10 17:33:36 +08:00
wangchuxiao
1687b70bde fix signal 2022-06-10 17:31:30 +08:00
skiffer-git
d49ceef637 log 2022-06-10 15:55:07 +08:00
skiffer-git
da573ac573 log 2022-06-10 15:37:24 +08:00
skiffer-git
743eaab9f6 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-10 13:33:14 +08:00
skiffer-git
202811f3c6 groupID digitization 2022-06-10 13:32:40 +08:00
wangchuxiao
6250603440 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-10 12:22:24 +08:00
wangchuxiao
650c7a3ae0 fix json word 2022-06-10 12:17:44 +08:00
Gordon
42d75decb0 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-10 11:10:30 +08:00
Gordon
55f6aa9ff8 add batch push 2022-06-10 11:08:18 +08:00
skiffer-git
0e77caa329 batch push 2022-06-10 10:48:03 +08:00
wangchuxiao
da0e73fe11 fix json word 2022-06-10 10:24:47 +08:00
wangchuxiao
fc5ab3572e fix word 2022-06-10 10:16:18 +08:00
wangchuxiao
891738747a fix word 2022-06-09 19:36:51 +08:00
wangchuxiao
1c52e731e1 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-09 19:35:09 +08:00
wangchuxiao
ee615fbadf fix word 2022-06-09 19:34:52 +08:00
Gordon
2ede9ef8ed add batch push 2022-06-09 18:24:32 +08:00
wangchuxiao
dbcfcafdfc fix word 2022-06-09 18:16:23 +08:00
Gordon
7d63c82ddd Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-09 18:08:52 +08:00
Gordon
1d4dc81e55 add batch push 2022-06-09 18:08:42 +08:00
wangchuxiao
ceca0f095b demo 2022-06-09 17:24:30 +08:00
wangchuxiao
793996e047 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-09 17:19:56 +08:00
wangchuxiao
ab76d46007 demo 2022-06-09 17:19:39 +08:00
skiffer-git
ed1e22bac5 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-09 17:04:52 +08:00
skiffer-git
e57ce28d2b batch push 2022-06-09 17:04:16 +08:00
wangchuxiao
2b596e226a Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-06-09 15:44:31 +08:00
wangchuxiao
c46f574aa8 fix bug 2022-06-09 15:40:53 +08:00
wangchuxiao
9b4890a99f fix bug 2022-06-09 15:33:37 +08:00
wangchuxiao
3f129513bb fix bug 2022-06-09 15:33:28 +08:00
wangchuxiao
698490b936 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-09 15:25:27 +08:00
wangchuxiao
c8bf95578c fix bug 2022-06-09 15:25:02 +08:00
skiffer-git
064132833c Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-09 15:21:05 +08:00
skiffer-git
60f8f93a02 batch push 2022-06-09 15:20:40 +08:00
wangchuxiao
7b08d98647 fix bug 2022-06-09 14:58:43 +08:00
skiffer-git
11e619d1b3 log 2022-06-09 14:26:18 +08:00
skiffer-git
4f184a6723 batch push 2022-06-09 14:24:24 +08:00
skiffer-git
5fd91e808a batch push 2022-06-09 14:07:09 +08:00
skiffer-git
0dfa224aeb config for msg read receipt 2022-06-09 14:00:18 +08:00
skiffer-git
32565dd188 config for msg read receipt 2022-06-09 13:57:10 +08:00
skiffer-git
96f09c45f5 batch push 2022-06-09 13:12:46 +08:00
skiffer-git
d2474c8a72 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-09 12:49:54 +08:00
skiffer-git
9eb0dd5e70 batch push 2022-06-09 12:49:16 +08:00
wangchuxiao
bbdcb34ab6 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-09 12:39:42 +08:00
wangchuxiao
6525d63459 fix bug 2022-06-09 12:39:28 +08:00
skiffer-git
0babf89aa5 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-08 20:26:41 +08:00
skiffer-git
317e6f81bb batch push 2022-06-08 20:26:08 +08:00
wangchuxiao
ae684d6d39 fix bug 2022-06-08 19:39:36 +08:00
wangchuxiao
d9710ac244 fix bug 2022-06-08 19:27:04 +08:00
wangchuxiao
dff7a28094 fix bug 2022-06-08 19:14:25 +08:00
wangchuxiao
da18950b3d fix bug 2022-06-08 19:06:22 +08:00
wangchuxiao
6055ce9b6b fix bug 2022-06-08 18:44:21 +08:00
wangchuxiao
bd14739a9e fix bug 2022-06-08 18:40:07 +08:00
wangchuxiao
843cbe4f80 organization 2022-06-08 18:24:20 +08:00
wangchuxiao
f650e73d5c fix bug 2022-06-08 17:36:24 +08:00
Gordon
d1293dd047 log 2022-06-08 17:34:39 +08:00
Gordon
715e8a5000 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-08 17:24:31 +08:00
Gordon
a7a69008d8 log 2022-06-08 17:24:22 +08:00
skiffer-git
553b56d094 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-08 17:21:11 +08:00
skiffer-git
fec57c4ed7 log 2022-06-08 17:20:39 +08:00
Gordon
b46f106a91 log 2022-06-08 17:19:37 +08:00
Gordon
0214419446 log 2022-06-08 17:17:55 +08:00
Gordon
d587d14f86 log 2022-06-08 17:11:17 +08:00
wangchuxiao
a115151616 fix bug 2022-06-08 17:08:47 +08:00
wangchuxiao
26771ee7d0 organization 2022-06-08 17:07:16 +08:00
Gordon
731263638b log 2022-06-08 16:53:58 +08:00
wangchuxiao
a4f69351ce fix bug 2022-06-08 16:46:21 +08:00
wangchuxiao
fa5f234a38 fix bug 2022-06-08 15:40:33 +08:00
wangchuxiao
5d2c981368 fix bug 2022-06-08 15:27:50 +08:00
wangchuxiao
4a55842724 fix bug 2022-06-08 15:26:31 +08:00
wangchuxiao
e9655ed05e fix bug 2022-06-08 15:15:56 +08:00
wangchuxiao
ed7d2bbdd7 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-08 15:07:19 +08:00
wangchuxiao
276328e0fd fix bug 2022-06-08 15:05:57 +08:00
Gordon
1bcd091330 Merge remote-tracking branch 'origin/superGroup' into superGroup
# Conflicts:
#	pkg/proto/sdk_ws/ws.pb.go
2022-06-08 11:43:11 +08:00
Gordon
536d7e2957 ws pb 2022-06-08 11:42:39 +08:00
Gordon
55e774344a ws pb 2022-06-08 10:32:21 +08:00
Gordon
7d0c8b0c5f super group add notification 2022-06-07 19:02:19 +08:00
Gordon
88c4cff50c Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 18:45:09 +08:00
Gordon
cfe01bb820 super group push 2022-06-07 18:45:00 +08:00
wangchuxiao
4f1bd4e509 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-07 18:40:41 +08:00
Gordon
88544a89b7 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 18:39:52 +08:00
Gordon
a87e41eecd super group push 2022-06-07 18:39:43 +08:00
wangchuxiao
e52639d1d4 fix bug 2022-06-07 18:36:06 +08:00
skiffer-git
0463f5e83d fix bug 2022-06-07 18:25:08 +08:00
skiffer-git
eb90314b38 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 18:10:02 +08:00
skiffer-git
6ce1d60ebb log 2022-06-07 18:09:11 +08:00
wangchuxiao
5fa62c9fbd Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-06-07 17:46:53 +08:00
Gordon
ef93a1f42e add conversation sync 2022-06-07 17:45:07 +08:00
wangchuxiao
5f42748e1b Merge branch 'tuoyun' into superGroup
# Conflicts:
#	internal/msg_gateway/gate/callback.go
#	internal/msg_transfer/logic/online_history_msg_handler.go
#	internal/push/logic/callback.go
#	internal/push/logic/push_to_client.go
#	pkg/common/db/model.go
#	pkg/common/db/newRedisModel.go
#	pkg/proto/group/group.pb.go
#	pkg/proto/group/group.proto
2022-06-07 17:42:24 +08:00
wangchuxiao
269df23851 set group memberInfo 2022-06-07 17:06:47 +08:00
wangchuxiao
c40dc64bd0 set group memberInfo 2022-06-07 16:59:05 +08:00
skiffer-git
2b150e3c1c KickUserOffline 2022-06-07 16:38:42 +08:00
skiffer-git
f7c17ac7e7 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 16:29:31 +08:00
skiffer-git
3f2638efaf KickUserOffline 2022-06-07 16:28:51 +08:00
Gordon
f106664952 kick 2022-06-07 16:27:11 +08:00
skiffer-git
afe8dcc1ff Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 16:19:15 +08:00
wangchuxiao
8f1e439381 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-06-07 16:18:32 +08:00
skiffer-git
4418d031e1 log 2022-06-07 16:18:23 +08:00
wangchuxiao
f3fc452904 group set memberInfo 2022-06-07 16:18:18 +08:00
Gordon
89f40fe3de kick 2022-06-07 16:17:08 +08:00
Gordon
f8962beca6 kick 2022-06-07 16:05:59 +08:00
skiffer-git
dae1569f0e debug userid == "" 2022-06-07 14:02:11 +08:00
skiffer-git
dd76c268c5 debug userid == "" 2022-06-07 13:50:35 +08:00
skiffer-git
52c52f23d3 Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts:
#	internal/msg_transfer/logic/online_history_msg_handler.go
2022-06-07 13:47:11 +08:00
skiffer-git
3adcb9f164 debug userid == "" 2022-06-07 13:44:52 +08:00
Gordon
0f1a061afe Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-07 12:28:48 +08:00
Gordon
95705cc95a log 2022-06-07 12:28:36 +08:00
wangchuxiao
07b652c1d4 singal offline push 2022-06-07 12:08:53 +08:00
skiffer-git
eac137a9a9 ForceLogout 2022-06-07 11:50:37 +08:00
Gordon
6ec65965a4 log 2022-06-07 11:50:05 +08:00
skiffer-git
290ae774e0 ForceLogout 2022-06-07 11:42:15 +08:00
Gordon
31e12f682d Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-06-07 11:24:37 +08:00
Gordon
ae52f85502 log 2022-06-07 11:24:27 +08:00
skiffer-git
fcda79eb3c fix bug: v.MsgData == nil 2022-06-07 11:10:49 +08:00
skiffer-git
385f371c06 fix bug: v.MsgData == nil 2022-06-07 10:52:52 +08:00
skiffer-git
6efb1a6705 fix bug: v.MsgData == nil 2022-06-07 10:40:19 +08:00
Gordon
4695ef3208 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 10:38:10 +08:00
Gordon
34e8b79e7e pb file 2022-06-07 10:38:01 +08:00
skiffer-git
3639f943bf group administrator access 2022-06-07 10:20:56 +08:00
skiffer-git
d373369649 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-07 10:14:21 +08:00
skiffer-git
9106e70b37 group administrator access 2022-06-07 10:13:19 +08:00
Gordon
4678189ed4 pb file 2022-06-07 10:12:15 +08:00
Gordon
78298e1284 pb file 2022-06-07 10:11:49 +08:00
wangchuxiao
34c091f232 signal 2022-06-06 23:27:16 +08:00
skiffer-git
064b650fac group administrator access 2022-06-06 23:19:07 +08:00
wangchuxiao
f8b4cbcc13 singal offline push 2022-06-06 21:04:11 +08:00
Gordon
2f9c8dbb33 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-06 20:55:02 +08:00
Gordon
8bd5db431b add function 2022-06-06 20:54:53 +08:00
skiffer-git
5754510d7a Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-06-06 20:42:41 +08:00
skiffer-git
797e2fea1e group info set 2022-06-06 20:39:45 +08:00
wangchuxiao
538656fcc7 singal offline push 2022-06-06 19:58:31 +08:00
wangchuxiao
0f66fa528d singal offline push 2022-06-06 19:48:59 +08:00
wangchuxiao
1a42f6dded singal offline push 2022-06-06 19:36:25 +08:00
wangchuxiao
4efdd342d6 singal offline push 2022-06-06 19:20:12 +08:00
wangchuxiao
f15684a562 singal offline push 2022-06-06 19:02:35 +08:00
wangchuxiao
78dfba8771 singal offline push 2022-06-06 18:52:17 +08:00
wangchuxiao
e428e186f0 singal offline push 2022-06-06 18:23:08 +08:00
wangchuxiao
ebf07eddfb singal offline push 2022-06-06 18:18:30 +08:00
wangchuxiao
d3abc44976 singal offline push 2022-06-06 18:15:32 +08:00
wangchuxiao
dc7c10014d singal offline push 2022-06-06 10:45:04 +08:00
wangchuxiao
5e2e8f91c7 singal offline push 2022-06-06 10:42:23 +08:00
wangchuxiao
e5a314bb3a singal offline push 2022-06-06 10:29:21 +08:00
wangchuxiao
9d3882d5b9 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-06-06 10:23:01 +08:00
wangchuxiao
a647007a0f singal offline push 2022-06-06 10:22:42 +08:00
wangchuxiao
e04a4908cf k8s 2022-06-05 23:42:27 +08:00
wangchuxiao
cfe0272022 singal offline push 2022-06-02 20:53:50 +08:00
wangchuxiao
2e3b55d9e8 singal offline push 2022-06-02 20:19:24 +08:00
wangchuxiao
6b8ebe11de singal offline push 2022-06-02 20:17:12 +08:00
wangchuxiao
1fffd36054 singal offline push 2022-06-02 20:06:14 +08:00
wangchuxiao
2b25fea86c singal offline push 2022-06-02 19:52:29 +08:00
wangchuxiao
409a8311b1 singal offline push 2022-06-02 19:14:11 +08:00
wangchuxiao
6996c008d0 singal offline push 2022-06-02 18:36:42 +08:00
wangchuxiao
64fa52452c singal offline push 2022-06-02 18:19:20 +08:00
wangchuxiao
16d33b1c1f singal offline push 2022-06-02 18:17:11 +08:00
Gordon
0a260a67d5 ws and push update 2022-06-02 17:37:00 +08:00
Gordon
1aacd3cb23 ws and push update 2022-06-02 16:51:31 +08:00
Gordon
5af3ba9db6 ws and push update 2022-06-02 16:48:56 +08:00
Gordon
14bfd78f63 ws and push update 2022-06-02 16:47:48 +08:00
Gordon
febc672e6e ws and push update 2022-06-02 16:45:48 +08:00
Gordon
a18dcfce9e ws and push update 2022-06-02 16:44:55 +08:00
Gordon
48410c428a redis update 2022-06-02 14:28:00 +08:00
wenxu12345
da1df91f49 Clear msg 2022-06-01 15:54:40 +08:00
wenxu12345
b2df6e6d41 Clear msg 2022-06-01 15:53:14 +08:00
wenxu12345
8315c61240 Clear msg 2022-06-01 15:25:22 +08:00
wenxu12345
1ff7ebb04a tools 2022-06-01 15:09:20 +08:00
wenxu12345
ab914f4621 tools 2022-06-01 11:18:28 +08:00
skiffer-git
51ef00e0f2 Update README.md 2022-06-01 08:20:21 +08:00
wenxu12345
2b4df5be16 Clear personal chat history 2022-05-31 19:16:29 +08:00
wangchuxiao
f98da25fda organization 2022-05-31 19:14:00 +08:00
Gordon
4c305b7cc0 redis replace go redis 2022-05-31 15:18:54 +08:00
Gordon
5c979a532f redis replace go redis 2022-05-31 15:13:59 +08:00
Gordon
fcf2427878 redis replace go redis 2022-05-31 14:51:37 +08:00
Gordon
31e923fc67 redis replace go redis 2022-05-31 14:51:25 +08:00
Gordon
1c2ebb8c5d redis replace go redis 2022-05-31 14:37:47 +08:00
wangchuxiao
29e75a4851 organization 2022-05-31 14:30:14 +08:00
Gordon
3765661a4e redis replace go redis 2022-05-31 14:29:16 +08:00
Gordon
628984c09d redis replace go redis 2022-05-31 14:25:52 +08:00
Gordon
a630653d88 redis replace go redis 2022-05-31 14:22:42 +08:00
Gordon
e693b908be redis replace go redis 2022-05-31 13:41:06 +08:00
Gordon
f36b2433a0 redis replace go redis 2022-05-31 13:24:18 +08:00
Gordon
47af0d0356 redis replace go redis 2022-05-31 13:20:51 +08:00
Gordon
d4c587c668 redis replace go redis 2022-05-31 13:09:33 +08:00
Gordon
dda453975b redis replace go redis 2022-05-31 12:32:26 +08:00
Gordon
c28801ff27 redis replace go redis 2022-05-31 12:20:40 +08:00
Gordon
4e609ebc33 redis replace go redis 2022-05-31 12:14:40 +08:00
Gordon
1257e96d5e redis replace go redis 2022-05-31 12:13:12 +08:00
Gordon
122a3ab4ce redis replace go redis 2022-05-31 12:10:24 +08:00
Gordon
136cb43cd1 redis replace go redis 2022-05-31 12:07:06 +08:00
Gordon
ad8086d2b6 redis replace go redis 2022-05-31 11:57:22 +08:00
Gordon
d00641a73c redis replace go redis 2022-05-31 11:47:35 +08:00
wangchuxiao
197be51047 k8s 2022-05-30 21:19:05 +08:00
wangchuxiao
53c40a87b2 k8s 2022-05-30 21:17:57 +08:00
wangchuxiao
b304c13034 k8s 2022-05-30 21:15:59 +08:00
wangchuxiao
cb895d17ff k8s 2022-05-30 21:12:53 +08:00
wangchuxiao
f0dd3aada3 k8s 2022-05-30 21:10:24 +08:00
wangchuxiao
2d055c8d8d k8s 2022-05-30 21:03:29 +08:00
wangchuxiao
aad4482a78 k8s 2022-05-30 21:02:42 +08:00
wangchuxiao
d71536ab86 k8s 2022-05-30 21:01:35 +08:00
wangchuxiao
fe25d52082 k8s 2022-05-30 20:56:32 +08:00
wangchuxiao
0441662e0c k8s 2022-05-30 20:53:54 +08:00
wangchuxiao
0f40bc4cce k8s 2022-05-30 20:52:39 +08:00
wangchuxiao
13e9c20be0 k8s 2022-05-30 20:50:32 +08:00
wangchuxiao
17bab31b18 k8s 2022-05-30 20:49:51 +08:00
wangchuxiao
26f11fabb7 k8s 2022-05-30 20:47:49 +08:00
wangchuxiao
b892749c75 k8s 2022-05-30 20:46:53 +08:00
wangchuxiao
810b08c50d k8s 2022-05-30 20:43:19 +08:00
wangchuxiao
fc71a757dd k8s 2022-05-30 20:29:22 +08:00
wangchuxiao
6c324414b1 k8s 2022-05-30 20:26:11 +08:00
wangchuxiao
d7283b92ac k8s 2022-05-30 20:19:56 +08:00
wangchuxiao
d67fdbc24e k8s 2022-05-30 20:17:10 +08:00
wangchuxiao
1edaf15220 k8s 2022-05-30 20:15:17 +08:00
wangchuxiao
38bd2bd011 k8s 2022-05-30 20:10:01 +08:00
wangchuxiao
da4ac6d709 k8s 2022-05-30 20:07:01 +08:00
wangchuxiao
9e16629d69 k8s 2022-05-30 19:41:28 +08:00
Gordon
0aefab34f1 log 2022-05-30 19:37:54 +08:00
wangchuxiao
05b4ddfd46 k8s 2022-05-30 19:37:32 +08:00
Gordon
74f2d6bea6 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 19:31:19 +08:00
Gordon
5392c9fd38 log 2022-05-30 19:31:09 +08:00
wenxu12345
cd8e12c747 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 18:24:18 +08:00
wenxu12345
591b292fbf super group 2022-05-30 18:23:12 +08:00
Gordon
3610525c88 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 17:46:27 +08:00
Gordon
1db3ecca22 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 17:46:15 +08:00
wangchuxiao
0168ef4014 superGroup 2022-05-30 17:46:11 +08:00
Gordon
25450a4182 message update 2022-05-30 17:46:06 +08:00
wangchuxiao
8cc6b048fd superGroup 2022-05-30 17:39:52 +08:00
wangchuxiao
cf094a2048 superGroup 2022-05-30 17:30:55 +08:00
wangchuxiao
10881c8f5b superGroup 2022-05-30 17:12:08 +08:00
wangchuxiao
23c6c8b331 superGroup 2022-05-30 16:29:37 +08:00
wangchuxiao
cf8a437361 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-05-30 16:23:34 +08:00
wangchuxiao
653c0faa18 superGroup 2022-05-30 16:23:15 +08:00
wenxu12345
b108e5bf45 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 15:50:45 +08:00
wenxu12345
5e5597ef19 super group 2022-05-30 15:49:35 +08:00
wangchuxiao
edb5cb4ee5 superGroup 2022-05-30 15:45:19 +08:00
wangchuxiao
3b81108738 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-05-30 15:27:43 +08:00
wangchuxiao
110f5e02f4 superGroup 2022-05-30 15:27:23 +08:00
Gordon
a4a7ce51ad Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 15:16:13 +08:00
Gordon
08a7dbe319 message update 2022-05-30 15:15:46 +08:00
wangchuxiao
0b9e6d52b4 superGroup 2022-05-30 15:11:13 +08:00
wangchuxiao
ecf0a4f299 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-05-30 15:10:32 +08:00
wangchuxiao
d3fe5cdf34 superGroup 2022-05-30 15:10:26 +08:00
wenxu12345
d3d5c11675 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 12:12:24 +08:00
wenxu12345
ae30b4359f super group 2022-05-30 12:12:09 +08:00
Gordon
bda1b0a304 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-30 11:56:45 +08:00
Gordon
839f3e52ef pull message update 2022-05-30 11:56:32 +08:00
wangchuxiao
a85f6b8287 Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup 2022-05-30 11:55:45 +08:00
wangchuxiao
fe9f86b432 superGroup 2022-05-30 11:55:27 +08:00
wangchuxiao
c0a3bdcf99 k8s 2022-05-29 19:44:22 +08:00
skiffer-git
94125fa5dd Update README.md 2022-05-29 13:12:17 +08:00
skiffer-git
a77971ae13 Update README.md 2022-05-29 13:12:07 +08:00
skiffer-git
e7f153a5e5 Add files via upload 2022-05-29 13:11:19 +08:00
skiffer-git
8cd39861f8 Delete Wechat.jpg 2022-05-29 13:11:07 +08:00
skiffer-git
dcff407670 Update README.md 2022-05-29 13:10:35 +08:00
skiffer-git
3b453dea13 Update README.md 2022-05-29 13:10:16 +08:00
skiffer-git
9981b8f16c Update README.md 2022-05-29 13:09:47 +08:00
skiffer-git
da4663aa83 Update README.md 2022-05-29 13:08:20 +08:00
skiffer-git
3895bbc801 Add files via upload 2022-05-29 13:07:37 +08:00
Gordon
7285e2b2c9 add super group 2022-05-28 18:10:08 +08:00
Gordon
e9bf26e0ca pb file 2022-05-28 17:22:19 +08:00
wenxu12345
ec0319d256 Merge remote-tracking branch 'origin/superGroup' into superGroup 2022-05-27 20:30:31 +08:00
wenxu12345
1bfefbd083 super group 2022-05-27 20:29:39 +08:00
wangchuxiao
8967343079 superGroup 2022-05-27 19:33:47 +08:00
wangchuxiao
b3ba06aecb superGroup 2022-05-27 19:16:47 +08:00
wangchuxiao
8cdcd7105a superGroup 2022-05-27 18:57:04 +08:00
wangchuxiao
cc6d8d28b5 superGroup 2022-05-27 18:53:47 +08:00
wangchuxiao
b55e13dbeb superGroup 2022-05-27 18:40:24 +08:00
wangchuxiao
bbe8c46df9 callback 2022-05-27 16:13:44 +08:00
wangchuxiao
16a56457ed callback 2022-05-27 15:34:10 +08:00
wangchuxiao
a4c0728e28 callback 2022-05-27 15:19:13 +08:00
wangchuxiao
d6907f3f3a callback 2022-05-27 15:17:17 +08:00
wangchuxiao
3f126be081 callback 2022-05-27 15:14:12 +08:00
wangchuxiao
cbf0b3c05e callback 2022-05-27 15:10:20 +08:00
wangchuxiao
0f0470b93c callback 2022-05-27 15:03:29 +08:00
wangchuxiao
d104c6dbf4 callback 2022-05-27 14:20:05 +08:00
wangchuxiao
a8705be6ee callback 2022-05-27 13:16:05 +08:00
wangchuxiao
f54ba4b018 callback 2022-05-27 13:11:19 +08:00
wangchuxiao
884b410dce callback 2022-05-27 12:49:26 +08:00
wangchuxiao
e5945fa720 callback 2022-05-27 11:49:38 +08:00
wangchuxiao
b155a9908b callback 2022-05-27 11:34:10 +08:00
wangchuxiao
d67e4a3491 callback 2022-05-27 11:08:27 +08:00
wangchuxiao
97d0ab1b75 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-27 10:33:31 +08:00
wangchuxiao
f5befcc95f callback 2022-05-27 10:26:44 +08:00
wangchuxiao
ab047944b6 ingress 2022-05-27 00:33:52 +08:00
wangchuxiao
ce5f927a8d ingress 2022-05-27 00:27:17 +08:00
wangchuxiao
dcb777d6ea ingress 2022-05-27 00:01:51 +08:00
wangchuxiao
decf728d91 ingress 2022-05-26 22:11:03 +08:00
wangchuxiao
098f8a52f7 callback 2022-05-26 19:59:40 +08:00
wangchuxiao
1eeb7f8303 callback 2022-05-26 19:53:13 +08:00
wangchuxiao
4b7177101a Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-26 18:09:13 +08:00
wangchuxiao
73cf3eb869 callback 2022-05-26 18:08:29 +08:00
wangchuxiao
b4da35a0ab ingress 2022-05-26 18:02:00 +08:00
wenxu12345
e3d92c27e8 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-26 12:11:36 +08:00
wenxu12345
8addb49012 add error handling : mongo 2022-05-26 12:10:45 +08:00
wenxu12345
ac1e557c46 add error handling : mongo 2022-05-26 12:10:30 +08:00
wangchuxiao
d1651b54ec ingress 2022-05-26 10:45:16 +08:00
wangchuxiao
f61dbdccec ingress 2022-05-26 10:37:06 +08:00
wangchuxiao
9beff11125 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-26 10:08:22 +08:00
wangchuxiao
d8c0a82411 ingress 2022-05-26 10:06:56 +08:00
Gordon
2add9a02f9 channelNum 2022-05-25 22:42:44 +08:00
Gordon
2910a6effd channelNum 2022-05-25 22:30:30 +08:00
Gordon
5621a651a1 channelNum 2022-05-25 22:17:11 +08:00
Gordon
c83e816bda channelNum 2022-05-25 22:15:34 +08:00
Gordon
948e5a2dde channelNum 2022-05-25 21:43:35 +08:00
Gordon
94cd17909d channelNum 2022-05-25 21:23:10 +08:00
Gordon
bcfa3efef7 channelNum 2022-05-25 21:15:17 +08:00
Gordon
bf87eb68e2 channelNum 2022-05-25 21:03:48 +08:00
Gordon
a84298de86 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-25 20:29:41 +08:00
Gordon
ee47c6d727 channelNum 2022-05-25 20:29:32 +08:00
wangchuxiao
ef5bd95620 ingress 2022-05-25 20:17:17 +08:00
wangchuxiao
b36703fc47 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-25 19:46:13 +08:00
wangchuxiao
b2112ca8b9 ingress 2022-05-25 19:45:57 +08:00
Gordon
7952545f0d Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-25 19:37:31 +08:00
Gordon
c997fbafb0 channelNum 2022-05-25 19:37:20 +08:00
wangchuxiao
60c8d3b832 script 2022-05-25 19:21:06 +08:00
wangchuxiao
778c1852b8 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-25 19:15:35 +08:00
wangchuxiao
08cc287dff script 2022-05-25 19:15:15 +08:00
Gordon
17b7ef80ba channelNum 2022-05-25 19:01:36 +08:00
Gordon
a4532cb834 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-25 18:47:03 +08:00
Gordon
dc2bc7fbf7 channelNum 2022-05-25 18:46:53 +08:00
wangchuxiao
d37dd66ec5 script 2022-05-25 18:26:12 +08:00
wangchuxiao
79bbeea7f0 script 2022-05-25 18:25:09 +08:00
wangchuxiao
5b56de784d Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-25 18:18:54 +08:00
wangchuxiao
620dd0be78 script 2022-05-25 18:18:35 +08:00
Gordon
7267fd080e channelNum 2022-05-25 18:17:55 +08:00
Gordon
2d8e03cc69 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-25 18:12:16 +08:00
Gordon
b797492dbd channelNum 2022-05-25 18:11:49 +08:00
Gordon
eb41d8b16d channelNum 2022-05-25 18:10:53 +08:00
wangchuxiao
d791aa2e4f script 2022-05-25 18:09:41 +08:00
wangchuxiao
f969841464 script 2022-05-25 18:05:47 +08:00
wangchuxiao
93d63508dc script 2022-05-25 18:05:24 +08:00
Gordon
84e7935971 channelNum 2022-05-25 18:03:43 +08:00
wangchuxiao
730bedf0a5 script 2022-05-25 18:01:39 +08:00
wangchuxiao
0ed223ef01 script 2022-05-25 17:58:05 +08:00
wangchuxiao
fc677ca0e9 script 2022-05-25 17:48:28 +08:00
wangchuxiao
c02f95c2fc script 2022-05-25 17:47:04 +08:00
wangchuxiao
76b5affaaa script 2022-05-25 17:46:02 +08:00
wangchuxiao
72c7cc2c67 script 2022-05-25 17:42:45 +08:00
wangchuxiao
13b9749e8f del msg 2022-05-25 17:41:32 +08:00
wangchuxiao
3f76521bfe Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-25 17:39:42 +08:00
wangchuxiao
837cf10e36 del msg 2022-05-25 17:38:49 +08:00
wenxu12345
e8fe7cc853 debug 2022-05-25 17:14:09 +08:00
Gordon
5db96847fc Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-25 16:37:29 +08:00
Gordon
746b01f8ca push update 2022-05-25 16:37:20 +08:00
wangchuxiao
eb2218c220 del msg 2022-05-25 16:33:28 +08:00
wangchuxiao
657ec411c3 del msg 2022-05-25 16:28:28 +08:00
wangchuxiao
9895806d23 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-25 16:25:36 +08:00
wangchuxiao
5957e4b264 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	internal/rpc/msg/rpcChat.go
2022-05-25 16:25:16 +08:00
Gordon
c544c4d6b5 push update 2022-05-25 16:22:35 +08:00
Gordon
061af3f827 push update 2022-05-25 16:16:23 +08:00
wangchuxiao
4d8708a5ee Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	internal/rpc/msg/rpcChat.go
2022-05-25 16:10:05 +08:00
wangchuxiao
9eb1870196 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	internal/rpc/msg/rpcChat.go
2022-05-25 16:01:34 +08:00
wangchuxiao
e961a44511 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	internal/rpc/msg/rpcChat.go
2022-05-25 15:58:06 +08:00
wangchuxiao
c16a35ec8c del msg 2022-05-25 15:57:17 +08:00
wangchuxiao
841566a5d1 del msg 2022-05-25 15:56:39 +08:00
Gordon
4a822c5920 push update 2022-05-25 15:53:19 +08:00
Gordon
ce554fc442 push update 2022-05-25 15:48:48 +08:00
Gordon
e9a515ac34 message update 2022-05-25 15:29:38 +08:00
Gordon
b14b53329c Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-25 15:22:03 +08:00
Gordon
b8641258d6 message update 2022-05-25 15:21:53 +08:00
wangchuxiao
6022aff965 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-25 15:09:25 +08:00
wangchuxiao
18eaae80ec del msg 2022-05-25 15:09:17 +08:00
Gordon
a4e41462c7 message update 2022-05-25 14:55:14 +08:00
Gordon
f8bed154ce pb file 2022-05-25 14:36:24 +08:00
Gordon
8ee3f7ab66 pb file 2022-05-25 14:22:39 +08:00
Gordon
77c7efbe89 redis add get message 2022-05-24 23:31:37 +08:00
Gordon
8d78ef5946 redis add get message 2022-05-24 23:07:07 +08:00
Gordon
4571a3b50b redis add get message 2022-05-24 22:27:53 +08:00
Gordon
b48197c8aa redis add get message 2022-05-24 22:14:30 +08:00
Gordon
bb45c0c34b redis add get message 2022-05-24 21:45:34 +08:00
Gordon
25c316165e redis add get message 2022-05-24 21:42:12 +08:00
wenxu12345
1246f3aa21 msg cache 2022-05-24 21:34:02 +08:00
wenxu12345
49cd31fd41 msg cache 2022-05-24 21:31:55 +08:00
Gordon
94e6380485 redis add get message 2022-05-24 21:14:39 +08:00
Gordon
36b5315075 redis add get message 2022-05-24 20:17:06 +08:00
Gordon
c66ccfeda2 redis add get message 2022-05-24 20:04:40 +08:00
Gordon
ae0cfe1575 redis add get message 2022-05-24 19:25:49 +08:00
Gordon
79ff36d49a redis add get message 2022-05-24 19:24:11 +08:00
Gordon
d6742812c8 redis add get message 2022-05-24 18:58:22 +08:00
Gordon
13dc721cb0 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-24 18:41:08 +08:00
Gordon
57967835bd redis add get message 2022-05-24 18:40:57 +08:00
wenxu12345
db9913c725 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-24 18:19:11 +08:00
wenxu12345
c3e3f4e947 msg cache 2022-05-24 18:18:59 +08:00
wangchuxiao
f33937bc5d Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-24 18:18:05 +08:00
wangchuxiao
c176a5b80a msg cache 2022-05-24 18:17:50 +08:00
wenxu12345
e2db8c07af msg cache 2022-05-24 17:52:29 +08:00
Gordon
c224892609 redis add get message 2022-05-24 17:49:43 +08:00
Gordon
f5ed9d93c3 redis add get message 2022-05-24 17:47:25 +08:00
Gordon
88145694ce Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-24 17:36:21 +08:00
Gordon
d58f7fd089 redis add get message 2022-05-24 17:36:11 +08:00
wangchuxiao
c32b53b3c0 msg cache 2022-05-24 17:22:17 +08:00
wangchuxiao
9dfef527a3 msg cache 2022-05-24 17:09:02 +08:00
wangchuxiao
df51c8b9a4 msg cache 2022-05-24 16:54:56 +08:00
wangchuxiao
499c4a27d3 k8s deploy 2022-05-24 15:48:45 +08:00
Gordon
bfe08acfec docker compose file update 2022-05-24 12:39:37 +08:00
Gordon
ffae976e11 compose file update 2022-05-24 12:36:05 +08:00
Gordon
ced8eb419f compose file update 2022-05-24 12:25:41 +08:00
Gordon
0ab2eaa630 compose file update 2022-05-24 12:24:53 +08:00
Gordon
d385f555dd compose file update 2022-05-24 12:23:39 +08:00
Gordon
268e5cbdb1 compose file update 2022-05-24 12:19:55 +08:00
Gordon
247649ec34 compose file update 2022-05-24 12:09:55 +08:00
Gordon
2ada6d969d compose file update 2022-05-24 11:46:29 +08:00
Gordon
a4d2740f24 consumer update test 2022-05-24 11:37:39 +08:00
Gordon
df7266cc75 consumer update test 2022-05-24 11:35:03 +08:00
Gordon
3255b73a44 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-24 11:14:12 +08:00
Gordon
305e81bef1 consumer update test 2022-05-24 11:14:02 +08:00
wangchuxiao
84cc6e9140 k8s deploy 2022-05-24 10:53:18 +08:00
wangchuxiao
b8d95f4b31 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-24 10:42:24 +08:00
wangchuxiao
c0f7d02f44 k8s deploy 2022-05-24 10:42:07 +08:00
Gordon
7fc6b61f21 consumer update 2022-05-23 20:39:44 +08:00
Gordon
ed3a1296d8 consumer update 2022-05-23 20:20:06 +08:00
Gordon
66c62d8875 consumer update 2022-05-23 20:12:54 +08:00
Gordon
7d1b06471f Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-23 19:57:00 +08:00
Gordon
b7309cdda8 log 2022-05-23 19:56:34 +08:00
wangchuxiao
6ffc12ef97 k8s deploy 2022-05-23 19:14:29 +08:00
wangchuxiao
79b2d39305 k8s deploy 2022-05-23 18:04:51 +08:00
wangchuxiao
b3525ea6a5 k8s deploy 2022-05-23 17:56:29 +08:00
wangchuxiao
b5ceec4883 k8s deploy 2022-05-23 17:40:04 +08:00
wangchuxiao
4287082f4b k8s deploy 2022-05-23 17:22:27 +08:00
wangchuxiao
e3a8d12d4b k8s deploy 2022-05-23 17:19:53 +08:00
wangchuxiao
ce15c26b59 k8s deploy 2022-05-23 16:07:52 +08:00
wangchuxiao
48940272ae k8s deploy 2022-05-23 15:49:55 +08:00
wangchuxiao
8c64538207 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-23 14:32:37 +08:00
wangchuxiao
0460033281 k8s deploy 2022-05-23 14:30:54 +08:00
wangchuxiao
8240cb9c0f k8s deploy 2022-05-23 14:24:46 +08:00
Gordon
e385f054df message handle 2022-05-23 11:57:41 +08:00
wangchuxiao
03ae935756 k8s deploy 2022-05-23 11:39:59 +08:00
wangchuxiao
d196f455cb k8s deploy 2022-05-23 11:32:33 +08:00
Gordon
50bb13b7cd message handle 2022-05-23 10:55:33 +08:00
wangchuxiao
652afd6b57 Merge branch 'k8s' of github.com:OpenIMSDK/Open-IM-Server into k8s 2022-05-23 10:14:21 +08:00
wangchuxiao
d1cb176b31 del msg sync 2022-05-23 10:14:10 +08:00
Gordon
767131a117 message handle 2022-05-23 09:54:43 +08:00
Gordon
f0dadcef70 message handle 2022-05-23 09:41:34 +08:00
skiffer-git
1f20024b91 log 2022-05-23 08:44:20 +08:00
skiffer-git
f5c7197dda log 2022-05-23 08:42:50 +08:00
wangchuxiao
cb497fe720 k8s_deployment 2022-05-23 00:55:56 +08:00
skiffer-git
bef0e40db8 log 2022-05-22 21:48:01 +08:00
skiffer-git
24073b20ab log 2022-05-22 21:37:38 +08:00
skiffer-git
64d83d9048 log 2022-05-22 21:31:10 +08:00
skiffer-git
5c0b06f27d log 2022-05-22 21:27:29 +08:00
skiffer-git
b09e2c11eb sess == nil 2022-05-22 21:10:18 +08:00
skiffer-git
8c119a76d1 sess == nil 2022-05-22 21:08:57 +08:00
skiffer-git
04a9788bc0 log 2022-05-22 18:47:16 +08:00
skiffer-git
883e7f96ee log 2022-05-22 18:42:08 +08:00
skiffer-git
d276be9594 Reduce memory copies 2022-05-22 18:28:51 +08:00
skiffer-git
2fc6b0a8cb log 2022-05-22 15:57:02 +08:00
skiffer-git
9f295d8399 log 2022-05-22 15:15:55 +08:00
skiffer-git
024f454702 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-22 15:09:49 +08:00
skiffer-git
821ad4de2e log 2022-05-22 15:09:21 +08:00
Gordon
b864f9c6a9 message 2022-05-21 19:17:31 +08:00
Gordon
31e0a8a88b log change 2022-05-21 15:04:42 +08:00
Gordon
be3d2b6552 Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts:
#	internal/msg_transfer/logic/online_history_msg_handler.go
2022-05-21 15:04:19 +08:00
Gordon
e2eb546069 log change 2022-05-21 15:03:26 +08:00
skiffer-git
b2ae3b4fee Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-21 15:01:35 +08:00
skiffer-git
5b9e5f904b log 2022-05-21 15:01:01 +08:00
Gordon
7d1843f485 log change 2022-05-21 14:19:45 +08:00
skiffer-git
f1e2704407 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-21 11:01:13 +08:00
skiffer-git
17b4a0525d log 2022-05-21 10:59:44 +08:00
Gordon
5cdba3c00a log change 2022-05-21 10:19:02 +08:00
Gordon
79b5551ec1 log change 2022-05-21 09:58:27 +08:00
skiffer-git
ac840323be Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-21 07:33:39 +08:00
skiffer-git
c2e7863ca0 fix bug 2022-05-21 07:32:45 +08:00
Gordon
01b065b3c2 concurrent consumption of messages 2022-05-20 21:58:23 +08:00
Gordon
55907a9a05 concurrent consumption of messages 2022-05-20 21:02:18 +08:00
skiffer-git
6e9dcdbb50 Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts:
#	pkg/common/db/batch_insert_chat.go
2022-05-20 20:13:25 +08:00
skiffer-git
0265ea45b2 fix bug 2022-05-20 20:11:47 +08:00
Gordon
ccb7e41434 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 20:10:35 +08:00
Gordon
38317c5497 concurrent consumption of messages 2022-05-20 20:10:24 +08:00
skiffer-git
9f62de0420 fix bug 2022-05-20 19:46:49 +08:00
wangchuxiao
e8e4af7286 k8s_deploy 2022-05-20 19:43:28 +08:00
skiffer-git
2c5d30a0ff Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 19:36:28 +08:00
skiffer-git
eb27db2232 fix bug 2022-05-20 19:36:06 +08:00
Gordon
adb6337a27 concurrent consumption of messages 2022-05-20 19:34:45 +08:00
Gordon
624bb0a7e5 concurrent consumption of messages 2022-05-20 18:46:19 +08:00
Gordon
757829d286 concurrent consumption of messages 2022-05-20 17:43:25 +08:00
Gordon
c5f055718a concurrent consumption of messages 2022-05-20 17:32:40 +08:00
Gordon
a12c8f4dbc concurrent consumption of messages 2022-05-20 17:06:51 +08:00
Gordon
f072afa6ef Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 16:53:46 +08:00
Gordon
686d77dcc1 concurrent consumption of messages 2022-05-20 16:53:35 +08:00
skiffer-git
7da227cdfa Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 16:12:31 +08:00
skiffer-git
abcfaa05e2 log 2022-05-20 16:12:05 +08:00
Gordon
aa144b0439 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 16:07:41 +08:00
Gordon
15329a97fe concurrent consumption of messages 2022-05-20 16:07:32 +08:00
skiffer-git
223b2678b4 fix bug 2022-05-20 16:03:33 +08:00
Gordon
930923e330 concurrent consumption of messages 2022-05-20 15:51:37 +08:00
Gordon
8fe929d8ab concurrent consumption of messages 2022-05-20 15:47:04 +08:00
Gordon
e12207fc73 concurrent consumption of messages 2022-05-20 15:40:40 +08:00
Gordon
ef05949e5a Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 15:29:01 +08:00
Gordon
a2f7edcbcd concurrent consumption of messages 2022-05-20 15:28:36 +08:00
skiffer-git
7f80638928 fix bug 2022-05-20 15:27:25 +08:00
skiffer-git
222d6cdca1 fix bug 2022-05-20 15:21:16 +08:00
Gordon
aa733542e3 concurrent consumption of messages 2022-05-20 15:09:52 +08:00
Gordon
2b142baf19 concurrent consumption of messages 2022-05-20 14:48:06 +08:00
Gordon
78bfd1ff64 Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts:
#	internal/msg_transfer/logic/online_history_msg_handler.go
2022-05-20 14:45:40 +08:00
Gordon
7ea1309146 concurrent consumption of messages 2022-05-20 14:42:49 +08:00
skiffer-git
a7be7a3e7a log 2022-05-20 14:38:10 +08:00
skiffer-git
a14fd303fc log 2022-05-20 14:32:09 +08:00
skiffer-git
b632a991b9 log 2022-05-20 14:18:54 +08:00
skiffer-git
06aae24dad log 2022-05-20 14:12:29 +08:00
skiffer-git
3bf04802e4 log 2022-05-20 14:06:51 +08:00
skiffer-git
6f79e63b3f log 2022-05-20 14:06:31 +08:00
skiffer-git
67cfdedcc4 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 13:34:51 +08:00
skiffer-git
f0c6295cff batch to mongo 2022-05-20 13:34:34 +08:00
Gordon
6c5629a0d7 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 13:33:49 +08:00
Gordon
06726758d2 concurrent consumption of messages 2022-05-20 13:33:38 +08:00
skiffer-git
866c7d4f2f batch to mongo 2022-05-20 13:15:32 +08:00
skiffer-git
17695927d5 batch to mongo 2022-05-20 13:09:28 +08:00
skiffer-git
ea8638c843 batch to mongo 2022-05-20 13:01:08 +08:00
skiffer-git
0fbc1095be batch to mongo 2022-05-20 12:21:29 +08:00
skiffer-git
b914e8388d batch to mongo 2022-05-20 12:11:46 +08:00
skiffer-git
31911a40c0 batch to mongo 2022-05-20 11:24:10 +08:00
skiffer-git
00a2a23190 batch to mongo 2022-05-20 11:20:21 +08:00
skiffer-git
5f25e605d3 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-20 11:02:27 +08:00
skiffer-git
d4f81f086c batch to mongo 2022-05-20 11:00:11 +08:00
wangchuxiao
e048813c43 k8s_deploy 2022-05-20 10:42:33 +08:00
wangchuxiao
1186f2fb14 k8s_deploy 2022-05-20 10:32:51 +08:00
wangchuxiao
a2cdf6559d k8s_deploy 2022-05-20 10:28:07 +08:00
wangchuxiao
9d6d74ce98 k8s_deploy 2022-05-20 10:19:00 +08:00
wangchuxiao
dbc7023c00 k8s_deploy 2022-05-19 20:05:37 +08:00
wangchuxiao
6fd84dba8f k8s_deploy 2022-05-19 19:58:46 +08:00
wangchuxiao
e444a52b6a k8s_deploy 2022-05-19 19:56:49 +08:00
wangchuxiao
d431a81cf0 k8s_deploy 2022-05-19 19:55:51 +08:00
wangchuxiao
dcb03a2250 k8s_deploy 2022-05-19 19:48:29 +08:00
wangchuxiao
8d6e016e48 k8s_deploy 2022-05-19 19:29:45 +08:00
wangchuxiao
f067af664e k8s_deploy 2022-05-19 19:22:57 +08:00
wangchuxiao
6355e4e3bc k8s_deploy 2022-05-19 19:13:22 +08:00
wangchuxiao
e2f9c18a27 k8s_deploy 2022-05-19 19:12:35 +08:00
wangchuxiao
cc93dba508 k8s_deploy 2022-05-19 19:03:27 +08:00
wangchuxiao
b1f270c082 k8s_deploy 2022-05-19 18:22:18 +08:00
Gordon
d086de8103 concurrent consumption of messages 2022-05-19 18:08:44 +08:00
wangchuxiao
523ca2f7fc k8s_deploy 2022-05-19 17:50:04 +08:00
Gordon
a2888b009d concurrent consumption of messages 2022-05-19 14:21:38 +08:00
Gordon
143e2908ad concurrent consumption of messages 2022-05-19 14:18:05 +08:00
Gordon
98542bd5d5 concurrent consumption of messages 2022-05-19 12:28:14 +08:00
Gordon
ee0a71de1b concurrent consumption of messages 2022-05-19 12:25:46 +08:00
wangchuxiao
9f8cb6ca34 k8s_deploy 2022-05-19 11:17:07 +08:00
wangchuxiao
759fb8a802 k8s_deploy 2022-05-19 10:58:33 +08:00
wangchuxiao
ab06eaeca8 k8s_deploy 2022-05-19 10:55:14 +08:00
wangchuxiao
267b3a9547 k8s_deploy 2022-05-19 10:50:22 +08:00
wangchuxiao
0b49ecfc12 office tag async send 2022-05-19 10:49:40 +08:00
wangchuxiao
23b03919e6 office tag async send 2022-05-19 10:44:39 +08:00
Gordon
4f165f3b27 statistic update 2022-05-18 21:58:32 +08:00
Gordon
967a4c7748 statistic update 2022-05-18 21:09:49 +08:00
wangchuxiao
03c23f0fda office tag async send 2022-05-18 19:17:43 +08:00
wangchuxiao
44bad0146c office tag async send 2022-05-18 19:13:00 +08:00
Gordon
d92d6e84d0 push message 2022-05-18 18:58:51 +08:00
Gordon
355b64fda4 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-18 18:37:52 +08:00
Gordon
c1632f8e65 tag message sender not notification 2022-05-18 18:37:42 +08:00
wangchuxiao
1fa16bd8dd office tag async send 2022-05-18 16:36:30 +08:00
wangchuxiao
0ac531674c Merge branch 'tuoyun' into k8s 2022-05-18 16:07:43 +08:00
wangchuxiao
18a61061e1 office tag async send 2022-05-18 15:48:42 +08:00
wangchuxiao
b0e349212d office tag async send 2022-05-18 15:25:17 +08:00
wangchuxiao
9913e67928 office tag async send 2022-05-18 15:16:44 +08:00
wangchuxiao
888c837cdd office tag async send 2022-05-18 15:10:44 +08:00
wangchuxiao
0e03fb6393 organization 2022-05-18 12:51:33 +08:00
wangchuxiao
317fed304c Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-18 11:54:12 +08:00
wangchuxiao
681cf349e6 organization 2022-05-18 11:53:57 +08:00
skiffer-git
313cf858f0 Statistics 2022-05-18 11:52:15 +08:00
Gordon
fa94fd075f Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-18 11:49:36 +08:00
Gordon
3433d211a5 options add value 2022-05-18 11:49:24 +08:00
wangchuxiao
dcda3c7329 organization 2022-05-18 11:34:12 +08:00
wangchuxiao
d2563063d1 organization 2022-05-18 11:18:24 +08:00
wangchuxiao
9557baf22a organization 2022-05-18 11:15:09 +08:00
wangchuxiao
c7b1d4514f organization 2022-05-18 11:06:45 +08:00
wangchuxiao
09cd8bcb99 organization 2022-05-18 11:04:40 +08:00
skiffer-git
3046d63ad4 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-18 08:07:05 +08:00
skiffer-git
de9c2d3d85 mutex 2022-05-18 08:06:05 +08:00
wangchuxiao
2454c50380 organization 2022-05-17 20:42:43 +08:00
wangchuxiao
e2f8156a4d organization 2022-05-17 20:18:12 +08:00
wangchuxiao
6ea6a61e90 organization 2022-05-17 17:44:08 +08:00
Gordon
b978b6756e log add operationID 2022-05-13 23:17:04 +08:00
Gordon
cbae83106b Merge branch 'tuoyun' 2022-05-13 21:58:42 +08:00
Gordon
424f854145 docker-compose version upgrade 2022-05-13 21:58:28 +08:00
Gordon
faf72705cb Merge branch 'tuoyun' 2022-05-13 21:15:25 +08:00
Gordon
381e72f1ef send message 2022-05-13 21:05:39 +08:00
Gordon
91fe549c25 add log 2022-05-13 16:30:36 +08:00
Gordon
a472da9ea6 msg bug fix 2022-05-13 16:19:11 +08:00
Gordon
20c7fe81dc Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-13 16:00:03 +08:00
Gordon
3ef445eb2e msg bug fix 2022-05-13 15:59:38 +08:00
wangchuxiao
4afc38523d organization 2022-05-13 15:41:11 +08:00
wangchuxiao
15616e8d07 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-13 15:38:19 +08:00
wangchuxiao
2534921af9 organization 2022-05-13 15:38:05 +08:00
Gordon
0206198f55 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-13 10:07:43 +08:00
Gordon
3c8c402f10 compose restore 2022-05-13 10:06:56 +08:00
wangchuxiao
098dae9640 organization 2022-05-12 19:11:55 +08:00
wangchuxiao
42c38de3e2 organization 2022-05-12 19:09:25 +08:00
wangchuxiao
be10e6a9de organization 2022-05-12 19:07:26 +08:00
wangchuxiao
6b5fb81e01 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-12 19:06:25 +08:00
wangchuxiao
bb5991b111 organization 2022-05-12 19:00:48 +08:00
wenxu12345
8f261970e9 Update group members' faceURL immediately 2022-05-12 18:00:23 +08:00
Gordon
093a8f18ef test 2022-05-11 21:01:36 +08:00
Gordon
9c19b5b785 test 2022-05-11 20:54:04 +08:00
Gordon
35958ca3a2 test 2022-05-11 20:49:47 +08:00
Gordon
3bc2e97e8b test 2022-05-11 20:02:33 +08:00
Gordon
eb7ff77461 test 2022-05-11 19:45:44 +08:00
Gordon
d36f4cf6f8 test 2022-05-11 19:44:08 +08:00
Gordon
f373669f02 test 2022-05-11 19:31:32 +08:00
Gordon
37596589a7 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-11 19:28:00 +08:00
Gordon
3e90426d8e test 2022-05-11 19:27:49 +08:00
wenxu12345
35a184827a Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-11 19:25:33 +08:00
wenxu12345
2edd3c5614 When you create a group chat, the group member can be empty 2022-05-11 19:25:06 +08:00
Gordon
cec5a6ceeb test 2022-05-11 19:21:28 +08:00
Gordon
dc6b0b4dde test 2022-05-11 19:16:57 +08:00
Gordon
3ecc1816be test 2022-05-11 18:58:11 +08:00
Gordon
9a90c2e568 test 2022-05-11 18:54:22 +08:00
Gordon
ab747d0338 test 2022-05-11 18:49:21 +08:00
Gordon
8753f91a4a send group message split topic 2022-05-11 18:38:58 +08:00
Gordon
f8af109821 send group message split topic 2022-05-11 18:33:48 +08:00
wenxu12345
a1a7900254 config 2022-05-11 16:50:09 +08:00
Gordon
804eb6c076 video message send 2022-05-11 14:34:21 +08:00
Gordon
f4f3ff0eda Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-11 13:26:50 +08:00
Gordon
03c0b1ea91 add kafka manager 2022-05-11 13:26:39 +08:00
wenxu12345
38535bde84 add RpcRegisterIP 2022-05-11 12:20:28 +08:00
wenxu12345
17e1fa54cf Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-11 12:13:43 +08:00
wenxu12345
a4f5dd9d89 add log 2022-05-11 12:13:17 +08:00
wangchuxiao
6269902140 update app 2022-05-11 11:07:04 +08:00
wangchuxiao
b964e424b2 update app 2022-05-11 10:47:32 +08:00
wangchuxiao
73665f62b3 update app 2022-05-11 10:46:54 +08:00
wangchuxiao
3fca780132 update app 2022-05-11 10:27:00 +08:00
wangchuxiao
b5e01dcb5e update app 2022-05-11 10:24:11 +08:00
wangchuxiao
f180b89a9c Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-11 10:20:13 +08:00
wangchuxiao
98a903e60c update app 2022-05-11 10:19:58 +08:00
Gordon
c20cc8fb18 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-11 09:55:13 +08:00
Gordon
99f5c4e12f update sarama version 2022-05-11 09:54:47 +08:00
wangchuxiao
17759f9a98 update app 2022-05-10 19:28:36 +08:00
wangchuxiao
6c0e96213f update app 2022-05-10 19:04:08 +08:00
wangchuxiao
2c89d80a27 update app 2022-05-10 18:28:57 +08:00
wangchuxiao
e314fd4a0a update app 2022-05-10 18:22:18 +08:00
wangchuxiao
affbe9f5a9 update app 2022-05-10 17:50:57 +08:00
wangchuxiao
7a423eb6e1 update app 2022-05-10 17:50:22 +08:00
wangchuxiao
7137924baa update app 2022-05-10 17:39:27 +08:00
wangchuxiao
c998bce34f update app 2022-05-10 17:23:28 +08:00
wangchuxiao
f5d4397f0b update app 2022-05-10 17:17:20 +08:00
wangchuxiao
608b166b32 update app 2022-05-10 17:00:52 +08:00
wangchuxiao
472cda8315 update app 2022-05-10 16:59:45 +08:00
wangchuxiao
7a78e5d869 update app 2022-05-10 16:53:58 +08:00
wangchuxiao
8effca3a7c update app 2022-05-10 16:39:08 +08:00
wangchuxiao
fab52b6a56 update app 2022-05-10 16:23:56 +08:00
wangchuxiao
e98ef5f5f2 update app 2022-05-10 16:22:16 +08:00
wangchuxiao
7aa84607c8 update app 2022-05-10 16:21:26 +08:00
wangchuxiao
928fc374c7 update app 2022-05-10 16:07:58 +08:00
wangchuxiao
4ea8cb5903 update app 2022-05-10 16:04:26 +08:00
wangchuxiao
db6acacf2e update app 2022-05-10 16:02:05 +08:00
wangchuxiao
59aa71b3b8 update app 2022-05-10 15:58:29 +08:00
wangchuxiao
ccfa487493 update app 2022-05-10 15:41:59 +08:00
wangchuxiao
9fcc41aeff update app 2022-05-10 15:34:00 +08:00
wangchuxiao
d9a4fa3f49 update app 2022-05-10 15:21:51 +08:00
wangchuxiao
6c821dc42a update app 2022-05-10 15:16:20 +08:00
wangchuxiao
d58e34ed3d update app 2022-05-10 15:07:07 +08:00
wangchuxiao
ff37d1cb02 update app 2022-05-10 14:57:54 +08:00
wangchuxiao
dcf119ae59 update app 2022-05-10 14:38:43 +08:00
wangchuxiao
1338cf875a update app 2022-05-10 14:20:15 +08:00
wangchuxiao
ed3e299e0b update app 2022-05-10 14:18:36 +08:00
wangchuxiao
f85645a78a update app 2022-05-10 14:17:31 +08:00
wangchuxiao
e412abd017 update app 2022-05-10 14:07:44 +08:00
wangchuxiao
1efa654e7d update app 2022-05-10 13:06:13 +08:00
wangchuxiao
00b58068dc Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-10 12:30:16 +08:00
wangchuxiao
7be5208daf update app 2022-05-10 12:30:00 +08:00
wenxu12345
7ad555a41b add ParseToken 2022-05-10 12:20:53 +08:00
wenxu12345
872f70a418 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 12:07:33 +08:00
wenxu12345
c37d2e78d2 add ParseToken 2022-05-10 12:07:09 +08:00
wangchuxiao
b606d066fc Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-10 12:07:07 +08:00
wangchuxiao
d4608eec26 update app 2022-05-10 12:05:02 +08:00
wenxu12345
0bc8e231ad Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 12:01:26 +08:00
wenxu12345
2dab5e4a78 add ParseToken 2022-05-10 11:57:25 +08:00
wangchuxiao
c6aa37851d Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-10 11:53:08 +08:00
wangchuxiao
31bd106ffd update app 2022-05-10 11:52:52 +08:00
wenxu12345
74cea2b41c Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 11:49:11 +08:00
wangchuxiao
46f9a00b75 update app 2022-05-10 11:48:33 +08:00
wenxu12345
450d8c21cf Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 11:48:28 +08:00
wenxu12345
2073bc77c8 add ParseToken 2022-05-10 11:48:10 +08:00
wangchuxiao
b6a5501f71 update app 2022-05-10 11:41:13 +08:00
wangchuxiao
e27b98cdc1 update app 2022-05-10 11:40:40 +08:00
wangchuxiao
8af500462f update app 2022-05-10 11:22:10 +08:00
wangchuxiao
30fc4c28b7 cache 2022-05-10 11:17:54 +08:00
Gordon
74b582369a log change 2022-05-10 11:00:15 +08:00
Gordon
c9ab2b507b Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 10:52:43 +08:00
Gordon
2b479319c1 log change 2022-05-10 10:52:32 +08:00
wangchuxiao
3a3ac012bb Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-10 10:45:21 +08:00
wangchuxiao
00265a7e8e cache 2022-05-10 10:44:43 +08:00
wenxu12345
0dafb50223 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 10:13:23 +08:00
wenxu12345
ac9620c253 add ParseToken 2022-05-10 10:12:53 +08:00
Gordon
6e226b165c sdk version 2022-05-10 10:01:46 +08:00
wenxu12345
6226f65e20 add ParseToken 2022-05-10 09:47:00 +08:00
wenxu12345
7de29c29e9 add ParseToken 2022-05-10 09:45:55 +08:00
wenxu12345
deed6c7bbe Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 09:17:22 +08:00
wenxu12345
c234e2ca3d log 2022-05-10 09:16:56 +08:00
Gordon
19bffa288d Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 09:13:34 +08:00
Gordon
9303096430 log change 2022-05-10 09:09:37 +08:00
wenxu12345
98d5f5ee3e Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-10 09:09:20 +08:00
wenxu12345
ba16fceeb8 log 2022-05-10 09:06:49 +08:00
Gordon
c49b5f78bf test 2022-05-09 18:45:44 +08:00
Gordon
446688d5b2 test 2022-05-09 18:34:14 +08:00
Gordon
e2cacd9c4b test 2022-05-09 18:23:06 +08:00
Gordon
d5c9e08888 manager send message to mysql duplicate primary key fix 2022-05-09 14:15:29 +08:00
skiffer-git
ab0ead4e05 grpc 2022-05-09 11:39:55 +08:00
wenxu12345
9a267db583 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-09 11:38:22 +08:00
wenxu12345
fb15cbef90 grpc 1.45.0 2022-05-09 11:38:08 +08:00
wangchuxiao
97e5d9f610 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-09 10:00:12 +08:00
wangchuxiao
305ee394b1 cache 2022-05-09 10:00:03 +08:00
skiffer-git
a251d521a1 set api ip in config 2022-05-07 19:52:18 +08:00
skiffer-git
b5065cb52f Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-07 17:05:56 +08:00
skiffer-git
dca16e83d3 rpc register ip 2022-05-07 17:05:05 +08:00
wangchuxiao
c5256fe2cb Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-07 15:02:03 +08:00
wangchuxiao
1b93ba5355 cache 2022-05-07 15:01:48 +08:00
FG
fd7171f5a4 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-07 14:25:54 +08:00
wangchuxiao
685fc1a37b cache 2022-05-07 14:13:47 +08:00
wangchuxiao
a738c93163 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-07 13:21:22 +08:00
wangchuxiao
4ac863fa6a cache 2022-05-07 13:21:05 +08:00
skiffer-git
fed369ad5d add err log 2022-05-07 12:04:07 +08:00
skiffer-git
f2c91d015e add err log 2022-05-07 12:01:01 +08:00
skiffer-git
e122349f9e Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-07 11:55:32 +08:00
skiffer-git
bb07c3ab45 add err log 2022-05-07 11:55:19 +08:00
wangchuxiao
65a4b38ee5 cache 2022-05-07 11:42:47 +08:00
wangchuxiao
bbc3f5c19a cache 2022-05-07 11:39:27 +08:00
wangchuxiao
0b4ba548a5 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-07 11:14:56 +08:00
wangchuxiao
747b963bd4 cache 2022-05-07 11:14:29 +08:00
FG
32b9820725 remove timer and database init 2022-05-07 10:37:52 +08:00
skiffer-git
b217fede87 upgrade etcd & grpc 2022-05-07 09:41:56 +08:00
skiffer-git
a9ce8a3b2e upgrade etcd & grpc 2022-05-07 09:34:49 +08:00
wangchuxiao
7914e7bc14 office 2022-05-06 17:35:33 +08:00
wangchuxiao
ed8716510b office 2022-05-06 17:32:52 +08:00
wangchuxiao
efd2ae59f5 office 2022-05-06 17:23:37 +08:00
wangchuxiao
1923d0b809 office 2022-05-06 17:05:59 +08:00
wangchuxiao
99f6752590 office 2022-05-06 16:51:59 +08:00
wangchuxiao
131746f94e office 2022-05-06 16:51:34 +08:00
wangchuxiao
f0ed6973c8 office 2022-05-06 16:50:19 +08:00
wangchuxiao
2cf070a26c office 2022-05-06 16:38:29 +08:00
wangchuxiao
3c68ecb7f1 office 2022-05-06 15:58:50 +08:00
wangchuxiao
243f5fcda4 fix bug 2022-05-06 11:19:16 +08:00
wangchuxiao
e22b7f36ce fix bug 2022-05-06 11:07:32 +08:00
wangchuxiao
308ea15763 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-05 19:23:01 +08:00
wangchuxiao
e26f9c58fa office 2022-05-05 19:22:47 +08:00
Gordon
4ca758174e Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-05-05 16:14:16 +08:00
Gordon
bf8e35e168 log change 2022-05-05 16:13:45 +08:00
wangchuxiao
2a3265ed71 office 2022-05-05 14:14:30 +08:00
wangchuxiao
3a06617a7d office 2022-05-05 11:59:44 +08:00
wangchuxiao
d75eb456dc office 2022-05-05 11:58:48 +08:00
wangchuxiao
8ed0f8ec73 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-05-05 10:11:00 +08:00
skiffer-git
185e0dce6e delete msg by index 2022-05-04 18:35:13 +08:00
skiffer-git
d9e74a78f0 delete msg by index 2022-05-04 18:02:24 +08:00
skiffer-git
700483dd48 group chat log 2022-05-02 20:03:13 +08:00
skiffer-git
1c80b820cb group chat log 2022-05-02 20:00:09 +08:00
skiffer-git
59e5cfb04d group chat log 2022-05-02 19:45:32 +08:00
skiffer-git
b06550e2cb group chat log 2022-05-02 19:43:22 +08:00
skiffer-git
ca4bf13569 group chat log 2022-05-02 19:23:26 +08:00
skiffer-git
eae3a50435 group chat log 2022-05-02 19:16:00 +08:00
skiffer-git
de2956ec3c group chat log 2022-05-02 08:47:21 +08:00
skiffer-git
a2e62c9fb5 fix bug: group chat share pb 2022-05-01 16:21:28 +08:00
wangchuxiao
e7fdc318f1 cache bug fix 2022-05-01 13:27:52 +08:00
wangchuxiao
62dd559b7c cache bug fix 2022-05-01 13:08:46 +08:00
skiffer-git
4a631753a0 add msgToMQSingle && msgToMQGroup 2022-05-01 12:04:31 +08:00
wangchuxiao
b696984655 cache 2022-04-29 19:36:36 +08:00
wangchuxiao
f1dbec122a cache 2022-04-29 18:59:08 +08:00
wangchuxiao
47cb54461f cache 2022-04-29 18:56:53 +08:00
wangchuxiao
91e03f7cfd cache 2022-04-29 18:53:33 +08:00
Gordon
c0314d95c9 send message parallel 2022-04-29 18:47:55 +08:00
wenxu12345
8e17b3ff51 Revert "update etcd to v3.5.2 (#206)"
This reverts commit 766b6e9f
2022-04-29 18:45:11 +08:00
wenxu12345
b932a659b6 etcd 2022-04-29 18:35:55 +08:00
wenxu12345
80b2ed19e0 etcd 2022-04-29 18:32:46 +08:00
wenxu12345
88000926f4 etcd 2022-04-29 18:30:02 +08:00
wenxu12345
12245fefed etcd 2022-04-29 18:24:18 +08:00
wenxu12345
8eebd5fb9a Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-29 18:20:09 +08:00
wenxu12345
c5b0e31d36 config 2022-04-29 18:19:59 +08:00
wangchuxiao
5c5e828cc6 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-29 18:00:29 +08:00
Gordon
ecb11cf927 test 2022-04-29 17:59:53 +08:00
wangchuxiao
485241d080 cache & workMoments 2022-04-29 17:59:42 +08:00
Gordon
8701f8868c test 2022-04-29 17:58:57 +08:00
wenxu12345
e68086e149 config 2022-04-29 17:04:15 +08:00
wenxu12345
16a2d80801 config 2022-04-29 17:02:03 +08:00
wenxu12345
d5e5659a2c config 2022-04-29 16:42:42 +08:00
wenxu12345
3c2e8dcf87 config 2022-04-29 16:33:01 +08:00
wangchuxiao
03320e8644 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-29 15:52:18 +08:00
wangchuxiao
40ae6ccf2f cache & workMoments 2022-04-29 14:26:04 +08:00
Gordon
bcbade3729 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-28 21:21:27 +08:00
Gordon
58a6f9cae3 test 2022-04-28 21:17:50 +08:00
Gordon
bf154eb8c3 Merge branch 'main' into tuoyun
# Conflicts:
#	script/sdk_svr_start.sh
2022-04-28 21:12:14 +08:00
yiippee
766b6e9fef update etcd to v3.5.2 (#206)
Co-authored-by: lizhanbin <lizhanbin@52tt.com>
2022-04-28 21:09:43 +08:00
wangchuxiao
d89a41d4c7 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-28 19:08:15 +08:00
wangchuxiao
d24a7d7b22 cache & workMoments 2022-04-28 19:05:04 +08:00
wenxu12345
57a746fc21 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-28 19:01:20 +08:00
wenxu12345
2c1bd41fba ulimit -n 2022-04-28 19:00:37 +08:00
wangchuxiao
6260cf24cc cache 2022-04-28 18:25:10 +08:00
wangchuxiao
88d4a670d4 cache 2022-04-28 18:23:55 +08:00
wangchuxiao
ea0b6c5ee5 cache 2022-04-28 17:38:09 +08:00
wangchuxiao
20f61042fc cache 2022-04-28 17:35:19 +08:00
wangchuxiao
2751a967e8 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-28 16:48:52 +08:00
wangchuxiao
93057870a7 cache 2022-04-28 16:48:39 +08:00
Gordon
6b98c3fed5 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-28 16:47:56 +08:00
Gordon
eb63ed926d log modify 2022-04-28 16:47:46 +08:00
wangchuxiao
b72787f5bb cache 2022-04-28 16:38:33 +08:00
wangchuxiao
0793b2ab38 cache 2022-04-28 16:29:40 +08:00
wangchuxiao
604ed3e3e1 cache 2022-04-28 16:19:51 +08:00
wangchuxiao
0aefbc2c7d Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	internal/rpc/friend/firend.go
2022-04-28 15:32:38 +08:00
wangchuxiao
eb1fa90788 cache 2022-04-28 15:17:19 +08:00
wangchuxiao
65f02e5139 cache 2022-04-28 15:13:39 +08:00
Gordon
bbfe65a905 send message add cache 2022-04-28 15:10:42 +08:00
wangchuxiao
59468eb162 fix work moments bug 2022-04-28 10:46:21 +08:00
wangchuxiao
1889a283ee fix work moments bug 2022-04-27 14:43:46 +08:00
wangchuxiao
0655b2021d Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-27 14:36:15 +08:00
wangchuxiao
a1b8c9b6fd fix work moments bug 2022-04-27 14:35:02 +08:00
wenxu12345
c4a60bc6f6 Merge remote-tracking branch 'origin/main' 2022-04-27 10:09:18 +08:00
wenxu12345
eb7037eea8 ulimit -n 2022-04-27 10:09:05 +08:00
wenxu12345
7546083cd5 ulimit -n 2022-04-27 10:08:09 +08:00
wangchuxiao
74ee36f43a Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-26 20:20:39 +08:00
wangchuxiao
f8c3e4d66f Merge branch 'tuoyun'
# Conflicts:
#	cmd/open_im_cms_api/main.go
#	config/config.yaml
2022-04-26 20:19:02 +08:00
wenxu12345
6db8d9a38a Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-26 18:26:48 +08:00
wenxu12345
61145a2d03 fix bug user_register port 2022-04-26 18:23:10 +08:00
wangchuxiao
4a9410742a Merge branch 'tuoyun'
# Conflicts:
#	cmd/open_im_cms_api/main.go
#	config/config.yaml
2022-04-26 16:50:43 +08:00
wangchuxiao
db78e4ef03 Merge branch 'main' of github.com:OpenIMSDK/Open-IM-Server 2022-04-26 16:46:17 +08:00
wangchuxiao
7b0eb4e79d work moments 2022-04-26 16:24:43 +08:00
wangchuxiao
17f6b8eb2a work moments 2022-04-26 16:01:48 +08:00
wangchuxiao
37c40d7dda work moments 2022-04-26 15:52:03 +08:00
wangchuxiao
1a2aa876e3 work moments 2022-04-26 15:06:43 +08:00
wangchuxiao
39822f323f work moments 2022-04-26 15:05:23 +08:00
wangchuxiao
338acfba75 cache rpc 2022-04-26 14:57:15 +08:00
wangchuxiao
490f4f36f1 cache rpc 2022-04-26 14:43:55 +08:00
wangchuxiao
69c46f684f cache rpc 2022-04-26 14:38:11 +08:00
wangchuxiao
1626406557 cache rpc 2022-04-26 14:13:36 +08:00
wangchuxiao
f662defcf9 cache rpc 2022-04-26 11:19:21 +08:00
wangchuxiao
8f07f8e9e1 cache rpc 2022-04-26 11:19:14 +08:00
wangchuxiao
7e44f7f110 cache rpc 2022-04-26 10:33:49 +08:00
skiffer-git
b211a66e99 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-26 09:09:44 +08:00
skiffer-git
0bdb066820 add cache 2022-04-26 09:09:33 +08:00
wenxu12345
4ee84e10fd fix bug 2022-04-25 21:13:46 +08:00
wenxu12345
ab706f4076 fix bug 2022-04-25 21:13:32 +08:00
wangchuxiao
bd7266653f cache rpc 2022-04-25 20:29:33 +08:00
wangchuxiao
08f968dced cache rpc 2022-04-25 20:20:34 +08:00
wangchuxiao
9f9ebd838a cache rpc 2022-04-25 20:16:43 +08:00
wangchuxiao
a03f89fb68 cache rpc 2022-04-25 20:05:21 +08:00
wangchuxiao
51146a4ed5 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-25 19:57:54 +08:00
wangchuxiao
80301f2cb2 alter router 2022-04-25 19:57:35 +08:00
Gordon
9a9f26c435 conversation update 2022-04-25 19:56:46 +08:00
Gordon
eebe9cbd5f conversation update 2022-04-25 19:41:17 +08:00
Gordon
503d43b552 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-25 19:15:01 +08:00
Gordon
b3077fc15d conversation update 2022-04-25 19:14:51 +08:00
wenxu12345
fdc462d071 Adjust port 2022-04-25 17:30:13 +08:00
wenxu12345
f44a26da3c Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-25 17:28:56 +08:00
wenxu12345
d12d03fd5e Adjust port 2022-04-25 17:28:43 +08:00
Gordon
51ee2df755 flag parse update 2022-04-25 17:13:54 +08:00
wenxu12345
a89bb33015 Adjust port 2022-04-25 16:58:35 +08:00
wenxu12345
7659cca8ba Adjust port 2022-04-25 16:58:05 +08:00
wenxu12345
f754e951f7 Adjust port 2022-04-25 16:55:56 +08:00
wenxu12345
e2905d01ac Adjust port 2022-04-25 16:47:51 +08:00
wenxu12345
9d691f2452 Adjust port 2022-04-25 16:21:48 +08:00
wenxu12345
a426c8bb26 Adjust port 2022-04-25 15:45:39 +08:00
wenxu12345
bc8b1722b0 config 2022-04-25 15:29:56 +08:00
wangchuxiao
ac31c612b3 work_moments 2022-04-25 10:40:31 +08:00
wangchuxiao
03c3eea54e work_moments 2022-04-25 10:35:20 +08:00
wangchuxiao
bccaf16343 work_moments 2022-04-25 10:07:14 +08:00
wangchuxiao
30df45ef2e work_moments 2022-04-24 18:49:03 +08:00
wangchuxiao
6500ba48a7 work_moments 2022-04-24 18:23:44 +08:00
wangchuxiao
03b35721a2 work_moments 2022-04-24 18:01:27 +08:00
wangchuxiao
14327d4462 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-24 18:00:18 +08:00
wangchuxiao
1b968903e2 work_moments 2022-04-24 18:00:04 +08:00
Gordon
b719e95e6e Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-24 17:54:25 +08:00
Gordon
318eb2f47d shell update 2022-04-24 17:54:02 +08:00
wangchuxiao
010f24e5c3 work_moments 2022-04-24 17:46:47 +08:00
wangchuxiao
db9762c5b2 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-24 17:44:10 +08:00
wangchuxiao
d1ebcde725 work_moments 2022-04-24 17:42:41 +08:00
Gordon
545f9cad2d add modify conversation api 2022-04-24 17:30:53 +08:00
Gordon
3247d84b6b add modify conversation api 2022-04-24 17:27:26 +08:00
Gordon
e73f0a916a add modify conversation api 2022-04-24 16:55:47 +08:00
Gordon
150af5ff8b @ people update 2022-04-24 15:55:19 +08:00
wangchuxiao
1659ab146d fix docker-compose 2022-04-24 11:57:21 +08:00
wangchuxiao
86e17d38d4 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-24 11:54:08 +08:00
Gordon
1809c59f25 config 2022-04-24 11:53:50 +08:00
wangchuxiao
4eb9661730 fix docker-compose 2022-04-24 11:50:36 +08:00
Gordon
4acbe4b31a config 2022-04-24 11:49:01 +08:00
Gordon
df17dd749f add rpc conversation 2022-04-24 11:23:54 +08:00
wangchuxiao
20e5a88e56 Merge branch 'tuoyun' 2022-04-24 10:51:20 +08:00
wangchuxiao
0a939a5b91 Merge branch 'tuoyun'
# Conflicts:
#	config/config.yaml
2022-04-24 10:38:22 +08:00
wangchuxiao
6ad7c30a18 Merge branch 'main' of github.com:OpenIMSDK/Open-IM-Server 2022-04-24 10:34:54 +08:00
wangchuxiao
e6bfc60139 Merge branch 'tuoyun'
# Conflicts:
#	config/config.yaml
2022-04-24 10:34:15 +08:00
Gordon
c866baa4eb Merge branch 'tuoyun' 2022-04-22 19:46:31 +08:00
Gordon
91303acdbe conversation update 2022-04-22 19:45:29 +08:00
Gordon
1273af4b1b Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-22 19:45:10 +08:00
Gordon
e682b408f3 conversation update 2022-04-22 19:44:58 +08:00
skiffer-git
0a0c206998 add cache 2022-04-22 18:56:39 +08:00
wangchuxiao
44ffd98d0c Merge branch 'tuoyun'
# Conflicts:
#	config/config.yaml
2022-04-22 18:37:59 +08:00
wangchuxiao
53ec93c8f8 minio config 2022-04-22 18:36:02 +08:00
wangchuxiao
f779ed7628 workMoments 2022-04-22 17:19:35 +08:00
wangchuxiao
f2fdb74f23 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-22 16:41:50 +08:00
wangchuxiao
4ba87e3349 workMoments 2022-04-22 16:41:41 +08:00
Gordon
7abee90992 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-22 15:12:21 +08:00
Gordon
159a9e00c8 conversation update 2022-04-22 15:12:10 +08:00
wangchuxiao
9c62f38345 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-21 18:39:01 +08:00
wangchuxiao
1443f5f997 workMoments 2022-04-21 18:38:48 +08:00
Gordon
17d8a124cd kick group invite group update 2022-04-21 18:09:20 +08:00
Gordon
5cd565306e kick group invite group update 2022-04-21 17:23:40 +08:00
Gordon
67010e20d7 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-21 16:47:10 +08:00
Gordon
704604f6fe kick group invite group update 2022-04-21 16:46:48 +08:00
wangchuxiao
e687f56c7f Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-21 16:14:41 +08:00
wangchuxiao
ff85575e98 workMoments 2022-04-21 16:14:26 +08:00
Gordon
26be25c218 quit group and dismiss group update 2022-04-21 14:58:57 +08:00
Gordon
d3d5e0cbfb Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-21 12:53:39 +08:00
Gordon
4796bf632c quit group and dismiss group update 2022-04-21 12:53:28 +08:00
wangchuxiao
5eef365baf workMoments 2022-04-21 11:52:31 +08:00
wangchuxiao
937ff63af9 workMoments 2022-04-21 11:34:15 +08:00
wangchuxiao
33211bfb27 workMoments 2022-04-21 11:18:11 +08:00
wangchuxiao
a243da8b1e Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-21 10:43:46 +08:00
wangchuxiao
62e605a443 workMoments 2022-04-21 10:43:31 +08:00
skiffer-git
2bdaaa5a33 log 2022-04-20 20:58:51 +08:00
Gordon
bcad3c1ced add save message to mysql switch 2022-04-20 18:53:23 +08:00
Gordon
b865f5d6e7 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-20 18:47:31 +08:00
Gordon
00664822ec conversation add fields 2022-04-20 18:47:21 +08:00
skiffer-git
4594c15de7 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-20 18:39:23 +08:00
skiffer-git
2b6ec1672c Organization 2022-04-20 18:39:12 +08:00
Gordon
d44d5711cb Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-20 18:06:53 +08:00
Gordon
54cb13ba62 pb file 2022-04-20 18:06:43 +08:00
Gordon
c32f5dd951 pb file 2022-04-20 18:06:24 +08:00
wangchuxiao
2e6c42c8ac workMoments 2022-04-20 16:33:19 +08:00
wangchuxiao
5757b86d39 workMoments 2022-04-20 16:32:22 +08:00
wangchuxiao
9df4a79827 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-20 16:25:48 +08:00
wangchuxiao
071dd46a4c workMoments 2022-04-20 16:25:33 +08:00
skiffer-git
030d619910 Organization 2022-04-20 11:53:32 +08:00
skiffer-git
c56fd399c1 Organization 2022-04-20 09:07:35 +08:00
skiffer-git
31c954db0e Organization 2022-04-19 21:28:12 +08:00
skiffer-git
cb6a040c4d Organization 2022-04-19 21:27:06 +08:00
skiffer-git
51c3a753a9 Organization 2022-04-19 20:57:59 +08:00
skiffer-git
c28c592c80 OrganizationChangedNotification 2022-04-19 18:52:28 +08:00
skiffer-git
fc07f851f7 OrganizationChangedNotification 2022-04-19 18:46:33 +08:00
skiffer-git
ab4a5e6719 OrganizationChangedNotification 2022-04-19 18:46:02 +08:00
skiffer-git
88e9dd54b2 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-19 16:41:43 +08:00
skiffer-git
f53f34559a organization 2022-04-19 16:40:57 +08:00
wangchuxiao
3e5d9a394f workMoments 2022-04-19 16:33:44 +08:00
wangchuxiao
3f287eb148 workMoments 2022-04-19 16:28:03 +08:00
wangchuxiao
dfe854a236 workMoments 2022-04-19 16:15:41 +08:00
wangchuxiao
3854c7bba2 workMoments 2022-04-19 15:52:44 +08:00
wangchuxiao
01c066419d workMoments 2022-04-19 15:38:16 +08:00
wangchuxiao
040b1d9bc8 workMoments 2022-04-19 15:37:20 +08:00
wangchuxiao
6c4acbad68 workMoments 2022-04-19 14:54:43 +08:00
wangchuxiao
b5c11ece57 workMoments 2022-04-19 14:33:48 +08:00
wangchuxiao
50696d2e88 workMoments 2022-04-19 14:12:30 +08:00
wangchuxiao
e7661fd4be Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-19 13:06:10 +08:00
wangchuxiao
957e11eff0 workMoments 2022-04-19 13:05:54 +08:00
skiffer-git
bd6e8d093a add operationID when ws connecting 2022-04-18 21:39:46 +08:00
skiffer-git
f7b5a86a09 add operationID when ws connecting 2022-04-18 21:34:58 +08:00
skiffer-git
97fd107f47 add operationID when ws connecting 2022-04-18 21:29:48 +08:00
skiffer-git
fc688dca99 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-18 21:16:56 +08:00
skiffer-git
fe3bd2a1f1 add operationID when ws connecting 2022-04-18 21:16:23 +08:00
wangchuxiao
3625befc0b Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	pkg/common/constant/constant.go
2022-04-18 19:26:26 +08:00
wangchuxiao
6e6508aafd workMoments 2022-04-18 19:24:36 +08:00
skiffer-git
3a8a0a541e organization 2022-04-18 18:11:07 +08:00
skiffer-git
650495306f organization 2022-04-18 18:06:47 +08:00
skiffer-git
5664c34790 organization 2022-04-18 18:02:11 +08:00
skiffer-git
b1c66997ca organization 2022-04-18 17:25:54 +08:00
skiffer-git
114ffd4667 organization 2022-04-18 16:58:41 +08:00
skiffer-git
ad1770ec95 organization 2022-04-18 16:46:03 +08:00
skiffer-git
5f22402761 organization 2022-04-18 16:42:50 +08:00
skiffer-git
c11094a11e organization 2022-04-18 16:27:04 +08:00
skiffer-git
6873bf384e organization 2022-04-18 16:24:12 +08:00
skiffer-git
42242daf9b organization 2022-04-18 16:18:10 +08:00
skiffer-git
1f96b960ab organization 2022-04-18 15:51:17 +08:00
skiffer-git
f6b30ed0c6 organization 2022-04-18 15:45:44 +08:00
skiffer-git
c59dc129a8 /user/get_users_online_status 2022-04-18 14:27:12 +08:00
skiffer-git
472c1a9e3e set group member nickname 2022-04-18 13:01:16 +08:00
skiffer-git
24fe8ab4a4 set group member nickname 2022-04-18 11:53:03 +08:00
skiffer-git
453c6f05bd set group member nickname 2022-04-18 11:52:49 +08:00
skiffer-git
248de7f1f2 set groupmember nickname 2022-04-18 11:52:17 +08:00
skiffer-git
3bbf84861e organization 2022-04-18 10:53:23 +08:00
skiffer-git
0dac9044a5 organization 2022-04-17 15:18:21 +08:00
skiffer-git
a981d1082a organization 2022-04-17 15:11:27 +08:00
skiffer-git
803d0c2ae2 organization 2022-04-17 15:09:18 +08:00
skiffer-git
06e44cc649 organization 2022-04-17 15:03:50 +08:00
skiffer-git
fd01e5c263 organization 2022-04-17 15:01:26 +08:00
skiffer-git
ecc47dcfbb organization 2022-04-17 14:54:51 +08:00
skiffer-git
b6e06dfdc2 organization 2022-04-17 14:47:52 +08:00
skiffer-git
eb630b23ae organization 2022-04-17 14:45:45 +08:00
skiffer-git
eae7a48991 organization 2022-04-17 14:44:44 +08:00
skiffer-git
9436c836e6 organization 2022-04-17 14:42:07 +08:00
skiffer-git
7c64239b36 organization 2022-04-17 14:39:48 +08:00
skiffer-git
80ba371296 organization 2022-04-17 12:41:42 +08:00
skiffer-git
6787563efe organization 2022-04-17 12:37:00 +08:00
skiffer-git
9def85f9ba organization 2022-04-17 12:32:28 +08:00
skiffer-git
6d55f35404 organization 2022-04-17 11:59:31 +08:00
skiffer-git
1902c37924 organization 2022-04-17 11:51:36 +08:00
skiffer-git
02b5ff38a4 organization 2022-04-16 21:41:38 +08:00
skiffer-git
f076a927c9 organization 2022-04-16 21:34:29 +08:00
skiffer-git
6184eaa30e organization 2022-04-16 21:32:53 +08:00
skiffer-git
a42b72e9ce organization 2022-04-16 21:31:28 +08:00
skiffer-git
f4dcae722c organization 2022-04-16 21:28:37 +08:00
skiffer-git
bbcb3e9403 organization 2022-04-16 21:26:16 +08:00
skiffer-git
3d690b7c72 organization 2022-04-16 21:23:38 +08:00
skiffer-git
b4ab2c69ae organization 2022-04-16 21:20:17 +08:00
skiffer-git
4a7f406edb organization 2022-04-16 21:17:32 +08:00
skiffer-git
9e18bcaeb8 organization 2022-04-16 21:14:28 +08:00
skiffer-git
9abfe233bc organization 2022-04-16 21:10:46 +08:00
skiffer-git
3267958541 organization 2022-04-16 20:59:38 +08:00
skiffer-git
af5ee45206 organization 2022-04-16 20:56:28 +08:00
skiffer-git
300b72b9b8 organization 2022-04-16 20:47:00 +08:00
skiffer-git
42af55a740 organization 2022-04-16 20:45:41 +08:00
skiffer-git
3c1e6d0e5c organization 2022-04-16 20:42:50 +08:00
skiffer-git
edf7df368e organization 2022-04-16 20:30:02 +08:00
skiffer-git
cde38e012f organization 2022-04-16 20:27:18 +08:00
skiffer-git
bef4f0c4e2 organization 2022-04-16 20:25:01 +08:00
skiffer-git
bf081dce32 organization 2022-04-16 20:22:01 +08:00
skiffer-git
0bb3cb4aab organization 2022-04-16 20:19:24 +08:00
skiffer-git
0d5132f710 organization 2022-04-16 20:17:21 +08:00
skiffer-git
cad147faf8 organization 2022-04-16 20:14:47 +08:00
skiffer-git
cc405b83e2 organization 2022-04-16 20:10:10 +08:00
skiffer-git
c65f5b7279 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-15 20:37:26 +08:00
skiffer-git
c216340120 organization 2022-04-15 19:48:17 +08:00
wangchuxiao
ff5cbc490e getui 2022-04-15 18:22:27 +08:00
wangchuxiao
27cba5ba31 getui 2022-04-15 18:16:28 +08:00
wangchuxiao
9976b8132f getui 2022-04-15 17:45:33 +08:00
wangchuxiao
dbc5bd96f3 getui 2022-04-15 17:43:04 +08:00
wangchuxiao
9489ab862b getui 2022-04-15 12:10:33 +08:00
wangchuxiao
1bb634bc6f merge code 2022-04-15 12:03:23 +08:00
wangchuxiao
07b5c7fef4 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-15 11:58:32 +08:00
wangchuxiao
4a7cfab543 getui 2022-04-15 11:56:36 +08:00
Gordon
426ef5cb88 push update 2022-04-13 18:34:36 +08:00
Gordon
5b86412407 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-13 18:33:35 +08:00
Gordon
4f8fcd2d3d push update 2022-04-13 18:33:22 +08:00
wangchuxiao
16c40aa51c getui 2022-04-13 16:25:33 +08:00
Gordon
6449c4a53d push update 2022-04-13 16:20:30 +08:00
wangchuxiao
d670356388 getui 2022-04-13 15:29:35 +08:00
wangchuxiao
fb4c8549dc Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-13 15:22:03 +08:00
wangchuxiao
42dc5c1f0f getui 2022-04-13 15:21:53 +08:00
skiffer-git
659c3bc1cf add department db 2022-04-13 08:58:52 +08:00
skiffer-git
f5684f2c45 add department db 2022-04-13 08:58:16 +08:00
skiffer-git
1d2d2b1c9c Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-12 22:07:03 +08:00
skiffer-git
bc06ba54b9 organization && department 2022-04-12 22:02:43 +08:00
wangchuxiao
1b6e223456 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-12 11:13:17 +08:00
wangchuxiao
9e4a2168c0 getui 2022-04-12 11:12:36 +08:00
Gordon
46aa26a444 version code 2022-04-12 09:51:25 +08:00
wangchuxiao
4d01aa3006 getui 2022-04-11 18:12:00 +08:00
wangchuxiao
2c308af615 getui 2022-04-11 17:58:23 +08:00
wangchuxiao
caf4ab60cd minio add inner ip 2022-04-11 17:08:54 +08:00
wangchuxiao
4a8d37bde1 getui 2022-04-11 16:18:36 +08:00
wangchuxiao
3289dd8419 Merge branch 'tuoyun' 2022-04-11 15:09:24 +08:00
wangchuxiao
13473eeb4d getui 2022-04-11 14:44:58 +08:00
wangchuxiao
4264cd8830 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-11 14:43:15 +08:00
wangchuxiao
edcc215774 getui 2022-04-11 14:41:09 +08:00
skiffer-git
3085fffb49 add department db 2022-04-11 14:08:23 +08:00
wangchuxiao
81a6e4b46c getui 2022-04-11 11:31:20 +08:00
wangchuxiao
e0d612c92f getui 2022-04-11 10:35:33 +08:00
wangchuxiao
fadbb91287 getui 2022-04-08 19:31:13 +08:00
wangchuxiao
72146c08ae getui 2022-04-08 19:18:00 +08:00
wangchuxiao
0c7cb274b4 Merge branch 'tuoyun' 2022-04-08 18:37:35 +08:00
wangchuxiao
a08c499c95 getui 2022-04-08 18:35:53 +08:00
wangchuxiao
a879bbce59 getui 2022-04-08 18:29:54 +08:00
wangchuxiao
f11f8b3e0e getui 2022-04-08 18:27:20 +08:00
wangchuxiao
7842545627 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-08 18:01:11 +08:00
Gordon
2a0f8f5ce3 note 2022-04-08 17:55:44 +08:00
wangchuxiao
4ae3ad7abd getui 2022-04-08 17:48:16 +08:00
wangchuxiao
a16025ca95 getui 2022-04-08 17:41:39 +08:00
wangchuxiao
fdefe09187 getui 2022-04-08 17:32:58 +08:00
wangchuxiao
06370a763c getui 2022-04-08 17:20:55 +08:00
wangchuxiao
691e2580e5 getui 2022-04-08 17:17:26 +08:00
wangchuxiao
f40369d061 getui 2022-04-08 17:12:11 +08:00
wangchuxiao
046c523880 getui 2022-04-08 17:00:28 +08:00
wangchuxiao
b3b7ae26cf getui 2022-04-08 16:40:39 +08:00
wangchuxiao
49424b8b56 getui 2022-04-08 16:23:53 +08:00
wenxu12345
68ff4a52dc Merge remote-tracking branch 'origin/main' 2022-04-08 16:21:12 +08:00
wenxu12345
07c932e9e6 v2.0.7 2022-04-08 16:20:41 +08:00
wangchuxiao
cbe3abeab0 getui 2022-04-08 16:15:22 +08:00
wangchuxiao
3d5e3ce6cf Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
# Conflicts:
#	internal/rpc/msg/tag_send_msg.go
2022-04-08 15:43:55 +08:00
wangchuxiao
4efdabc1ff getui 2022-04-08 15:40:07 +08:00
Gordon
8ca495ec50 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-06 16:47:32 +08:00
Gordon
69aba02c9a send tag modify 2022-04-06 16:47:22 +08:00
wenxu12345
42225dd35e log 2022-04-06 15:54:59 +08:00
wenxu12345
ad4c9fcc83 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-06 15:33:30 +08:00
wenxu12345
ef4d0c3c42 log 2022-04-06 15:33:16 +08:00
Gordon
59cc45eaab replace log 2022-04-06 14:41:36 +08:00
Gordon
f64c40e91f tag msg 2022-04-06 14:31:25 +08:00
Gordon
46d7d30089 shell update 2022-04-06 12:01:29 +08:00
Gordon
48f15bb71c shell update 2022-04-06 11:59:30 +08:00
Gordon
ac70b1d11b Merge branch 'tuoyun' 2022-04-06 11:56:22 +08:00
Gordon
d720082644 shell update 2022-04-06 11:47:01 +08:00
Gordon
1f45b642e9 build modify 2022-04-05 20:11:57 +08:00
Gordon
83228d8aa6 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-05 20:10:35 +08:00
Gordon
34f1e50f90 build modify 2022-04-05 20:10:05 +08:00
wenxu12345
b0c518a0d6 log 2022-04-05 20:06:15 +08:00
wenxu12345
aa673a3a5c log 2022-04-05 20:06:08 +08:00
wenxu12345
40d58f6bc2 log 2022-04-05 19:49:49 +08:00
wenxu12345
7604b24ffc log 2022-04-05 19:48:31 +08:00
wenxu12345
a47c0c91a3 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-05 19:31:52 +08:00
wenxu12345
0232f52281 log 2022-04-05 19:31:35 +08:00
Gordon
08eba71c8a remove timer 2022-04-05 17:50:26 +08:00
Gordon
577a9249d1 test 2022-04-05 17:31:32 +08:00
Gordon
ea6461bd0a Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-05 17:20:32 +08:00
Gordon
f58c94146a test 2022-04-05 17:20:22 +08:00
wenxu12345
6efe13d142 log 2022-04-05 16:41:37 +08:00
wenxu12345
0a8fdc6cc8 set gin log 2022-04-05 16:24:34 +08:00
wenxu12345
b91b298174 Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts:
#	cmd/Open-IM-SDK-Core
2022-04-05 15:08:25 +08:00
wenxu12345
f87038622b set gin log 2022-04-05 15:07:34 +08:00
Gordon
8b077848bb Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-05 14:56:39 +08:00
Gordon
2945e6f8bf test 2022-04-05 14:56:29 +08:00
wenxu12345
0f760dc388 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-04-05 14:48:03 +08:00
wenxu12345
5a9b5db99b Check environment before deployment 2022-04-05 14:47:47 +08:00
wangchuxiao
6ba51fb338 tag and set private tips 2022-04-05 14:27:13 +08:00
wangchuxiao
146aa497f9 tag and set private tips 2022-04-05 12:09:55 +08:00
wangchuxiao
e7bc82d152 tag and set private tips 2022-04-05 12:03:54 +08:00
wangchuxiao
26f8172b1a tag and set private tips 2022-04-05 11:55:40 +08:00
wangchuxiao
634584400a tag and set private tips 2022-04-05 11:50:26 +08:00
wangchuxiao
7d6be79ba8 tag and set private tips 2022-04-05 10:33:50 +08:00
wangchuxiao
cef208f6ef Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-04-05 10:27:43 +08:00
wangchuxiao
f4921d1317 tag and set private tips 2022-04-05 10:27:34 +08:00
Gordon
7f1a74b576 panic fix 2022-04-01 20:40:58 +08:00
wangchuxiao
3dc11777c6 minio cfg 2022-04-01 19:23:22 +08:00
wangchuxiao
b536165910 Merge branch 'tuoyun' 2022-04-01 19:19:10 +08:00
wenxu12345
7c7aa9e7a7 v2.0.6 2022-04-01 18:45:10 +08:00
wangchuxiao
2b03b57b5c tag and set private tips 2022-04-01 15:59:49 +08:00
wangchuxiao
77c6120014 null to empty slice 2022-04-01 15:32:24 +08:00
wangchuxiao
b82ff7b88d tips info 2022-04-01 14:49:48 +08:00
wangchuxiao
a16a75230c tag and set private tips 2022-04-01 14:43:31 +08:00
wangchuxiao
0e27b302bc tag and set private tips 2022-03-31 19:49:04 +08:00
wangchuxiao
c369ab9b1c Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-31 19:45:57 +08:00
wangchuxiao
bb267ccae7 tag and set private tips 2022-03-31 19:17:37 +08:00
Gordon
efe24658a4 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-31 18:38:05 +08:00
Gordon
5cdf9e7551 OA tag fields modify 2022-03-31 18:36:15 +08:00
wangchuxiao
4390302384 tag and set private tips 2022-03-31 16:50:46 +08:00
wangchuxiao
dab00e7fb2 tag and set private tips 2022-03-31 15:01:49 +08:00
wangchuxiao
929c5e7a5b Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-31 14:50:17 +08:00
wangchuxiao
d600042110 tag and set private tips 2022-03-31 14:50:02 +08:00
Gordon
0a58e7433e Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-31 11:43:25 +08:00
Gordon
5639c985df OA tag fields modify 2022-03-31 11:43:14 +08:00
wenxu12345
9fbfbfb23b Merge log files 2022-03-31 11:28:51 +08:00
wenxu12345
ecd2f0e2bf Merge log files 2022-03-31 11:15:06 +08:00
Gordon
60418276bd oa notification add 2022-03-30 20:04:12 +08:00
Gordon
170392f0bc oa notification add 2022-03-30 18:23:05 +08:00
Gordon
6744745152 token add operationID 2022-03-30 15:52:04 +08:00
skiffer-git
009ae6a235 mute group 2022-03-29 18:54:55 +08:00
skiffer-git
bf5f72c00b mute group 2022-03-29 18:36:24 +08:00
skiffer-git
84aca5b9e1 mute group 2022-03-29 18:29:19 +08:00
skiffer-git
6164266870 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 18:24:22 +08:00
skiffer-git
cc9df9c586 mute group 2022-03-29 18:24:10 +08:00
wangchuxiao
29a268d476 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-29 17:33:13 +08:00
wangchuxiao
18d7aab703 tag 2022-03-29 17:33:06 +08:00
skiffer-git
373e6b6c8e mute group 2022-03-29 17:29:05 +08:00
skiffer-git
71fab4f6be Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 17:24:55 +08:00
skiffer-git
de55c14a16 mute group 2022-03-29 17:24:46 +08:00
Gordon
e8517e954d group add 2022-03-29 17:20:37 +08:00
Gordon
78281fc82c Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 17:16:02 +08:00
Gordon
bc260fffde group add 2022-03-29 17:15:51 +08:00
skiffer-git
db00a08bdc Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 17:03:17 +08:00
skiffer-git
85cf7f26ce mute group 2022-03-29 17:03:06 +08:00
Gordon
acca147ff2 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 16:56:43 +08:00
Gordon
d53da0e422 group add 2022-03-29 16:56:33 +08:00
skiffer-git
11eaaab72d Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 16:32:43 +08:00
skiffer-git
475e64fc5b mute group 2022-03-29 16:32:25 +08:00
wangchuxiao
1bd8154ac4 tag 2022-03-29 16:15:37 +08:00
wangchuxiao
d2fa0e7852 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-29 16:10:43 +08:00
wangchuxiao
f2b324abc2 tag 2022-03-29 16:10:36 +08:00
skiffer-git
d2225dd841 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 16:05:16 +08:00
skiffer-git
8d26aa86b9 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 16:05:08 +08:00
wangchuxiao
7e937d7d29 tag 2022-03-29 16:04:54 +08:00
skiffer-git
fe4b534b78 mute group 2022-03-29 16:04:15 +08:00
wangchuxiao
d0a65c7c68 tag 2022-03-29 15:58:42 +08:00
wangchuxiao
416f87f4bb tag 2022-03-29 15:50:20 +08:00
wangchuxiao
7eeb67be28 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-29 15:35:18 +08:00
wangchuxiao
7ed6ee5075 tag 2022-03-29 15:35:03 +08:00
wenxu12345
d3c8215e15 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 13:31:19 +08:00
wenxu12345
30bc6c274e mute group 2022-03-29 13:30:54 +08:00
skiffer-git
ecb1068f0b mute group 2022-03-29 12:40:08 +08:00
wenxu12345
f6eef21b45 mute group 2022-03-29 11:55:48 +08:00
skiffer-git
1aeff25316 mute group 2022-03-29 11:48:17 +08:00
skiffer-git
6de569537f Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-29 11:36:11 +08:00
skiffer-git
764bc3fead mute group 2022-03-29 11:35:53 +08:00
Gordon
a89d617532 group add 2022-03-29 11:27:19 +08:00
Gordon
fef33795d0 group add 2022-03-29 11:16:03 +08:00
Gordon
d2c04b761d ali cloud oss 2022-03-29 11:01:54 +08:00
Gordon
c5828aba91 Merge branch 'tuoyun'
# Conflicts:
#	cmd/open_im_api/main.go
#	config/config.yaml
#	go.sum
#	pkg/common/config/config.go
#	pkg/common/db/model.go
2022-03-29 10:58:01 +08:00
skiffer-git
1286f9dcb6 mute group 2022-03-29 09:34:45 +08:00
skiffer-git
391e525fc5 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-28 19:27:23 +08:00
skiffer-git
afc32b1cfa mute group 2022-03-28 19:27:05 +08:00
wangchuxiao
0797181967 tag 2022-03-28 19:18:30 +08:00
wangchuxiao
14c5e631ff tag 2022-03-28 19:15:59 +08:00
wangchuxiao
5cdb039c33 tag 2022-03-28 19:12:31 +08:00
wangchuxiao
a11c4fcb58 tag 2022-03-28 19:05:58 +08:00
wangchuxiao
c67a937d40 tag 2022-03-28 18:53:57 +08:00
wangchuxiao
03fa7137b9 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-28 18:52:02 +08:00
wangchuxiao
e95400988e tag 2022-03-28 18:51:48 +08:00
Gordon
942c9c6a63 Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-28 18:30:21 +08:00
Gordon
6c45665fde add tag message conversation update 2022-03-28 18:30:12 +08:00
wangchuxiao
d92ac8f588 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-28 18:13:08 +08:00
wangchuxiao
169665da32 tag 2022-03-28 18:13:01 +08:00
Gordon
c4d80b4844 auto migrate test 2022-03-28 17:52:40 +08:00
Gordon
7827749453 tag notification 2022-03-28 17:37:30 +08:00
wangchuxiao
5e78697a69 tag 2022-03-28 17:22:18 +08:00
wangchuxiao
a0e6a78496 tag 2022-03-28 17:18:03 +08:00
wangchuxiao
af99a93536 tag 2022-03-28 17:12:36 +08:00
wangchuxiao
e9ea117985 tag 2022-03-28 17:10:45 +08:00
wangchuxiao
b9ddb0140f tag 2022-03-28 17:02:03 +08:00
wangchuxiao
dae70371d1 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-28 16:59:39 +08:00
wangchuxiao
228cbb4082 tag 2022-03-28 16:59:15 +08:00
Gordon
679c913f3a Merge remote-tracking branch 'origin/tuoyun' into tuoyun 2022-03-28 16:57:24 +08:00
Gordon
03fb7947c3 add oa notification 2022-03-28 16:57:08 +08:00
wangchuxiao
c39f5a27b2 tag 2022-03-28 16:49:19 +08:00
wangchuxiao
dbdb516f3c tag 2022-03-28 16:42:18 +08:00
wangchuxiao
c1a97b7356 tag 2022-03-28 16:20:20 +08:00
wangchuxiao
a6d8f7ea24 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-28 16:03:16 +08:00
wangchuxiao
574c7600e0 tag 2022-03-28 16:02:31 +08:00
Gordon
d1c0205d77 add oa notification 2022-03-28 15:55:55 +08:00
wangchuxiao
13c29d2c1e tag 2022-03-28 15:04:42 +08:00
wangchuxiao
dc1a0f050e tag 2022-03-28 14:54:46 +08:00
wangchuxiao
e252a00d55 tag 2022-03-28 14:11:47 +08:00
Gordon
5bedbb7c7d script modify 2022-03-28 12:56:59 +08:00
wangchuxiao
e510418152 Merge branch 'office_tag' into tuoyun 2022-03-28 12:17:48 +08:00
wangchuxiao
8197ae6aa7 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-03-28 12:17:32 +08:00
wangchuxiao
9d619d520d tag 2022-03-28 12:17:07 +08:00
wangchuxiao
46605479e9 Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into office_tag 2022-03-25 18:48:30 +08:00
wangchuxiao
6d20eddd43 mongo 2022-03-25 18:46:27 +08:00
skiffer-git
c1ee2a0adb Update docker-compose.yaml 2022-03-25 12:48:11 +08:00
skiffer-git
a4788a95af Update issue templates 2022-03-23 11:33:35 +08:00
skiffer-git
c1a210313e Update issue templates 2022-03-23 11:28:08 +08:00
skiffer-git
ab0ed67f81 Update issue templates 2022-03-23 11:26:25 +08:00
skiffer-git
5d54d5b7d6 Update issue templates 2022-03-23 11:25:59 +08:00
Gordon
a2b65f52f6 fix group create bug 2022-03-21 15:45:26 +08:00
jaonzyx
c16d8da784 管理员创建群组bug fix (#168) 2022-03-21 15:43:43 +08:00
goubo
a55582a018 方便测试导入数据 (#148) 2022-03-21 15:25:41 +08:00
Gordon
ea6d472002 pr modify and update 2022-03-21 14:59:00 +08:00
Gordon
3dc4290f2a pr modify and update 2022-03-21 14:57:35 +08:00
hxnets
6c43f75f9f 新增阿里云OSS文件上传参数获取接口 (#115)
* configure update

* mongo:4.0

* open-im-server -> open_im_server

* sleep 15

* 0.0.0.0

* sleep 10 15

* Update config.yaml

* config

* Update docker-compose.yaml

* Update config.yaml

* Create ISSUE_TEMPLATE.md

* Update ISSUE_TEMPLATE.md

* Create ISSUE_TEMPLATE

* add issue template

* add issue template

* add issue template

* add issue template

* Update README.md

* script

* script

* script

* config

* script

* config update

* script update

* image: openim/open_im_server:v1.0.6

* script

* script

* script

* version update

* sender message sync

* version update

* 阿里云oss sts上传参数

* 阿里云oss sts上传参数

Co-authored-by: wenxu12345 <44203734@qq.com>
Co-authored-by: skiffer-git <72860476+skiffer-git@users.noreply.github.com>
Co-authored-by: Gordon <1432970085@qq.com>
Co-authored-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
2022-03-21 14:43:41 +08:00
Sunny
e0c6972bed Update config.yaml (#167)
Co-authored-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
2022-03-21 11:19:10 +08:00
马守越
1ab3e04cba 新增mongo.dbUrl配置 (#174)
* 当dbUri值不为空则直接使用该值

* 新增支持ali oss

Co-authored-by: mashouyue's m1max <mashouyue@toowow.cn>
2022-03-21 11:13:17 +08:00
Arthur
1b8f664c8a fix: json tag value of UserIDResult.UserID (#178)
Signed-off-by: arthur <yang_yapo@126.com>
2022-03-21 11:03:46 +08:00
Gordon
7637b2bec2 check shell update 2022-03-18 19:08:31 +08:00
wenxu12345
cfab49a7dd friendVerify 2022-03-18 17:44:50 +08:00
wenxu12345
91b9e50fd0 2.0.4 2022-03-18 17:21:04 +08:00
wenxu12345
ebf7a1d40d v2.0.3 image 2022-03-14 10:23:44 +08:00
Judgelight
d3a38963ae Merge pull request #173 from OpenIMSDK/tuoyun
Tuoyun
2022-03-11 18:44:48 +08:00
280 changed files with 58754 additions and 9076 deletions

View File

@@ -0,0 +1,37 @@
---
name: "\U0001F41E Bug"
about: File a bug/issue
title: "[BUG] <title>"
labels: ''
assignees: ''
---
<!--
Note: Please search to see if an issue already exists for the bug you encountered.
-->
### Environment:
<!-- linux? windows? or Mac?
Example:
- OS: Ubuntu 20.04 -->
### Physical Memory Capacity:
<!-- 8G or above is better -->
### Docker Image:
<!-- Did you pull the docker image before execute docker images -->
### Code Version:
<!-- Did you pull code from github? Make sure the code is up to date-->
### Component installation:
<!-- Has etcd, mysql, mongodb, redis or Kafka been installed on the server before Open-IM-Server deployment-->
### Log File:
<!-- view log file(logs/openIM.log) content. -->
### screenshot:
<!---->

View File

@@ -0,0 +1,36 @@
---
name: Deployment issues
about: Deployment issues
title: ''
labels: ''
assignees: ''
---
If you are deploying OpenIM for the first time
```
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
```
screenshot here
```
cd Open-IM-Server/script ; chmod +x *.sh ; ./env_check.sh
```
screenshot here
```
cd .. ; docker-compose up -d
```
screenshot here
```
cd script ; ./docker_check_service.sh
```
screenshot here

38
.github/ISSUE_TEMPLATE/update-.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: 'update '
about: update docker image
title: update docker image
labels: ''
assignees: ''
---
```
cd Open-IM-Server ; docker-compose down
```
screenshot here
```
git pull
```
screenshot here
```
docker-compose pull
```
screenshot here
```
chmod +x script/*.sh ; docker-compose up -d
```
screenshot here
```
cd script ; ./docker_check_service.sh
```
screenshot here

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ out-test
.github
.idea
deploy/open_im_demo
deploy/open_im_api
deploy/open_im_msg_gateway

View File

@@ -1,4 +1,5 @@
# Open-IM-Server
![avatar](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg)
![avatar](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/open-im-logo.png)
@@ -92,6 +93,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server
4. Start docker-compose with one click(Docker automatically pulls all images)
```
cd Open-IM-Server
docker-compose up -d
```
@@ -99,6 +101,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server
```
./docker_check_service.sh
./check_all.sh
```
![OpenIMServersondockerpng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-docker.png)

8528
cmd/open_im_api/docs/docs.go Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,33 +1,66 @@
package main
import (
_ "Open_IM/cmd/open_im_api/docs"
apiAuth "Open_IM/internal/api/auth"
apiChat "Open_IM/internal/api/chat"
"Open_IM/internal/api/conversation"
"Open_IM/internal/api/friend"
"Open_IM/internal/api/group"
"Open_IM/internal/api/manage"
"Open_IM/internal/api/office"
"Open_IM/internal/api/organization"
apiThird "Open_IM/internal/api/third"
"Open_IM/internal/api/user"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"flag"
"fmt"
//_ "github.com/razeencheng/demo-go/swaggo-gin/docs"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
"io"
"os"
"strconv"
"github.com/gin-gonic/gin"
//"syscall"
"Open_IM/pkg/common/constant"
)
// @title open-IM-Server API
// @version 1.0
// @description open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @BasePath /
func main() {
log.NewPrivateLog(constant.LogFileName)
gin.SetMode(gin.ReleaseMode)
f, _ := os.Create("../logs/api.log")
gin.DefaultWriter = io.MultiWriter(f)
gin.SetMode(gin.DebugMode)
r := gin.Default()
r.Use(utils.CorsHandler())
log.Info("load config: ", config.Config)
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
// user routing group, which handles user registration and login services
userRouterGroup := r.Group("/user")
{
userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1
userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1
userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1
userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1
userRouterGroup.POST("/set_global_msg_recv_opt", user.SetGlobalRecvMessageOpt)
userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1
userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1
userRouterGroup.POST("/get_users_online_status", user.GetUsersOnlineStatus) //1
userRouterGroup.POST("/get_users_info_from_cache", user.GetUsersInfoFromCache)
userRouterGroup.POST("/get_user_friend_from_cache", user.GetFriendIDListFromCache)
userRouterGroup.POST("/get_black_list_from_cache", user.GetBlackIDListFromCache)
userRouterGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1
userRouterGroup.POST("/account_check", manage.AccountCheck) //1
// userRouterGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1
}
//friend routing group
friendRouterGroup := r.Group("/friend")
@@ -53,7 +86,7 @@ func main() {
{
groupRouterGroup.POST("/create_group", group.CreateGroup) //1
groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) //1
groupRouterGroup.POST("join_group", group.JoinGroup) //1
groupRouterGroup.POST("/join_group", group.JoinGroup) //1
groupRouterGroup.POST("/quit_group", group.QuitGroup) //1
groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse) //1
groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner) //1
@@ -65,21 +98,39 @@ func main() {
groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMemberList) //1
groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1
groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1
groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) //1
groupRouterGroup.POST("/dismiss_group", group.DismissGroup)
groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList)
groupRouterGroup.POST("/dismiss_group", group.DismissGroup) //
groupRouterGroup.POST("/mute_group_member", group.MuteGroupMember)
groupRouterGroup.POST("/cancel_mute_group_member", group.CancelMuteGroupMember) //MuteGroup
groupRouterGroup.POST("/mute_group", group.MuteGroup)
groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup)
groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname)
groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo)
}
superGroupRouterGroup := r.Group("/super_group")
{
superGroupRouterGroup.POST("/get_joined_group_list", group.GetJoinedSuperGroupList)
superGroupRouterGroup.POST("/get_groups_info", group.GetSuperGroupsInfo)
}
//certificate
authRouterGroup := r.Group("/auth")
{
authRouterGroup.POST("/user_register", apiAuth.UserRegister) //1
authRouterGroup.POST("/user_token", apiAuth.UserToken) //1
authRouterGroup.POST("/parse_token", apiAuth.ParseToken) //1
authRouterGroup.POST("/force_logout", apiAuth.ForceLogout) //1
}
//Third service
thirdGroup := r.Group("/third")
{
thirdGroup.POST("/tencent_cloud_storage_credential", apiThird.TencentCloudStorageCredential)
thirdGroup.POST("/ali_oss_credential", apiThird.AliOSSCredential)
thirdGroup.POST("/minio_storage_credential", apiThird.MinioStorageCredential)
thirdGroup.POST("/minio_upload", apiThird.MinioUploadFile)
thirdGroup.POST("/upload_update_app", apiThird.UploadUpdateApp)
thirdGroup.POST("/get_download_url", apiThird.GetDownloadURL)
thirdGroup.POST("/get_rtc_invitation_info", apiThird.GetRTCInvitationInfo)
thirdGroup.POST("/get_rtc_invitation_start_app", apiThird.GetRTCInvitationInfoStartApp)
}
//Message
chatGroup := r.Group("/msg")
@@ -88,15 +139,14 @@ func main() {
chatGroup.POST("/send_msg", apiChat.SendMsg)
chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList)
chatGroup.POST("/del_msg", apiChat.DelMsg)
chatGroup.POST("/clear_msg", apiChat.ClearMsg)
chatGroup.POST("/manage_send_msg", manage.ManagementSendMsg)
chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg)
}
//Manager
managementGroup := r.Group("/manager")
{
managementGroup.POST("/delete_user", manage.DeleteUser) //1
managementGroup.POST("/send_msg", manage.ManagementSendMsg)
managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1
managementGroup.POST("/account_check", manage.AccountCheck) //1
managementGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1
}
//Conversation
conversationGroup := r.Group("/conversation")
@@ -107,13 +157,63 @@ func main() {
conversationGroup.POST("/set_conversation", conversation.SetConversation)
conversationGroup.POST("/batch_set_conversation", conversation.BatchSetConversations)
conversationGroup.POST("/set_recv_msg_opt", conversation.SetRecvMsgOpt)
conversationGroup.POST("/modify_conversation_field", conversation.ModifyConversationField)
}
apiThird.MinioInit()
log.NewPrivateLog("api")
ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port")
// office
officeGroup := r.Group("/office")
{
officeGroup.POST("/get_user_tags", office.GetUserTags)
officeGroup.POST("/get_user_tag_by_id", office.GetUserTagByID)
officeGroup.POST("/create_tag", office.CreateTag)
officeGroup.POST("/delete_tag", office.DeleteTag)
officeGroup.POST("/set_tag", office.SetTag)
officeGroup.POST("/send_msg_to_tag", office.SendMsg2Tag)
officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs)
officeGroup.POST("/create_one_work_moment", office.CreateOneWorkMoment)
officeGroup.POST("/delete_one_work_moment", office.DeleteOneWorkMoment)
officeGroup.POST("/like_one_work_moment", office.LikeOneWorkMoment)
officeGroup.POST("/comment_one_work_moment", office.CommentOneWorkMoment)
officeGroup.POST("/get_work_moment_by_id", office.GetWorkMomentByID)
officeGroup.POST("/get_user_work_moments", office.GetUserWorkMoments)
officeGroup.POST("/get_user_friend_work_moments", office.GetUserFriendWorkMoments)
officeGroup.POST("/set_user_work_moments_level", office.SetUserWorkMomentsLevel)
officeGroup.POST("/delete_comment", office.DeleteComment)
}
organizationGroup := r.Group("/organization")
{
organizationGroup.POST("/create_department", organization.CreateDepartment)
organizationGroup.POST("/update_department", organization.UpdateDepartment)
organizationGroup.POST("/get_sub_department", organization.GetSubDepartment)
organizationGroup.POST("/delete_department", organization.DeleteDepartment)
organizationGroup.POST("/get_all_department", organization.GetAllDepartment)
organizationGroup.POST("/create_organization_user", organization.CreateOrganizationUser)
organizationGroup.POST("/update_organization_user", organization.UpdateOrganizationUser)
organizationGroup.POST("/delete_organization_user", organization.DeleteOrganizationUser)
organizationGroup.POST("/create_department_member", organization.CreateDepartmentMember)
organizationGroup.POST("/get_user_in_department", organization.GetUserInDepartment)
organizationGroup.POST("/update_user_in_department", organization.UpdateUserInDepartment)
organizationGroup.POST("/get_department_member", organization.GetDepartmentMember)
organizationGroup.POST("/delete_user_in_department", organization.DeleteUserInDepartment)
}
go apiThird.MinioInit()
defaultPorts := config.Config.Api.GinPort
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10002 as port")
flag.Parse()
err := r.Run(":" + strconv.Itoa(*ginPort))
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
if config.Config.Api.ListenIP != "" {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
}
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
fmt.Println("start api server, address: ", address)
err := r.Run(address)
if err != nil {
log.NewError("", utils.GetSelfFuncName(), "start gin failed", err.Error())
log.Error("", "run failed ", *ginPort, err.Error())
}
}

View File

@@ -3,7 +3,11 @@ package main
import (
"Open_IM/internal/cms_api"
"Open_IM/pkg/utils"
"flag"
"fmt"
"strconv"
"Open_IM/pkg/common/config"
"github.com/gin-gonic/gin"
)
@@ -11,5 +15,14 @@ func main() {
gin.SetMode(gin.ReleaseMode)
router := cms_api.NewGinRouter()
router.Use(utils.CorsHandler())
router.Run(":" + "8000")
defaultPorts := config.Config.CmsApi.GinPort
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10006 as port")
flag.Parse()
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
if config.Config.Api.ListenIP != "" {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
}
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
fmt.Println("start cms api server, address: ", address)
router.Run(address)
}

View File

@@ -2,20 +2,29 @@ package main
import (
"Open_IM/internal/demo/register"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"flag"
"fmt"
"io"
"os"
"strconv"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"github.com/gin-gonic/gin"
)
func main() {
log.NewPrivateLog(constant.LogFileName)
gin.SetMode(gin.ReleaseMode)
f, _ := os.Create("../logs/api.log")
gin.DefaultWriter = io.MultiWriter(f)
r := gin.Default()
r.Use(utils.CorsHandler())
authRouterGroup := r.Group("/auth")
authRouterGroup := r.Group("/demo")
{
authRouterGroup.POST("/code", register.SendVerificationCode)
authRouterGroup.POST("/verify", register.Verify)
@@ -23,8 +32,26 @@ func main() {
authRouterGroup.POST("/login", register.Login)
authRouterGroup.POST("/reset_password", register.ResetPassword)
}
log.NewPrivateLog("demo")
ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port")
demoRouterGroup := r.Group("/auth")
{
demoRouterGroup.POST("/code", register.SendVerificationCode)
demoRouterGroup.POST("/verify", register.Verify)
demoRouterGroup.POST("/password", register.SetPassword)
demoRouterGroup.POST("/login", register.Login)
demoRouterGroup.POST("/reset_password", register.ResetPassword)
}
defaultPorts := config.Config.Demo.Port
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 42233 as port")
flag.Parse()
r.Run(":" + strconv.Itoa(*ginPort))
fmt.Println("start demo api server, port: ", *ginPort)
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
if config.Config.Api.ListenIP != "" {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
}
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
fmt.Println("start demo api server address: ", address)
err := r.Run(address)
if err != nil {
log.Error("", "run failed ", *ginPort, err.Error())
}
}

View File

@@ -2,16 +2,24 @@ package main
import (
"Open_IM/internal/msg_gateway/gate"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"flag"
"fmt"
"sync"
)
func main() {
rpcPort := flag.Int("rpc_port", 10400, "rpc listening port")
wsPort := flag.Int("ws_port", 17778, "ws listening port")
log.NewPrivateLog(constant.LogFileName)
defaultRpcPorts := config.Config.RpcPort.OpenImMessageGatewayPort
defaultWsPorts := config.Config.LongConnSvr.WebsocketPort
rpcPort := flag.Int("rpc_port", defaultRpcPorts[0], "rpc listening port")
wsPort := flag.Int("ws_port", defaultWsPorts[0], "ws listening port")
flag.Parse()
var wg sync.WaitGroup
wg.Add(1)
fmt.Println("start rpc/msg_gateway server, port: ", *rpcPort, *wsPort)
gate.Init(*rpcPort, *wsPort)
gate.Run()
wg.Wait()

View File

@@ -2,13 +2,18 @@ package main
import (
"Open_IM/internal/msg_transfer/logic"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
wg.Add(1)
log.NewPrivateLog(constant.LogFileName)
logic.Init()
fmt.Println("start msg_transfer server")
logic.Run()
wg.Wait()
}

View File

@@ -2,15 +2,22 @@ package main
import (
"Open_IM/internal/push/logic"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"flag"
"fmt"
"sync"
)
func main() {
rpcPort := flag.Int("port", 10700, "rpc listening port")
defaultPorts := config.Config.RpcPort.OpenImPushPort
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
flag.Parse()
var wg sync.WaitGroup
wg.Add(1)
log.NewPrivateLog(constant.LogFileName)
fmt.Println("start push rpc server, port: ", *rpcPort)
logic.Init(*rpcPort)
logic.Run()
wg.Wait()

View File

@@ -1,65 +0,0 @@
package main
import (
commonDB "Open_IM/pkg/common/db"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
"time"
)
func main() {
log.NewPrivateLog("timer")
//for {
// fmt.Println("start delete mongodb expired record")
// timeUnixBegin := time.Now().Unix()
// count, _ := db.DB.MgoUserCount()
// fmt.Println("mongodb record count: ", count)
// for i := 0; i < count; i++ {
// time.Sleep(1 * time.Millisecond)
// uid, _ := db.DB.MgoSkipUID(i)
// fmt.Println("operate uid: ", uid)
// err := db.DB.DelUserChat(uid)
// if err != nil {
// fmt.Println("operate uid failed: ", uid, err.Error())
// }
// }
//
// timeUnixEnd := time.Now().Unix()
// costTime := timeUnixEnd - timeUnixBegin
// if costTime > int64(config.Config.Mongo.DBRetainChatRecords*24*3600) {
// continue
// } else {
// sleepTime := 0
// if int64(config.Config.Mongo.DBRetainChatRecords*24*3600)-costTime > 24*3600 {
// sleepTime = 24 * 3600
// } else {
// sleepTime = config.Config.Mongo.DBRetainChatRecords*24*3600 - int(costTime)
// }
// fmt.Println("sleep: ", sleepTime)
// time.Sleep(time.Duration(sleepTime) * time.Second)
// }
//}
for {
uidList, err := im_mysql_model.SelectAllUserID()
if err != nil {
//log.NewError("999999", err.Error())
} else {
for _, v := range uidList {
minSeq, err := commonDB.DB.GetMinSeqFromMongo(v)
if err != nil {
//log.NewError("999999", "get user minSeq err", err.Error(), v)
continue
} else {
err := commonDB.DB.SetUserMinSeq(v, minSeq)
if err != nil {
//log.NewError("999999", "set user minSeq err", err.Error(), v)
}
}
time.Sleep(time.Duration(100) * time.Millisecond)
}
}
}
}

View File

@@ -2,13 +2,16 @@ package main
import (
rpcMessageCMS "Open_IM/internal/rpc/admin_cms"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 11000, "rpc listening port")
defaultPorts := config.Config.RpcPort.OpenImAdminCmsPort
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
flag.Parse()
fmt.Println("start cms rpc server, port: ", *rpcPort)
rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,12 +2,16 @@ package main
import (
rpcAuth "Open_IM/internal/rpc/auth"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800")
defaultPorts := config.Config.RpcPort.OpenImAuthPort
rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800")
flag.Parse()
fmt.Println("start auth rpc server, port: ", *rpcPort)
rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort)
rpcServer.Run()

View File

@@ -1,7 +1,7 @@
.PHONY: all build run gotool install clean help
BINARY_NAME=open_im_timer_task
BIN_DIR=../../bin/
BINARY_NAME=open_im_cache
BIN_DIR=../../../bin/
all: gotool build
@@ -22,4 +22,3 @@ install:
clean:
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi

View File

@@ -0,0 +1,18 @@
package main
import (
rpcCache "Open_IM/internal/rpc/cache"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
defaultPorts := config.Config.RpcPort.OpenImCachePort
rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800")
flag.Parse()
fmt.Println("start auth rpc server, port: ", *rpcPort)
rpcServer := rpcCache.NewCacheServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -0,0 +1,24 @@
.PHONY: all build run gotool install clean help
BINARY_NAME=open_im_conversation
BIN_DIR=../../../bin/
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./
gotool:
go fmt ./
go vet ./
install:
make build
mv ${BINARY_NAME} ${BIN_DIR}
clean:
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi

View File

@@ -0,0 +1,18 @@
package main
import (
rpcConversation "Open_IM/internal/rpc/conversation"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
defaultPorts := config.Config.RpcPort.OpenImConversationPort
rpcPort := flag.Int("port", defaultPorts[0], "RpcConversation default listen port 11300")
flag.Parse()
fmt.Println("start conversation rpc server, port: ", *rpcPort)
rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,13 +2,16 @@ package main
import (
"Open_IM/internal/rpc/friend"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10200, "get RpcFriendPort from cmd,default 12000 as port")
defaultPorts := config.Config.RpcPort.OpenImFriendPort
rpcPort := flag.Int("port", defaultPorts[0], "get RpcFriendPort from cmd,default 12000 as port")
flag.Parse()
fmt.Println("start friend rpc server, port: ", *rpcPort)
rpcServer := friend.NewFriendServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,12 +2,16 @@ package main
import (
"Open_IM/internal/rpc/group"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10500, "get RpcGroupPort from cmd,default 16000 as port")
defaultPorts := config.Config.RpcPort.OpenImGroupPort
rpcPort := flag.Int("port", defaultPorts[0], "get RpcGroupPort from cmd,default 16000 as port")
flag.Parse()
fmt.Println("start group rpc server, port: ", *rpcPort)
rpcServer := group.NewGroupServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,12 +2,16 @@ package main
import (
rpcMessageCMS "Open_IM/internal/rpc/message_cms"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10900, "rpc listening port")
defaultPorts := config.Config.RpcPort.OpenImMessageCmsPort[0]
rpcPort := flag.Int("port", defaultPorts, "rpc listening port")
flag.Parse()
fmt.Println("start msg cms rpc server, port: ", *rpcPort)
rpcServer := rpcMessageCMS.NewMessageCMSServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,12 +2,16 @@ package main
import (
rpcChat "Open_IM/internal/rpc/msg"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10300, "rpc listening port")
defaultPorts := config.Config.RpcPort.OpenImMessagePort
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
flag.Parse()
fmt.Println("start msg rpc server, port: ", *rpcPort)
rpcServer := rpcChat.NewRpcChatServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -0,0 +1,23 @@
.PHONY: all build run gotool install clean help
BINARY_NAME=open_im_office
BIN_DIR=../../../bin/
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./
gotool:
go fmt ./
go vet ./
install:
make build
mv ${BINARY_NAME} ${BIN_DIR}
clean:
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi

View File

@@ -0,0 +1,17 @@
package main
import (
rpc "Open_IM/internal/rpc/office"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
defaultPorts := config.Config.RpcPort.OpenImOfficePort
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
flag.Parse()
fmt.Println("start office rpc server, port: ", *rpcPort)
rpcServer := rpc.NewOfficeServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -0,0 +1,25 @@
.PHONY: all build run gotool install clean help
BINARY_NAME=open_im_organization
BIN_DIR=../../../bin/
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./
gotool:
go fmt ./
go vet ./
install:
make build
mv ${BINARY_NAME} ${BIN_DIR}
clean:
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi

View File

@@ -0,0 +1,17 @@
package main
import (
"Open_IM/internal/rpc/organization"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
defaultPorts := config.Config.RpcPort.OpenImOrganizationPort
rpcPort := flag.Int("port", defaultPorts[0], "get RpcOrganizationPort from cmd,default 11200 as port")
flag.Parse()
fmt.Println("start organization rpc server, port: ", *rpcPort)
rpcServer := organization.NewServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,12 +2,16 @@ package main
import (
"Open_IM/internal/rpc/statistics"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10800, "rpc listening port")
defaultPorts := config.Config.RpcPort.OpenImStatisticsPort
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
flag.Parse()
fmt.Println("start statistics rpc server, port: ", *rpcPort)
rpcServer := statistics.NewStatisticsServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -2,12 +2,16 @@ package main
import (
"Open_IM/internal/rpc/user"
"Open_IM/pkg/common/config"
"flag"
"fmt"
)
func main() {
rpcPort := flag.Int("port", 10100, "rpc listening port")
defaultPorts := config.Config.RpcPort.OpenImUserPort
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
flag.Parse()
fmt.Println("start user rpc server, port: ", *rpcPort)
rpcServer := user.NewUserServer(*rpcPort)
rpcServer.Run()
}

View File

@@ -1,12 +1,15 @@
# The class cannot be named by Pascal or camel case.
# The class cannot be named by Pascal or camel case.
# If it is not used, the corresponding structure will not be set,
# and it will not be read naturally.
serverversion: 2.0.0
#---------------Infrastructure configuration---------------------#
etcd:
etcdSchema: openIM #默认即可
etcdSchema: openim #默认即可
etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可
k8sMod: false #开启k8s模式 使用pod里面环境变量请求services调用服务 而并非etcd
mysql:
dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可
dbMysqlUserName: root #mysql用户名建议修改
@@ -19,32 +22,41 @@ mysql:
dbMaxLifeTime: 120
mongo:
dbAddress: [ 127.0.0.1:37017 ] #redis地址 目前仅支持单机,默认即可
dbUri: ""#当dbUri值不为空则直接使用该值
dbAddress: 127.0.0.1:37017 #单机时为mongo地址使用分片集群时为mongos地址 默认即可
dbDirect: false
dbTimeout: 10
dbTimeout: 60
dbDatabase: openIM #mongo db 默认即可
dbSource: admin
dbUserName: #mongo用户名建议先不设置
dbPassword: #mongo密码建议先不设置
dbMaxPoolSize: 20
dbUserName: #mongo用户名建议先不设置
dbPassword: #mongo密码建议先不设置
dbMaxPoolSize: 100
dbRetainChatRecords: 3650 #mongo保存离线消息时间根据需求修改
redis:
dbAddress: 127.0.0.1:16379 #redis地址 目前仅支持单机,默认即可
dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机填写一个地址即可使用redis集群时候填写集群中多个节点地址主从地址都可以填写增加容灾能力,默认即可
dbMaxIdle: 128
dbMaxActive: 0
dbIdleTimeout: 120
dbPassWord: openIM #redis密码 建议修改
enableCluster: false #如果外部redis以集群方式启动需要打开此开关
kafka:
ws2mschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ws2ms_chat"
ws2mschatoffline:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ws2ms_chat_offline"
msgtomongo:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "msg_to_mongo"
ms2pschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ms2ps_chat"
consumergroupid:
msgToMongo: mongo
msgToTransfer: mongo
msgToMongo: mongo_ex
msgToMySql: mysql
msgToPush: push
@@ -58,6 +70,11 @@ kafka:
#如果是单机模式用0.0.0.0或者不填,默认即可
serverip: 0.0.0.0
#作为rpc时注册到etcd的地址单机默认即可如果是集群部署需要修改具体使用内网地址还是外网地址要依情况而定目的是api/gateway能访问到
rpcRegisterIP: 127.0.0.1
#默认即可
listenIP: 0.0.0.0
# endpoints 内部组件间访问的端点host名称访问时可以内部直接访问 host:port 来访问
endpoints:
api: openim_api
@@ -72,40 +89,62 @@ endpoints:
rpc_statistic: openim_rpc_statistic
rpc_admin_cms: openim_rpc_admin_cms
rpc_message_cms: openim_rpc_admin_cms
rpc_office: openim_rpc_office
api:
openImApiPort: [ 10000 ] #api服务端口默认即可需要开放此端口或做nginx转发
openImApiPort: [ 10002 ] #api服务端口默认即可需要开放此端口或做nginx转发
listenIP: 0.0.0.0
cmsapi:
openImCmsApiPort: [ 8000 ] #管理后台api服务端口默认即可需要开放此端口或做nginx转发
openImCmsApiPort: [ 10006 ] #管理后台api服务端口默认即可需要开放此端口或做nginx转发
listenIP: 0.0.0.0
sdk:
openImSdkWsPort: [ 30000 ] #jssdk服务端口默认即可项目中使用jssdk才需开放此端口或做nginx转发
openImSdkWsPort: [ 10003 ] #jssdk服务端口默认即可项目中使用jssdk才需开放此端口或做nginx转发
dataDir: [ ../db/sdk/ ]
#对象存储服务以下配置二选一目前支持两种腾讯云和minio二者配置好其中一种即可如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器
credential: #腾讯cos发送图片、视频、文件时需要请自行申请后替换必须修改
tencent:
appID: 1302656840
region: ap-chengdu
bucket: echat-1302656840
secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC
secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe
secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC1
secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe1
minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化InitSDK中 object_storage参数为minio
bucket: openim
bucket: openim # 存储内容桶
appBucket: app # 存储app的桶
location: us-east-1
endpoint: http://43.128.5.63:9000
endpoint: http://127.0.0.1:10005 #minio外网ip 这个ip是给客户端访问的
endpointInner: http://127.0.0.1:10005 #minio内网地址 如果im server 可以通过内网访问到 minio就可以填写
endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化IM server连接minio走内网地址访问
accessKeyID: user12345
secretAccessKey: key12345
ali: # ali oss
regionID: "oss-cn-beijing"
accessKeyID: ""
accessKeySecret: ""
stsEndpoint: "sts.cn-beijing.aliyun.com"
ossEndpoint: "oss-cn-beijing.aliyuncs.com"
bucket: "bucket1"
finalHost: "http://bucket1.oss-cn-beijing.aliyuncs.com"
stsDurationSeconds: 3600
OssRoleArn: "acs:ram::xxx:role/xxx"
rpcport: #rpc服务端口 默认即可
openImUserPort: [ 10100 ]
openImFriendPort: [ 10200 ]
openImOfflineMessagePort: [ 10300 ]
openImOnlineRelayPort: [ 10400 ]
openImGroupPort: [ 10500 ]
openImAuthPort: [ 10600 ]
openImPushPort: [ 10700 ]
openImStatisticsPort: [ 10800 ]
openImMessageCmsPort: [ 10900 ]
openImAdminCmsPort: [ 11000 ]
openImUserPort: [ 10110 ]
openImFriendPort: [ 10120 ]
openImMessagePort: [ 10130 ]
openImMessageGatewayPort: [ 10140 ]
openImGroupPort: [ 10150 ]
openImAuthPort: [ 10160 ]
openImPushPort: [ 10170 ]
openImStatisticsPort: [ 10180 ]
openImMessageCmsPort: [ 10190 ]
openImAdminCmsPort: [ 10200 ]
openImOfficePort: [ 10210 ]
openImOrganizationPort: [ 10220 ]
openImConversationPort: [ 10230 ]
openImCachePort: [10240]
c2c:
callbackBeforeSendMsg:
switch: false
@@ -124,10 +163,14 @@ rpcregistername: #rpc注册服务名默认即可
openImOnlineMessageRelayName: OnlineMessageRelay
openImGroupName: Group
openImAuthName: Auth
OpenImStatisticsName: Statistics
OpenImMessageCMSName: MessageCMS
openImStatisticsName: Statistics
openImMessageCMSName: MessageCMS
openImAdminCMSName: AdminCMS
openImOfficeName: Office
openImOrganizationName: Organization
openImConversationName: Conversation
openImCacheName: Cache
openImRealTimeCommName: RealTimeComm
log:
storageLocation: ../logs/
rotationTime: 24
@@ -145,11 +188,12 @@ modulename: #日志文件按模块命名,默认即可
pushName: push
longconnsvr:
openImWsPort: [ 17778 ] # ws服务端口默认即可要开放此端口或做nginx转发
openImWsPort: [ 10001 ] # ws服务端口默认即可要开放此端口或做nginx转发
websocketMaxConnNum: 10000
websocketMaxMsgLen: 4096
websocketTimeOut: 10
## 推送只能开启一个 enable代表开启
push:
tpns: #腾讯推送,暂未测试 暂不要使用
ios:
@@ -158,21 +202,44 @@ push:
android:
accessID: 111
secretKey: 111
enable: false
jpns: #极光推送 在极光后台申请后,修改以下四项,必须修改
appKey: cf47465a368f24c659608e7e
masterSecret: 02204efe3f3832947a236ee5
pushUrl: "https://api.jpush.cn/v3/push"
pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end"
enable: true
getui: #个推推送,暂未测试 暂不要使用
pushUrl: "https://restapi.getui.com/v2/$appId"
masterSecret: ""
appKey: ""
intent: ""
enable: false
manager:
#app管理员userID和对应的secret 建议修改。 用于管理后台登录也可以用户管理后台对应的api
appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"]
secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"]
appSysNotificationName: "系统通知"
secret: tuoyun
# 多端互踢策略
# 1多平台登录Android、iOS、Windows、Mac 每种平台只能一个在线web端可以多个同时在线
multiloginpolicy: 1
#chat log insert to db
chatpersistencemysql: true
#可靠性存储
reliablestorage: false
#消息缓存时间
msgCacheTimeout: 86400
#群聊已读开启
groupMessageHasReadReceiptEnable: true
#单聊已读开启
singleMessageHasReadReceiptEnable: true
#token config
tokenpolicy:
accessSecret: "open_im_server" #token生成相关默认即可
@@ -194,12 +261,13 @@ messageverify:
iospush:
pushSound: "xxx"
badgeCount: true
production: false
callback:
# callback url 需要自行更换callback url
callbackUrl : "http://127.0.0.1:8080/callback"
# 开启关闭操作前后回调的配置
callbackbeforeSendSingleMsg:
callbackBeforeSendSingleMsg:
enable: false # 回调是否启用
callbackTimeOut: 2 # 回调超时时间
callbackFailedContinue: true # 回调超时是否继续执行代码
@@ -217,7 +285,16 @@ callback:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true
callbackUserOnline:
enable: false
callbackTimeOut: 2
callbackUserOffline:
enable: false
callbackTimeOut: 2
callbackOfflinePush:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续离线推送
notification:
groupCreated:
@@ -351,6 +428,84 @@ notification:
ext: "groupDismissed ext"
defaultTips:
tips: "group dismissed"
groupMuted:
conversation:
reliabilityLevel: 3
unreadCount: true
offlinePush:
switch: false
title: "groupMuted title"
desc: "groupMuted desc"
ext: "groupMuted ext"
defaultTips:
tips: "group Muted"
groupCancelMuted:
conversation:
reliabilityLevel: 3
unreadCount: true
offlinePush:
switch: false
title: "groupCancelMuted title"
desc: "groupCancelMuted desc"
ext: "groupCancelMuted ext"
defaultTips:
tips: "group Cancel Muted"
groupMemberMuted:
conversation:
reliabilityLevel: 3
unreadCount: true
offlinePush:
switch: false
title: "groupMemberMuted title"
desc: "groupMemberMuted desc"
ext: "groupMemberMuted ext"
defaultTips:
tips: "group Member Muted"
groupMemberCancelMuted:
conversation:
reliabilityLevel: 3
unreadCount: true
offlinePush:
switch: false
title: "groupMemberCancelMuted title"
desc: "groupMemberCancelMuted desc"
ext: "groupMemberCancelMuted ext"
defaultTips:
tips: "group Member Cancel Muted"
groupMemberInfoSet:
conversation:
reliabilityLevel: 2
unreadCount: false
offlinePush:
switch: false
title: "groupMemberInfoSet title"
desc: "groupMemberInfoSet desc"
ext: "groupMemberInfoSet ext"
defaultTips:
tips: "group member info set"
organizationChanged:
conversation:
reliabilityLevel: 2
unreadCount: false
offlinePush:
switch: false
title: "organizationChanged title"
desc: "organizationChanged desc"
ext: "organizationChanged ext"
defaultTips:
tips: "organization changed"
#############################friend#################################
friendApplicationAdded:
@@ -486,29 +641,79 @@ notification:
defaultTips:
tips: "conversation opt update"
conversationSetPrivate:
conversation:
reliabilityLevel: 3
unreadCount: true
offlinePush:
switch: true
title: "burn after reading"
desc: "burn after reading"
ext: "burn after reading"
defaultTips:
openTips: "burn after reading was opened"
closeTips: "burn after reading was closed"
###################workMoments################
workMomentsNotification:
conversation:
reliabilityLevel: 2
unreadCount: true
offlinePush:
switch: true
title: "burn after reading"
desc: "burn after reading"
ext: "burn after reading"
defaultTips:
openTips: "burn after reading was opened"
closeTips: "burn after reading was closed"
###################organization################
joinDepartmentNotification:
conversation:
reliabilityLevel: 3
unreadCount: true
offlinePush:
switch: false
title: "welcome user join department"
desc: "welcome user join department"
ext: "welcome user join department"
defaultTips:
tips: "welcome user join department"
#---------------demo configuration---------------------#
#The following configuration items are applied to openIM Demo configuration
#是否启动demo如果自身没有账号体系设置为true
demoswitch: true
demo:
listenIP: 0.0.0.0
#demo对外服务端口默认即可需要开放此端口或做nginx转发
openImDemoPort: [ 42233 ]
alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改
openImDemoPort: [ 10004 ]
alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,enable为true则必须修改阿里云为默认短信验证方式
accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7
accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV
signName: 托云信息技术
verificationCodeTemplateCode: SMS_226810164
enable: false
tencentsms: #腾讯云短信配置在腾讯云申请成功后修改以下选项enable为true则必须修改
appID: 2400000648
region: "ap-singapore"
secretID: IKIDra4JPGsFMDwQedMq42lESQBgwwgBQQAe
secretKey: HI6fz4uUotjJdiX6QUIrAE2buxlKdgU2
signName: ""
verificationCodeTemplateCode: 2902877
enable: true
superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代
# second
codeTTL: 300
codeTTL: 60
mail: #仅支持qq邮箱具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改
title: "openIM"
senderMail: "765567899@qq.com"
senderAuthorizationCode: "gxyausfoevlzbfag"
smtpAddr: "smtp.qq.com"
smtpPort: 25 #需开放此端口 出口方向
testDepartMentID: 001
imAPIURL: http://127.0.0.1:10002
rtc:
signalTimeout: 35

View File

@@ -19,6 +19,7 @@ mysql:
dbMaxLifeTime: 120
mongo:
dbUri: ""#当dbUri值不为空则直接使用该值
dbAddress: [ openim_mongo:27017 ]
dbDirect: false
dbTimeout: 10

View File

@@ -6,6 +6,7 @@ ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_api $WORKDIR/main
COPY ./start_api.sh $$WORKDIR
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
@@ -13,4 +14,4 @@ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
WORKDIR $WORKDIR
CMD ./main
CMD ./start_api.sh

View File

@@ -0,0 +1,20 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_admin_cms $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config", "/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,32 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: admin-cms-deployment
spec:
selector:
matchLabels:
app: admin-cms # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: admin-cms # 标签
spec:
containers:
- name: admin-cms
image: openim/admin_cms:v2.1.0
# imagePullPolicy: Always #每次启动都重新拉取镜像
ports:
- containerPort: 10200
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_api $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,45 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-deployment
spec:
selector:
matchLabels:
app: api # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: api # 标签
spec:
containers:
- name: api
image: openim/api:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10002
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: api
spec:
ports:
- name: api-port
protocol: TCP
port: 10002
targetPort: 10002
selector:
app: api
type: NodePort

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_auth $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-deployment
spec:
selector:
matchLabels:
app: auth # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: auth # 标签
spec:
containers:
- name: auth
image: openim/auth:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10160
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,30 @@
#/bin/sh
source ./path_info.cfg
# images version
version=v2.1.0
git pull
cd ../script/; ./build_all_service.sh
cd ../deploy_k8s/
for i in ${service[*]}
do
mv ../bin/open_im_${i} ./${i}/
done
echo "move success"
echo "start to build images"
for i in ${service[*]}
do
echo "start to build images" $i
cd $i
image="openim/${i}:$version"
docker build -t $image . -f ./${i}.Dockerfile
echo "build ${dockerfile} success"
docker push $image
echo "push ${image} success "
cd ..
done

19
deploy_k8s/cache/cache.Dockerfile vendored Normal file
View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_cache $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

31
deploy_k8s/cache/deployment.yaml vendored Normal file
View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cache-deployment
spec:
selector:
matchLabels:
app: cache # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: cache # 标签
spec:
containers:
- name: cache
image: openim/cache:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10240
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,18 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_cms_api $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,45 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cms-api-deployment
spec:
selector:
matchLabels:
app: cms-api # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: cms-api # 标签
spec:
containers:
- name: cms-api
image: openim/cms_api:v2.1.0
imagePullPolicy: Always
ports:
- containerPort: 10006
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: cms-api
spec:
ports:
- name: cms-api-port
protocol: TCP
port: 10006
targetPort: 10006
selector:
app: cms-api
type: NodePort

View File

@@ -0,0 +1,18 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_conversation $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,32 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: conversation-deployment
spec:
selector:
matchLabels:
app: conversation # 选择这个指定标签执行
replicas: 2 # 运行pod数量
template:
metadata:
labels:
app: conversation # 标签
spec:
containers:
- name: conversation
image: openim/conversation:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10230
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_demo $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,45 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-deployment
spec:
selector:
matchLabels:
app: demo # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: demo # 标签
spec:
containers:
- name: demo
image: openim/demo:v2.1.0
imagePullPolicy: Always
ports:
- containerPort: 10004
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: demo
spec:
ports:
- name: demo
protocol: TCP
port: 10004
targetPort: 10004
selector:
app: demo
type: NodePort

View File

@@ -0,0 +1,32 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: friend-deployment
spec:
selector:
matchLabels:
app: friend # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: friend # 标签
spec:
containers:
- name: friend
image: openim/friend:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10120
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_friend $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: group-deployment
spec:
selector:
matchLabels:
app: group # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: group # 标签
spec:
containers:
- name: group
image: openim/group:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10150
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_group $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

101
deploy_k8s/ingress.yaml Normal file
View File

@@ -0,0 +1,101 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
name: sdk-server-ingress
spec:
rules:
- host: sdk-server.openim.xxx.com
http:
paths:
- backend:
service:
name: sdk-server
port:
number: 10003
path: /
pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
name: msg-gateway-ingress
spec:
rules:
- host: msg-gateway.openim.xxx.com
http:
paths:
- backend:
service:
name: msg-gateway
port:
number: 10001
path: /
pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
name: api-ingress
spec:
rules:
- host: api.openim.xxx.com
http:
paths:
- backend:
service:
name: api
port:
number: 10002
path: /
pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
name: demo-ingress
spec:
rules:
- host: demo.openim.xxx.com
http:
paths:
- backend:
service:
name: demo
port:
number: 10004
path: /
pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
name: cms-api-ingress
spec:
rules:
- host: cms-api.openim.xxx.com
http:
paths:
- backend:
service:
name: cms-api
port:
number: 10006
path: /
pathType: Prefix

View File

@@ -0,0 +1,99 @@
#### openIM k8s部署文档
### 1. 修改配置文件
在Open-IM-SERVER根目录下修改config/config.yaml配置文件, 请确保以下修改的所有地址必须保证k8s pod能够访问
1. 修改ETCD配置为自己的ETCD ip地址, 最好和k8s本身使用的ETCD分开
2. 修改MySQL配置
3. 修改Mongo配置
4. 修改Redis配置
5. 修改Kafka配置
6. 将rpcRegisterIP修改为空, 此地址为每个rpc注册到ETCD的地址, 置空每个rpc将会将pod地址注册到ETCD, 才能正确rpc请求(重要)
7. 如果使用minio作为对象存储, 还需要修改minio的地址
8. 其他如果使用离线推送,需要修改push离线推送配置
9. 修改demo中的imAPIURL字段为openIM api的ingress或者service地址, 需要让demo的pod能正确请求到(重要)
10. 其他非必须配置修改, 如短信,推送等
### 2. 项目根目录创建im configMap到k8s openim namespace
1. 为open-IM项目创建单独命名空间
```
kubectl create namespace openim
```
2. 在项目根目录通过config/config.yaml
```
kubectl -n openim create configmap config --from-file=config/config.yaml
```
查看configmap
```
kubectl -n openim get configmap
```
### 3(可选). 修改每个deployment.yml
每个rpc的deployment在Open-IM-SERVER根目录deploy_k8s下
给需要调度的node打上标签
```
kubectl get nodes
kubectl label node k8s-node1 role=openIMworker
```
在deployment的spec.template.spec加上
```
nodeSelector:
role: openIMworker
```
创建资源清单时添加上nodeSelector属性对应即可,
修改每种服务数量建议至少每种2个rpc。
如果修改了config/config.yaml某些配置比如端口同时需要修改对应deployment端口和ingress端口
### 4. 修改ingress.yaml配置文件
1. 需要安装ingress controller, 这里使用的是ingress-nginx, 使用其他类型的ingress controller需要更改ingress.class, 将host改为自己部署服务的host
### 5. 执行./kubectl_start.sh脚本
1. 脚本给予可执行权限
```
chmod +x ./kubectl_start.sh ./kubectl_stop.sh
```
2. 启动k8s service和deployment
```
./kubectl_start.sh
```
3. 启动k8s ingress
```
kubectl -n openim apply -f ingress.yaml
```
kubectl 启动所有deployment, services, ingress
### 6. 查看k8s deployment service ingress状态
```
kubectl -n openim get services
kubectl -n openim get deployment
kubectl -n openim get ingress
kubectl -n openim get pods
```
检测服务可达
```
telnet msg-gateway.openim.xxx.com {{your_ingress_port}}
telnet sdk-server.openim.xxx.com {{your_ingress_port}}
telnet api.openim.xxx.com {{your_ingress_port}}
telnet cms-api.openim.xxx.com {{your_ingress_port}}
telnet demo.openim.xxx.com {{your_ingress_port}}
```
#### openIM k8s更新
1. 暂存配置文件,拉取代码
```
git stash push config/config.yaml
git pull
```
2. 合并配置文件, 解决冲突
```
git stash pop
```
3. 重新生成configmap
```
kubectl -n openim create configmap config --from-file=config/config.yaml
```
4.修改所有deployment文件的spec.template.spec.image 改为新版本后在/deploy_k8s下重新执行
```
./kubectl_stop.sh
./kubectl_start.sh
```

11
deploy_k8s/kubectl_start_all.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
source ./path_info.cfg
#mkdir -p /db/sdk #path for jssdk sqlite
for i in ${service[*]}
do
kubectl -n openim apply -f ./${i}/deployment.yaml
done

38
deploy_k8s/kubectl_stop_all.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
service=(
#api service file
api
cms-api
#rpc service file
user
friend
group
auth
admin-cms
message-cms
statistics
office
organization
conversation
cache
msg-gateway
msg-transfer
msg
push
sdk-server
demo
)
for i in ${service[*]}
do
kubectl -n openim delete deployment "${i}-deployment"
done
kubectl -n openim delete service api
kubectl -n openim delete service cms-api
kubectl -n openim delete service sdk-server
kubectl -n openim delete service msg-gateway
kubectl -n openim delete service demo
echo done

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: message-cms-deployment
spec:
selector:
matchLabels:
app: message-cms # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: message-cms # 标签
spec:
containers:
- name: message-cms
image: openim/message_cms:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10190
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_message_cms $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: msg-deployment
spec:
selector:
matchLabels:
app: msg # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: msg # 标签
spec:
containers:
- name: msg
image: openim/msg:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10130
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,20 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_msg $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,50 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: msg-gateway-deployment
spec:
selector:
matchLabels:
app: msg-gateway # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: msg-gateway # 标签
spec:
containers:
- name: msg-gateway
image: openim/msg_gateway:v2.1.0
# imagePullPolicy: Always
ports:
- name: rpc-port
containerPort: 10140
- name: ws-port
containerPort: 10001
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: msg-gateway
spec:
ports:
- name: msg-gateway-port
protocol: TCP
port: 10001
targetPort: ws-port
selector:
app: msg-gateway
type: NodePort

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_msg_gateway $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,29 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: msg-transfer-deployment
spec:
selector:
matchLabels:
app: msg-transfer # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: msg-transfer # 标签
spec:
containers:
- name: msg-transfer
image: openim/msg_transfer:v2.1.0
# imagePullPolicy: Always
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_msg_transfer $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: office-deployment
spec:
selector:
matchLabels:
app: office # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: office # 标签
spec:
containers:
- name: office
image: openim/office:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10210
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,20 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_office $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: organization-deployment
spec:
selector:
matchLabels:
app: organization # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: organization # 标签
spec:
containers:
- name: organization
image: openim/organization:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10220
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,20 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_organization $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

24
deploy_k8s/path_info.cfg Normal file
View File

@@ -0,0 +1,24 @@
#/bin/sh
service=(
#api service file
api
cms_api
#rpc service file
user
friend
group
auth
admin_cms
message_cms
statistics
office
organization
conversation
cache
msg_gateway
msg_transfer
msg
push
sdk_server
demo
)

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: push-deployment
spec:
selector:
matchLabels:
app: push # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: push # 标签
spec:
containers:
- name: push
image: openim/push:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10170
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,20 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_push $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,54 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sdk-server-deployment
spec:
selector:
matchLabels:
app: sdk-server # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: sdk-server # 标签
spec:
containers:
- name: sdk-server
image: openim/sdk_server:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10003
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
- name: local-db
mountPath: /db/sdk
command: ["/Open-IM-Server/main"]
args: ["-openIM_api_port", "10002", "-openIM_ws_port", "10001", "-sdk_ws_port", "10003", "-openIM_log_level", "6"]
volumes:
- name: config
configMap:
name: openim-config
- name: local-db
hostPath:
path: /db/sdk
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: sdk-server
spec:
ports:
- name: sdk-server-port
protocol: TCP
port: 10003
targetPort: 10003
selector:
app: sdk-server
type: NodePort

View File

@@ -0,0 +1,18 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_sdk_server $WORKDIR/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \
chmod +x $WORKDIR/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: statistics-deployment
spec:
selector:
matchLabels:
app: statistics # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: statistics # 标签
spec:
containers:
- name: statistics
image: openim/statistics:v2.1.0
# imagePullPolicy: Always
ports:
- containerPort: 10180
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_statistics $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -0,0 +1,29 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-deployment
spec:
selector:
matchLabels:
app: user # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: user # 标签
spec:
containers:
- name: user
image: openim/user:v2.1.0
# imagePullPolicy: Always
volumeMounts:
- name: config
mountPath: /Open-IM-Server/config
readOnly: true
volumes:
- name: config
configMap:
name: openim-config
strategy: #更新策略
type: RollingUpdate # 滚动更新

View File

@@ -0,0 +1,19 @@
FROM ubuntu
# 设置固定的项目路径
ENV WORKDIR /Open-IM-Server
ENV CMDDIR $WORKDIR/cmd
ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录
ADD ./open_im_user $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $CMDDIR
CMD ./main

View File

@@ -20,19 +20,21 @@ services:
ports:
- 37017:27017
container_name: mongo
command: --wiredTigerCacheSizeGB 1
volumes:
- ./components/mongodb/data/db:/data/db
- ./components/mongodb/data/logs:/data/logs
- ./components/mongodb/data/conf:/etc/mongo
# - ./script/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# environment:
# - MONGO_INITDB_ROOT_USERNAME=openIM
# - MONGO_INITDB_ROOT_PASSWORD=openIM
#TZ: Asia/Shanghai
# - MONGO_USERNAME=openIM
# - MONGO_PASSWORD=openIM
# - MONGO_INITDB_ROOT_USERNAME=root
# - MONGO_INITDB_ROOT_PASSWORD=root
# - MONGO_INITDB_DATABASE=openIM
restart: always
redis:
@@ -43,7 +45,7 @@ services:
volumes:
- ./components/redis/data:/data
#redis config file
#- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
environment:
TZ: Asia/Shanghai
restart: always
@@ -68,13 +70,17 @@ services:
image: wurstmeister/kafka
container_name: kafka
restart: always
ports:
- 9092:9092
environment:
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
network_mode: "host"
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "ws2ms_chat:8:1,ms2ps_chat:8:1,msg_to_mongo:8:1"
KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9092,OUTSIDE://103.116.45.174:9092
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
depends_on:
- zookeeper
@@ -92,8 +98,23 @@ services:
restart: always
command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new
minio:
image: minio/minio
ports:
- 10005:9000
- 9090:9090
container_name: minio
volumes:
- /mnt/data:/data
- /mnt/config:/root/.minio
environment:
MINIO_ROOT_USER: user12345
MINIO_ROOT_PASSWORD: key12345
restart: always
command: minio server /data --console-address ':9090'
open_im_server:
image: openim/open_im_server:v2.0.2
image: openim/open_im_server:v2.2.0
container_name: open_im_server
volumes:
- ./logs:/Open-IM-Server/logs
@@ -107,6 +128,7 @@ services:
- mongodb
- redis
- etcd
- minio
network_mode: "host"
logging:
driver: json-file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 144 KiB

56
go.mod
View File

@@ -3,28 +3,23 @@ module Open_IM
go 1.15
require (
github.com/Shopify/sarama v1.19.0
github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect
github.com/Shopify/sarama v1.32.0
github.com/alibabacloud-go/darabonba-openapi v0.1.11
github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8
github.com/alibabacloud-go/sts-20150401 v1.1.0
github.com/alibabacloud-go/tea v1.1.17
github.com/antonfisher/nested-logrus-formatter v1.3.0
github.com/bwmarrin/snowflake v0.3.0
github.com/coreos/etcd v3.3.27+incompatible // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fatih/structs v1.1.0
github.com/frankban/quicktest v1.14.0 // indirect
github.com/garyburd/redigo v1.6.2
github.com/gin-gonic/gin v1.7.0
github.com/go-playground/validator/v10 v10.4.1
github.com/gin-gonic/gin v1.8.1
github.com/go-openapi/spec v0.20.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-playground/validator/v10 v10.11.0
github.com/go-redis/redis/v8 v8.11.5
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/protobuf v1.3.2
github.com/golang-jwt/jwt/v4 v4.1.0
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.4 // indirect
github.com/gorilla/websocket v1.4.2
github.com/jinzhu/copier v0.3.4
github.com/jinzhu/gorm v1.9.16
@@ -33,35 +28,38 @@ require (
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/lestrrat-go/strftime v1.0.4 // indirect
github.com/lib/pq v1.2.0 // indirect
//github.com/livekit/protocol v0.11.14-0.20220223195254-d8c251e13231 // indirect
//github.com/livekit/server-sdk-go v0.9.1
github.com/mattn/go-sqlite3 v1.14.6 // indirect
github.com/minio/minio-go/v7 v7.0.22
github.com/mitchellh/mapstructure v1.4.2
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/olivere/elastic/v7 v7.0.23
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
github.com/sirupsen/logrus v1.8.1
github.com/spf13/viper v1.9.0
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.7.2
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe
github.com/swaggo/gin-swagger v1.5.0
github.com/swaggo/swag v1.8.3
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.428
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.428
github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
//go.etcd.io/etcd v3.3.27+incompatible
go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698
go.etcd.io/etcd/api/v3 v3.5.4
go.etcd.io/etcd/client/v3 v3.5.4
go.mongodb.org/mongo-driver v1.8.3
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
google.golang.org/grpc v1.42.0
google.golang.org/grpc/examples v0.0.0-20220311002955-722367c4a737 // indirect
google.golang.org/protobuf v1.27.1
golang.org/x/net v0.0.0-20220622184535-263ec571b305
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.0
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
sigs.k8s.io/yaml v1.2.0 // indirect
gopkg.in/yaml.v3 v3.0.1
)
replace google.golang.org/grpc => google.golang.org/grpc v1.29.0
replace github.com/Shopify/sarama => github.com/Shopify/sarama v1.29.0

834
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -4,27 +4,43 @@ import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
rpc "Open_IM/pkg/proto/auth"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"github.com/fatih/structs"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)
// @Summary 用户注册
// @Description 用户注册
// @Tags 鉴权认证
// @ID UserRegister
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UserRegisterReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID <br> ex为拓展字段 <br> gender为性别, 0为女, 1为男"
// @Produce json
// @Success 0 {object} api.UserRegisterResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/user_register [post]
func UserRegister(c *gin.Context) {
params := api.UserRegisterReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
errMsg := " BindJSON failed " + err.Error()
log.NewError("0", errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
if params.Secret != config.Config.Secret {
log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"})
errMsg := " params.Secret != config.Config.Secret "
log.NewError(params.OperationID, errMsg, params.Secret, config.Config.Secret)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": errMsg})
return
}
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
@@ -32,20 +48,34 @@ func UserRegister(c *gin.Context) {
//copier.Copy(req.UserInfo, &params)
req.OperationID = params.OperationID
log.NewInfo(req.OperationID, "UserRegister args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + " getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewAuthClient(etcdConn)
reply, err := client.UserRegister(context.Background(), req)
if err != nil || reply.CommonResp.ErrCode != 0 {
log.NewError(req.OperationID, "UserRegister failed ", err, reply.CommonResp.ErrCode)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": reply.CommonResp.ErrMsg})
if err != nil {
errMsg := req.OperationID + " " + "UserRegister failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
if reply.CommonResp.ErrCode != 0 {
errMsg := req.OperationID + " " + " UserRegister failed " + reply.CommonResp.ErrMsg + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
pbDataToken := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID}
replyToken, err := client.UserToken(context.Background(), pbDataToken)
if err != nil {
log.NewError(req.OperationID, "UserToken failed ", err.Error(), pbDataToken)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
errMsg := req.OperationID + " " + " client.UserToken failed " + err.Error() + pbDataToken.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
resp := api.UserRegisterResp{CommResp: api.CommResp{ErrCode: replyToken.CommonResp.ErrCode, ErrMsg: replyToken.CommonResp.ErrMsg},
@@ -55,31 +85,145 @@ func UserRegister(c *gin.Context) {
}
// @Summary 用户登录
// @Description 获取用户的token
// @Tags 鉴权认证
// @ID UserToken
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UserTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID"
// @Produce json
// @Success 0 {object} api.UserTokenResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/user_token [post]
func UserToken(c *gin.Context) {
params := api.UserTokenReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
errMsg := " BindJSON failed " + err.Error()
log.NewError("0", errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
if params.Secret != config.Config.Secret {
errMsg := params.OperationID + " params.Secret != config.Config.Secret "
log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": errMsg})
return
}
req := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID}
log.NewInfo(req.OperationID, "UserToken args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + " getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewAuthClient(etcdConn)
reply, err := client.UserToken(context.Background(), req)
if err != nil {
log.NewError(req.OperationID, "UserToken failed ", err.Error(), req.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
errMsg := req.OperationID + " UserToken failed " + err.Error() + " req: " + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
resp := api.UserTokenResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg},
UserToken: api.UserTokenInfo{UserID: req.FromUserID, Token: reply.Token, ExpiredTime: reply.ExpiredTime}}
log.NewInfo(req.OperationID, "UserRegister return ", resp)
log.NewInfo(req.OperationID, "UserToken return ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 解析当前用户token
// @Description 解析当前用户token(token在请求头中传入)
// @Tags 鉴权认证
// @ID ParseToken
// @Accept json
// @Param token header string true "im token"
// @Param req body api.ParseTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段<br>platform为平台ID"
// @Produce json
// @Success 0 {object} api.ParseTokenResp{Data=api.ExpireTime}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/parse_token [post]
func ParseToken(c *gin.Context) {
params := api.ParseTokenReq{}
if err := c.BindJSON(&params); err != nil {
errMsg := " BindJSON failed " + err.Error()
log.NewError("0", errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
var ok bool
var errInfo string
var expireTime int64
ok, _, errInfo, expireTime = token_verify.GetUserIDFromTokenExpireTime(c.Request.Header.Get("token"), params.OperationID)
if !ok {
errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(params.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
resp := api.ParseTokenResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, ExpireTime: api.ExpireTime{ExpireTimeSeconds: uint32(expireTime)}}
resp.Data = structs.Map(&resp.ExpireTime)
log.NewInfo(params.OperationID, "ParseToken return ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 强制登出
// @Description 对应的平台强制登出
// @Tags 鉴权认证
// @ID ForceLogout
// @Accept json
// @Param token header string true "im token"
// @Param req body api.ForceLogoutReq true "platform为平台ID <br> fromUserID为要执行强制登出的用户ID"
// @Produce json
// @Success 0 {object} api.ForceLogoutResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/force_logout [post]
func ForceLogout(c *gin.Context) {
params := api.ForceLogoutReq{}
if err := c.BindJSON(&params); err != nil {
errMsg := " BindJSON failed " + err.Error()
log.NewError("0", errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
req := &rpc.ForceLogoutReq{}
utils.CopyStructFields(req, &params)
var ok bool
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, "ForceLogout args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + " getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewAuthClient(etcdConn)
reply, err := client.ForceLogout(context.Background(), req)
if err != nil {
errMsg := req.OperationID + " UserToken failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
resp := api.ForceLogoutResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}}
log.NewInfo(params.OperationID, utils.GetSelfFuncName(), " return ", resp)
c.JSON(http.StatusOK, resp)
}

View File

@@ -5,8 +5,9 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
rpc "Open_IM/pkg/proto/chat"
pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
@@ -15,6 +16,18 @@ import (
"strings"
)
// @Summary 根据seq列表删除消息
// @Description 根据seq列表删除消息
// @Tags 消息相关
// @ID DelMsg
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DelMsgReq true "userID为要删除的用户ID <br> seqList为seq列表"
// @Produce json
// @Success 0 {object} api.DelMsgResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/del_msg [post]
func DelMsg(c *gin.Context) {
var (
req api.DelMsgReq
@@ -25,12 +38,29 @@ func DelMsg(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req)
if err := utils.CopyStructFields(&reqPb, &req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req)
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
msgClient := pbChat.NewChatClient(grpcConn)
var ok bool
var errInfo string
ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID)
if grpcConn == nil {
errMsg := req.OperationID + " getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := rpc.NewChatClient(grpcConn)
respPb, err := msgClient.DelMsgList(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb)
@@ -39,5 +69,62 @@ func DelMsg(c *gin.Context) {
}
resp.ErrCode = respPb.ErrCode
resp.ErrMsg = respPb.ErrMsg
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 清空用户消息
// @Description 清空用户消息
// @Tags 消息相关
// @ID ClearMsg
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CleanUpMsgReq true "userID为要清空的用户ID"
// @Produce json
// @Success 0 {object} api.CleanUpMsgResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/clear_msg [post]
func ClearMsg(c *gin.Context) {
params := api.CleanUpMsgReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
//
req := &rpc.ClearMsgReq{}
utils.CopyStructFields(req, &params)
var ok bool
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + " getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewChatClient(etcdConn)
RpcResp, err := client.ClearMsg(context.Background(), req)
if err != nil {
log.NewError(req.OperationID, " CleanUpMsg failed ", err.Error(), req.String(), RpcResp.ErrMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": RpcResp.ErrMsg})
return
}
resp := api.CleanUpMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
c.JSON(http.StatusOK, resp)
}

View File

@@ -5,7 +5,8 @@ import (
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbMsg "Open_IM/pkg/proto/chat"
pbChat "Open_IM/pkg/proto/chat"
sdk_ws "Open_IM/pkg/proto/sdk_ws"
"context"
"github.com/gin-gonic/gin"
"net/http"
@@ -31,15 +32,18 @@ func GetSeq(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()})
return
}
pbData := pbMsg.GetMaxAndMinSeqReq{}
pbData := sdk_ws.GetMaxAndMinSeqReq{}
pbData.UserID = params.SendID
pbData.OperationID = params.OperationID
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID)
if grpcConn == nil {
log.ErrorByKv("get grpcConn err", pbData.OperationID, "args", params)
errMsg := pbData.OperationID + " getcdv3.GetConn == nil"
log.NewError(pbData.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := pbMsg.NewChatClient(grpcConn)
msgClient := pbChat.NewChatClient(grpcConn)
reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData)
if err != nil {
log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error())

View File

@@ -51,14 +51,20 @@ func PullMsgBySeqList(c *gin.Context) {
pbData.OperationID = params.OperationID
pbData.SeqList = params.SeqList
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID)
if grpcConn == nil {
errMsg := pbData.OperationID + "getcdv3.GetConn == nil"
log.NewError(pbData.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := pbChat.NewChatClient(grpcConn)
reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData)
if err != nil {
log.ErrorByKv("PullMessageBySeqList error", pbData.OperationID, "err", err.Error())
log.Error(pbData.OperationID, "PullMessageBySeqList error", err.Error())
return
}
log.InfoByKv("rpc call success to PullMessageBySeqList", pbData.OperationID, "ReplyArgs", reply.String(), len(reply.List))
log.NewInfo(pbData.OperationID, "rpc call success to PullMessageBySeqList", reply.String(), len(reply.List))
c.JSON(http.StatusOK, gin.H{
"errCode": reply.ErrCode,
"errMsg": reply.ErrMsg,

View File

@@ -62,18 +62,22 @@ func SendMsg(c *gin.Context) {
params := paramsUserSendMsg{}
if err := c.BindJSON(&params); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
log.ErrorByKv("json unmarshal err", "", "err", err.Error(), "data", c.PostForm("data"))
log.Error("0", "BindJSON failed ", err.Error())
return
}
token := c.Request.Header.Get("token")
log.InfoByKv("api call success to sendMsgReq", params.OperationID, "Parameters", params)
log.NewInfo(params.OperationID, "api call success to sendMsgReq", params)
pbData := newUserSendMsgReq(token, &params)
log.Info("", "", "api SendMsg call start..., [data: %s]", pbData.String())
log.Info(params.OperationID, "", "api SendMsg call start..., [data: %s]", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID)
if etcdConn == nil {
errMsg := params.OperationID + "getcdv3.GetConn == nil"
log.NewError(params.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbChat.NewChatClient(etcdConn)
log.Info("", "", "api SendMsg call, api call rpc...")
@@ -84,7 +88,7 @@ func SendMsg(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SendMsg rpc failed, " + err.Error()})
return
}
log.Info("", "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String())
log.Info(params.OperationID, "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String())
c.JSON(http.StatusOK, gin.H{
"errCode": reply.ErrCode,

View File

@@ -5,6 +5,7 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbConversation "Open_IM/pkg/proto/conversation"
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"context"
@@ -24,14 +25,20 @@ func SetConversation(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
reqPb.Conversation = &pbUser.Conversation{}
err := utils.CopyStructFields(&reqPb, req)
err = utils.CopyStructFields(reqPb.Conversation, req.Conversation)
if err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.SetConversation(context.Background(), &reqPb)
if err != nil {
@@ -44,6 +51,43 @@ func SetConversation(c *gin.Context) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
func ModifyConversationField(c *gin.Context) {
var (
req api.ModifyConversationFieldReq
resp api.ModifyConversationFieldResp
reqPb pbConversation.ModifyConversationFieldReq
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
reqPb.Conversation = &pbConversation.Conversation{}
err := utils.CopyStructFields(&reqPb, req)
err = utils.CopyStructFields(reqPb.Conversation, req.Conversation)
if err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbConversation.NewConversationClient(etcdConn)
respPb, err := client.ModifyConversationField(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
return
}
resp.ErrMsg = respPb.CommonResp.ErrMsg
resp.ErrCode = respPb.CommonResp.ErrCode
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
func BatchSetConversations(c *gin.Context) {
var (
@@ -56,11 +100,17 @@ func BatchSetConversations(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.BatchSetConversations(context.Background(), &reqPb)
if err != nil {
@@ -77,6 +127,18 @@ func BatchSetConversations(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 获取用户所有会话
// @Description 获取用户所有会话
// @Tags 会话相关
// @ID GetAllConversations
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetAllConversationsReq true "ownerUserID为要获取的用户ID"
// @Produce json
// @Success 0 {object} api.GetAllConversationsResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/get_all_conversations [post]
func GetAllConversations(c *gin.Context) {
var (
req api.GetAllConversationsReq
@@ -88,11 +150,17 @@ func GetAllConversations(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.GetAllConversations(context.Background(), &reqPb)
if err != nil {
@@ -109,6 +177,18 @@ func GetAllConversations(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 根据会话ID获取会话
// @Description 根据会话ID获取会话
// @Tags 会话相关
// @ID GetConversation
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetConversationReq true "ownerUserID为要获取的用户ID<br>conversationID为要获取的会话ID"
// @Produce json
// @Success 0 {object} api.GetConversationResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/get_conversation [post]
func GetConversation(c *gin.Context) {
var (
req api.GetConversationReq
@@ -120,15 +200,21 @@ func GetConversation(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.GetConversation(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error())
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversation rpc failed, ", reqPb.String(), err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
return
}
@@ -141,6 +227,18 @@ func GetConversation(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 根据会话ID列表获取会话
// @Description 根据会话ID列表获取会话
// @Tags 会话相关
// @ID GetConversations
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetConversationsReq true "ownerUserID为要获取的用户ID<br>conversationIDs为要获取的会话ID列表"
// @Produce json
// @Success 0 {object} api.GetConversationsResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/get_conversations [post]
func GetConversations(c *gin.Context) {
var (
req api.GetConversationsReq
@@ -152,11 +250,17 @@ func GetConversations(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.GetConversations(context.Background(), &reqPb)
if err != nil {
@@ -184,15 +288,21 @@ func SetRecvMsgOpt(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.SetRecvMsgOpt(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error())
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetRecvMsgOpt rpc failed, ", reqPb.String(), err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
return
}
@@ -201,3 +311,18 @@ func SetRecvMsgOpt(c *gin.Context) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
//Deprecated
func SetReceiveMessageOpt(c *gin.Context) {
}
//Deprecated
func GetReceiveMessageOpt(c *gin.Context) {
}
//Deprecated
func GetAllConversationMessageOpt(c *gin.Context) {
}

View File

@@ -16,6 +16,18 @@ import (
"strings"
)
// @Summary 添加黑名单
// @Description 添加黑名单
// @Tags 好友相关
// @ID AddBlack
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AddBlacklistReq true "fromUserID为设置的用户 <br> toUserID为被设置的用户"
// @Produce json
// @Success 0 {object} api.AddBlacklistResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/add_black [post]
func AddBlack(c *gin.Context) {
params := api.AddBlacklistReq{}
if err := c.BindJSON(&params); err != nil {
@@ -26,15 +38,17 @@ func AddBlack(c *gin.Context) {
req := &rpc.AddBlacklistReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(params.OperationID, "AddBlacklist args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.AddBlacklist(context.Background(), req)
if err != nil {
@@ -47,6 +61,18 @@ func AddBlack(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 批量加好友
// @Description 批量加好友
// @Tags 好友相关
// @ID ImportFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.ImportFriendReq true "fromUserID批量加好友的用户ID<br> friendUserIDList为"
// @Produce json
// @Success 0 {object} api.ImportFriendResp "data列表中对象的result-1为添加该用户失败<br>0为成功"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/import_friend [post]
func ImportFriend(c *gin.Context) {
params := api.ImportFriendReq{}
if err := c.BindJSON(&params); err != nil {
@@ -57,15 +83,24 @@ func ImportFriend(c *gin.Context) {
req := &rpc.ImportFriendReq{}
utils.CopyStructFields(req, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, "ImportFriend args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, "ImportFriend args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.ImportFriend(context.Background(), req)
if err != nil {
@@ -86,6 +121,18 @@ func ImportFriend(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 添加好友
// @Description 添加好友
// @Tags 好友相关
// @ID AddFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AddFriendReq true "reqMsg为申请信息 <br> fromUserID为申请用户 <br> toUserID为被添加用户"
// @Produce json
// @Success 0 {object} api.AddFriendResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/add_friend [post]
func AddFriend(c *gin.Context) {
params := api.AddFriendReq{}
if err := c.BindJSON(&params); err != nil {
@@ -96,16 +143,26 @@ func AddFriend(c *gin.Context) {
req := &rpc.AddFriendReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params.ParamsCommFriend)
req.ReqMsg = params.ReqMsg
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.AddFriend(context.Background(), req)
if err != nil {
@@ -119,6 +176,18 @@ func AddFriend(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 同意/拒绝好友请求
// @Description 同意/拒绝好友请求
// @Tags 好友相关
// @ID AddFriendResponse
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AddFriendResponseReq true "fromUserID同意/拒绝的用户ID<br>toUserID为申请用户D<br>handleMsg为处理信息<br>flag为具体操作, 1为同意, 2为拒绝"
// @Produce json
// @Success 0 {object} api.AddFriendResponseResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/add_friend_response [post]
func AddFriendResponse(c *gin.Context) {
params := api.AddFriendResponseReq{}
if err := c.BindJSON(&params); err != nil {
@@ -130,17 +199,28 @@ func AddFriendResponse(c *gin.Context) {
utils.CopyStructFields(req.CommID, &params.ParamsCommFriend)
req.HandleMsg = params.HandleMsg
req.HandleResult = params.Flag
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
utils.CopyStructFields(req, &params)
log.NewInfo(req.CommID.OperationID, "AddFriendResponse args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.AddFriendResponse(context.Background(), req)
if err != nil {
@@ -154,6 +234,18 @@ func AddFriendResponse(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 删除好友
// @Description 删除好友
// @Tags 好友相关
// @ID DeleteFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteFriendReq true "fromUserID为操作用户<br>toUserID为被删除用户"
// @Produce json
// @Success 0 {object} api.DeleteFriendResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/delete_friend [post]
func DeleteFriend(c *gin.Context) {
params := api.DeleteFriendReq{}
if err := c.BindJSON(&params); err != nil {
@@ -163,16 +255,26 @@ func DeleteFriend(c *gin.Context) {
}
req := &rpc.DeleteFriendReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params.ParamsCommFriend)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "DeleteFriend args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.DeleteFriend(context.Background(), req)
if err != nil {
@@ -186,6 +288,18 @@ func DeleteFriend(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 获取黑名单列表
// @Description 获取黑名单列表
// @Tags 好友相关
// @ID GetBlacklist
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetBlackListReq true "fromUserID要获取黑名单的用户"
// @Produce json
// @Success 0 {object} api.GetBlackListResp{data=[]open_im_sdk.PublicUserInfo}
// @Failure 500 {object} api.Swagger400Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger500Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_black_list [post]
func GetBlacklist(c *gin.Context) {
params := api.GetBlackListReq{}
if err := c.BindJSON(&params); err != nil {
@@ -195,16 +309,26 @@ func GetBlacklist(c *gin.Context) {
}
req := &rpc.GetBlacklistReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "GetBlacklist args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.GetBlacklist(context.Background(), req)
if err != nil {
@@ -224,6 +348,18 @@ func GetBlacklist(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 设置好友备注
// @Description 设置好友备注
// @Tags 好友相关
// @ID SetFriendRemark
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SetFriendRemarkReq true "fromUserID为设置的用户<br> toUserID为被设置的用户<br> remark为好友备注"
// @Produce json
// @Success 0 {object} api.SetFriendRemarkResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/set_friend_remark [post]
func SetFriendRemark(c *gin.Context) {
params := api.SetFriendRemarkReq{}
if err := c.BindJSON(&params); err != nil {
@@ -234,16 +370,26 @@ func SetFriendRemark(c *gin.Context) {
req := &rpc.SetFriendRemarkReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params.ParamsCommFriend)
req.Remark = params.Remark
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "SetFriendComment args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.SetFriendRemark(context.Background(), req)
if err != nil {
@@ -257,6 +403,18 @@ func SetFriendRemark(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 把用户移除黑名单
// @Description 把用户移除黑名单
// @Tags 好友相关
// @ID RemoveBlack
// @Accept json
// @Param token header string true "im token"
// @Param req body api.RemoveBlackListReq true "fromUserID要获取黑名单的用户"
// @Produce json
// @Success 0 {object} api.RemoveBlackListResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/remove_black [post]
func RemoveBlack(c *gin.Context) {
params := api.RemoveBlackListReq{}
if err := c.BindJSON(&params); err != nil {
@@ -266,16 +424,26 @@ func RemoveBlack(c *gin.Context) {
}
req := &rpc.RemoveBlacklistReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params.ParamsCommFriend)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "RemoveBlacklist args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.RemoveBlacklist(context.Background(), req)
if err != nil {
@@ -288,6 +456,18 @@ func RemoveBlack(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 检查用户之间是否为好友
// @Description 检查用户之间是否为好友
// @Tags 好友相关
// @ID IsFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.IsFriendReq true "fromUserID为请求用户<br> toUserID为要检查的用户"
// @Produce json
// @Success 0 {object} api.IsFriendResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/is_friend [post]
func IsFriend(c *gin.Context) {
params := api.IsFriendReq{}
if err := c.BindJSON(&params); err != nil {
@@ -297,16 +477,26 @@ func IsFriend(c *gin.Context) {
}
req := &rpc.IsFriendReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params.ParamsCommFriend)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "IsFriend args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.IsFriend(context.Background(), req)
if err != nil {
@@ -321,40 +511,18 @@ func IsFriend(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
//
//func GetFriendsInfo(c *gin.Context) {
// params := api.GetFriendsInfoReq{}
// if err := c.BindJSON(&params); err != nil {
// log.NewError("0", "BindJSON failed ", err.Error())
// c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
// return
// }
// req := &rpc.GetFriendsInfoReq{}
// utils.CopyStructFields(req.CommID, params)
// var ok bool
// ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
// if !ok {
// log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
// return
// }
// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo args ", req.String())
//
// etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
// client := rpc.NewFriendClient(etcdConn)
// RpcResp, err := client.GetFriendsInfo(context.Background(), req)
// if err != nil {
// log.NewError(req.CommID.OperationID, "GetFriendsInfo failed ", err.Error(), req.String())
// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call search friend rpc server failed"})
// return
// }
//
// resp := api.GetFriendsInfoResp{CommResp:api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
// utils.CopyStructFields(&resp, RpcResp)
// c.JSON(http.StatusOK, resp)
// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo api return ", resp)
//}
// @Summary 获取用户的好友列表
// @Description 获取用户的好友列表
// @Tags 好友相关
// @ID GetFriendList
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetFriendListReq true "fromUserID为要获取好友列表的用户ID"
// @Produce json
// @Success 0 {object} api.GetFriendListResp{data=[]open_im_sdk.FriendInfo}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_friend_list [post]
func GetFriendList(c *gin.Context) {
params := api.GetFriendListReq{}
if err := c.BindJSON(&params); err != nil {
@@ -364,16 +532,26 @@ func GetFriendList(c *gin.Context) {
}
req := &rpc.GetFriendListReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "GetFriendList args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.GetFriendList(context.Background(), req)
if err != nil {
@@ -389,6 +567,18 @@ func GetFriendList(c *gin.Context) {
//c.JSON(http.StatusOK, resp)
}
// @Summary 获取好友申请列表
// @Description 删除好友
// @Tags 好友相关
// @ID GetFriendApplyList
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetFriendApplyListReq true "fromUserID为要获取申请列表的用户ID"
// @Produce json
// @Success 0 {object} api.GetFriendApplyListResp{data=[]open_im_sdk.FriendRequest}
// @Failure 500 {object} api.Swagger400Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_friend_apply_list [post]
func GetFriendApplyList(c *gin.Context) {
params := api.GetFriendApplyListReq{}
if err := c.BindJSON(&params); err != nil {
@@ -398,16 +588,26 @@ func GetFriendApplyList(c *gin.Context) {
}
req := &rpc.GetFriendApplyListReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "GetFriendApplyList args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.GetFriendApplyList(context.Background(), req)
@@ -423,6 +623,18 @@ func GetFriendApplyList(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 获取自己的好友申请列表
// @Description 获取自己的好友申请列表
// @Tags 好友相关
// @ID GetSelfFriendApplyList
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetSelfApplyListReq true "fromUserID为自己的用户ID"
// @Produce json
// @Success 0 {object} api.GetSelfApplyListResp{data=[]open_im_sdk.FriendRequest}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_self_friend_apply_list [post]
func GetSelfFriendApplyList(c *gin.Context) {
params := api.GetSelfApplyListReq{}
if err := c.BindJSON(&params); err != nil {
@@ -432,16 +644,26 @@ func GetSelfFriendApplyList(c *gin.Context) {
}
req := &rpc.GetSelfApplyListReq{CommID: &rpc.CommID{}}
utils.CopyStructFields(req.CommID, &params)
var ok bool
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
var errInfo string
ok, req.CommID.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID)
if !ok {
log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.CommID.OperationID, "GetSelfApplyList args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID)
if etcdConn == nil {
errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewFriendClient(etcdConn)
RpcResp, err := client.GetSelfApplyList(context.Background(), req)
if err != nil {

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,89 @@
package group
import (
jsonData "Open_IM/internal/utils"
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
rpc "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)
func GetJoinedSuperGroupList(c *gin.Context) {
req := api.GetJoinedSuperGroupListReq{}
if err := c.BindJSON(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb := rpc.GetJoinedSuperGroupListReq{OperationID: req.OperationID, OpUserID: opUserID, UserID: req.FromUserID}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewGroupClient(etcdConn)
rpcResp, err := client.GetJoinedSuperGroupList(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), reqPb.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
GroupListResp := api.GetJoinedSuperGroupListResp{GetJoinedGroupListResp: api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupList}}
GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList)
log.NewInfo(req.OperationID, "GetJoinedGroupList api return ", GroupListResp)
c.JSON(http.StatusOK, GroupListResp)
}
func GetSuperGroupsInfo(c *gin.Context) {
req := api.GetSuperGroupsInfoReq{}
if err := c.BindJSON(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb := rpc.GetSuperGroupsInfoReq{OperationID: req.OperationID, OpUserID: opUserID, GroupIDList: req.GroupIDList}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewGroupClient(etcdConn)
rpcResp, err := client.GetSuperGroupsInfo(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), reqPb.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
resp := api.GetSuperGroupsInfoResp{GetGroupInfoResp: api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupInfoList}}
resp.Data = jsonData.JsonDataList(resp.GroupInfoList)
log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp)
c.JSON(http.StatusOK, resp)
}

View File

@@ -20,6 +20,7 @@ import (
"context"
"github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10"
"github.com/golang/protobuf/proto"
"github.com/mitchellh/mapstructure"
"net/http"
"strings"
@@ -27,8 +28,9 @@ import (
var validate *validator.Validate
func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq {
func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
var newContent string
var err error
switch params.ContentType {
case constant.Text:
newContent = params.Content["text"].(string)
@@ -38,15 +40,16 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq {
fallthrough
case constant.Voice:
fallthrough
case constant.Video:
fallthrough
case constant.File:
newContent = utils.StructToJsonString(params.Content)
case constant.Revoke:
newContent = params.Content["revokeMsgClientID"].(string)
default:
}
var options map[string]bool
options := make(map[string]bool, 5)
if params.IsOnlineOnly {
options = make(map[string]bool, 5)
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
utils.SetSwitchFromOptions(options, constant.IsHistory, false)
utils.SetSwitchFromOptions(options, constant.IsPersistent, false)
@@ -56,7 +59,6 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq {
OperationID: params.OperationID,
MsgData: &open_im_sdk.MsgData{
SendID: params.SendID,
RecvID: params.RecvID,
GroupID: params.GroupID,
ClientMsgID: utils.GetMsgID(params.SendID),
SenderPlatformID: params.SenderPlatformID,
@@ -66,24 +68,47 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq {
MsgFrom: constant.SysMsgType,
ContentType: params.ContentType,
Content: []byte(newContent),
RecvID: params.RecvID,
// ForceList: params.ForceList,
CreateTime: utils.GetCurrentTimestampByMill(),
Options: options,
OfflinePushInfo: params.OfflinePushInfo,
},
}
if params.ContentType == constant.OANotification {
var tips open_im_sdk.TipsComm
tips.JsonDetail = utils.StructToJsonString(params.Content)
pbData.MsgData.Content, err = proto.Marshal(&tips)
if err != nil {
log.Error(params.OperationID, "Marshal failed ", err.Error(), tips.String())
}
}
return &pbData
}
func init() {
validate = validator.New()
}
// @Summary 管理员发送/撤回消息
// @Description 管理员发送/撤回消息 消息格式详细见<a href="https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0">消息格式</href>
// @Tags 消息相关
// @ID ManagementSendMsg
// @Accept json
// @Param token header string true "im token"
// @Param 管理员发送文字消息 body api.ManagementSendMsgReq{content=TextElem{}} true "该请求和消息结构体一样"
// @Param 管理员发送OA通知消息 body api.ManagementSendMsgReq{content=OANotificationElem{}} true "该请求和消息结构体一样"
// @Param 管理员撤回单聊消息 body api.ManagementSendMsgReq{content=RevokeElem{}} true "该请求和消息结构体一样"
// @Produce json
// @Success 0 {object} api.ManagementSendMsgResp "serverMsgID为服务器消息ID <br> clientMsgID为客户端消息ID <br> sendTime为发送消息时间"
// @Failure 500 {object} api.ManagementSendMsgResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ManagementSendMsgResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/manage_send_msg [post]
func ManagementSendMsg(c *gin.Context) {
var data interface{}
params := ManagementSendMsgReq{}
params := api.ManagementSendMsgReq{}
if err := c.BindJSON(&params); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
log.ErrorByKv("json unmarshal err", c.PostForm("operationID"), "err", err.Error(), "content", c.PostForm("content"))
log.Error(c.PostForm("operationID"), "json unmarshal err", err.Error(), c.PostForm("content"))
return
}
switch params.ContentType {
@@ -107,26 +132,29 @@ func ManagementSendMsg(c *gin.Context) {
data = CustomElem{}
case constant.Revoke:
data = RevokeElem{}
case constant.OANotification:
data = OANotificationElem{}
params.SessionType = constant.NotificationChatType
//case constant.HasReadReceipt:
//case constant.Typing:
//case constant.Quote:
default:
c.JSON(http.StatusBadRequest, gin.H{"errCode": 404, "errMsg": "contentType err"})
log.ErrorByKv("contentType err", c.PostForm("operationID"), "content", c.PostForm("content"))
log.Error(c.PostForm("operationID"), "contentType err", c.PostForm("content"))
return
}
if err := mapstructure.WeakDecode(params.Content, &data); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": err.Error()})
log.ErrorByKv("content to Data struct err", "", "err", err.Error())
log.Error(c.PostForm("operationID"), "content to Data struct err", err.Error())
return
} else if err := validate.Struct(data); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 403, "errMsg": err.Error()})
log.ErrorByKv("data args validate err", "", "err", err.Error())
log.Error(c.PostForm("operationID"), "data args validate err", err.Error())
return
}
log.NewInfo("", data, params)
log.NewInfo(params.OperationID, data, params)
token := c.Request.Header.Get("token")
claims, err := token_verify.ParseToken(token)
claims, err := token_verify.ParseToken(token, params.OperationID)
if err != nil {
log.NewError(params.OperationID, "parse token failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""})
@@ -152,15 +180,21 @@ func ManagementSendMsg(c *gin.Context) {
}
}
log.InfoByKv("Ws call success to ManagementSendMsgReq", params.OperationID, "Parameters", params)
log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params)
pbData := newUserSendMsgReq(&params)
log.Info("", "", "api ManagementSendMsg call start..., [data: %s]", pbData.String())
log.Info(params.OperationID, "", "api ManagementSendMsg call start..., [data: %s]", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID)
if etcdConn == nil {
errMsg := params.OperationID + "getcdv3.GetConn == nil"
log.NewError(params.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbChat.NewChatClient(etcdConn)
log.Info("", "", "api ManagementSendMsg call, api call rpc...")
log.Info(params.OperationID, "", "api ManagementSendMsg call, api call rpc...")
RpcResp, err := client.SendMsg(context.Background(), pbData)
if err != nil {
@@ -168,52 +202,140 @@ func ManagementSendMsg(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"})
return
}
log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String())
log.Info(params.OperationID, "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String())
resp := api.ManagementSendMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, ResultList: server_api_params.UserSendMsgResp{ServerMsgID: RpcResp.ServerMsgID, ClientMsgID: RpcResp.ClientMsgID, SendTime: RpcResp.SendTime}}
log.Info(params.OperationID, "ManagementSendMsg return", resp)
c.JSON(http.StatusOK, resp)
}
//
//type MergeElem struct {
// Title string `json:"title"`
// AbstractList []string `json:"abstractList"`
// MultiMessage []*MsgStruct `json:"multiMessage"`
//}
//
//type QuoteElem struct {
// Text string `json:"text"`
// QuoteMessage *MsgStruct `json:"quoteMessage"`
//}
type ManagementSendMsgReq struct {
OperationID string `json:"operationID" binding:"required"`
SendID string `json:"sendID" binding:"required"`
RecvID string `json:"recvID" `
GroupID string `json:"groupID" `
SenderNickname string `json:"senderNickname" `
SenderFaceURL string `json:"senderFaceURL" `
SenderPlatformID int32 `json:"senderPlatformID"`
ForceList []string `json:"forceList" `
Content map[string]interface{} `json:"content" binding:"required"`
ContentType int32 `json:"contentType" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
IsOnlineOnly bool `json:"isOnlineOnly"`
OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"`
// @Summary 管理员批量发送群聊单聊消息
// @Description 管理员批量发送群聊单聊消息 消息格式详细见<a href="https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0">消息格式</href>
// @Tags 消息相关
// @ID ManagementBatchSendMsg
// @Accept json
// @Param token header string true "im token"
// @Param 管理员批量发送单聊消息 body api.ManagementBatchSendMsgReq{content=TextElem{}} true "该请求和消息结构体一样 <br> recvIDList为接受消息的用户ID列表"
// @Param 管理员批量发送OA通知 body api.ManagementSendMsgReq{content=OANotificationElem{}} true "该请求和消息结构体一样 <br> recvIDList为接受消息的用户ID列表"
// @Produce json
// @Success 0 {object} api.ManagementBatchSendMsgReq "serverMsgID为服务器消息ID <br> clientMsgID为客户端消息ID <br> sendTime为发送消息时间"
// @Failure 500 {object} api.ManagementBatchSendMsgReq "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ManagementBatchSendMsgReq "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/batch_send_msg [post]
func ManagementBatchSendMsg(c *gin.Context) {
var data interface{}
params := api.ManagementBatchSendMsgReq{}
resp := api.ManagementBatchSendMsgResp{}
resp.Data.FailedIDList = make([]string, 0)
if err := c.BindJSON(&params); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
log.Error(c.PostForm("operationID"), "json unmarshal err", err.Error(), c.PostForm("content"))
return
}
switch params.ContentType {
case constant.Text:
data = TextElem{}
case constant.Picture:
data = PictureElem{}
case constant.Voice:
data = SoundElem{}
case constant.Video:
data = VideoElem{}
case constant.File:
data = FileElem{}
//case constant.AtText:
// data = AtElem{}
//case constant.Merger:
// data =
//case constant.Card:
//case constant.Location:
case constant.Custom:
data = CustomElem{}
case constant.Revoke:
data = RevokeElem{}
case constant.OANotification:
data = OANotificationElem{}
params.SessionType = constant.NotificationChatType
//case constant.HasReadReceipt:
//case constant.Typing:
//case constant.Quote:
default:
c.JSON(http.StatusBadRequest, gin.H{"errCode": 404, "errMsg": "contentType err"})
log.Error(c.PostForm("operationID"), "contentType err", c.PostForm("content"))
return
}
if err := mapstructure.WeakDecode(params.Content, &data); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": err.Error()})
log.Error(c.PostForm("operationID"), "content to Data struct err", err.Error())
return
} else if err := validate.Struct(data); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 403, "errMsg": err.Error()})
log.Error(c.PostForm("operationID"), "data args validate err", err.Error())
return
}
log.NewInfo(params.OperationID, data, params)
token := c.Request.Header.Get("token")
claims, err := token_verify.ParseToken(token, params.OperationID)
if err != nil {
log.NewError(params.OperationID, "parse token failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""})
return
}
if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not authorized", "sendTime": 0, "MsgID": ""})
return
}
log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params)
for _, recvID := range params.RecvIDList {
req := &api.ManagementSendMsgReq{
ManagementSendMsg: params.ManagementSendMsg,
RecvID: recvID,
}
pbData := newUserSendMsgReq(req)
pbData.MsgData.RecvID = recvID
log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID)
if etcdConn == nil {
errMsg := params.OperationID + "getcdv3.GetConn == nil"
log.NewError(params.OperationID, errMsg)
resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID)
continue
}
client := pbChat.NewChatClient(etcdConn)
rpcResp, err := client.SendMsg(context.Background(), pbData)
if err != nil {
log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error())
resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID)
continue
}
if rpcResp.ErrCode != 0 {
log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData, rpcResp)
resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID)
continue
}
resp.Data.ResultList = append(resp.Data.ResultList, server_api_params.UserSendMsgResp{
ServerMsgID: rpcResp.ServerMsgID,
ClientMsgID: rpcResp.ClientMsgID,
SendTime: rpcResp.SendTime,
})
}
log.NewInfo(params.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
type PictureBaseInfo struct {
UUID string `mapstructure:"uuid"`
Type string `mapstructure:"type" validate:"required"`
Size int64 `mapstructure:"size" validate:"required"`
Width int32 `mapstructure:"width" validate:"required"`
Height int32 `mapstructure:"height" validate:"required"`
Url string `mapstructure:"url" validate:"required"`
Type string `mapstructure:"type" `
Size int64 `mapstructure:"size" `
Width int32 `mapstructure:"width" `
Height int32 `mapstructure:"height"`
Url string `mapstructure:"url" `
}
type PictureElem struct {
SourcePath string `mapstructure:"sourcePath"`
SourcePicture PictureBaseInfo `mapstructure:"sourcePicture" validate:"required"`
SourcePicture PictureBaseInfo `mapstructure:"sourcePicture"`
BigPicture PictureBaseInfo `mapstructure:"bigPicture" `
SnapshotPicture PictureBaseInfo `mapstructure:"snapshotPicture"`
}
@@ -267,3 +389,16 @@ type TextElem struct {
type RevokeElem struct {
RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"`
}
type OANotificationElem struct {
NotificationName string `mapstructure:"notificationName" json:"notificationName" validate:"required"`
NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL" validate:"required"`
NotificationType int32 `mapstructure:"notificationType" json:"notificationType" validate:"required"`
Text string `mapstructure:"text" json:"text" validate:"required"`
Url string `mapstructure:"url" json:"url"`
MixType int32 `mapstructure:"mixType" json:"mixType"`
PictureElem PictureElem `mapstructure:"pictureElem" json:"pictureElem"`
SoundElem SoundElem `mapstructure:"soundElem" json:"soundElem"`
VideoElem VideoElem `mapstructure:"videoElem" json:"videoElem"`
FileElem FileElem `mapstructure:"fileElem" json:"fileElem"`
Ex string `mapstructure:"ex" json:"ex"`
}

View File

@@ -30,15 +30,25 @@ func DeleteUser(c *gin.Context) {
}
req := &rpc.DeleteUsersReq{}
utils.CopyStructFields(req, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(params.OperationID, "DeleteUser args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewUserClient(etcdConn)
RpcResp, err := client.DeleteUsers(context.Background(), req)
@@ -54,6 +64,19 @@ func DeleteUser(c *gin.Context) {
log.NewInfo(req.OperationID, "DeleteUser api return", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 获取所有用户uid列表
// @Description 获取所有用户uid列表
// @Tags 用户相关
// @ID GetAllUsersUid
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetAllUsersUidReq true "请求体"
// @Produce json
// @Success 0 {object} api.GetAllUsersUidResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/get_all_users_uid [post]
func GetAllUsersUid(c *gin.Context) {
params := api.GetAllUsersUidReq{}
if err := c.BindJSON(&params); err != nil {
@@ -62,15 +85,25 @@ func GetAllUsersUid(c *gin.Context) {
}
req := &rpc.GetAllUserIDReq{}
utils.CopyStructFields(req, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(params.OperationID, "GetAllUsersUid args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewUserClient(etcdConn)
RpcResp, err := client.GetAllUserID(context.Background(), req)
if err != nil {
@@ -86,6 +119,19 @@ func GetAllUsersUid(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 检查列表账户注册状态,并且返回结果
// @Description 传入UserIDList检查列表账户注册状态并且返回结果
// @Tags 用户相关
// @ID AccountCheck
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AccountCheckReq true "请求体"
// @Produce json
// @Success 0 {object} api.AccountCheckResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/account_check [post]
func AccountCheck(c *gin.Context) {
params := api.AccountCheckReq{}
if err := c.BindJSON(&params); err != nil {
@@ -94,15 +140,25 @@ func AccountCheck(c *gin.Context) {
}
req := &rpc.AccountCheckReq{}
utils.CopyStructFields(req, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(params.OperationID, "AccountCheck args ", req.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewUserClient(etcdConn)
RpcResp, err := client.AccountCheck(context.Background(), req)
@@ -118,6 +174,7 @@ func AccountCheck(c *gin.Context) {
log.NewInfo(req.OperationID, "AccountCheck api return", resp)
c.JSON(http.StatusOK, resp)
}
func GetUsersOnlineStatus(c *gin.Context) {
params := api.GetUsersOnlineStatusReq{}
if err := c.BindJSON(&params); err != nil {
@@ -126,13 +183,17 @@ func GetUsersOnlineStatus(c *gin.Context) {
}
req := &pbRelay.GetUsersOnlineStatusReq{}
utils.CopyStructFields(req, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
var errInfo string
ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(params.OperationID, "GetUsersOnlineStatus args ", req.String())
var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult
var respResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult
@@ -176,5 +237,4 @@ func GetUsersOnlineStatus(c *gin.Context) {
}
log.NewInfo(req.OperationID, "GetUsersOnlineStatus api return", resp)
c.JSON(http.StatusOK, resp)
}

450
internal/api/office/tag.go Normal file
View File

@@ -0,0 +1,450 @@
package office
import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbOffice "Open_IM/pkg/proto/office"
pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"google.golang.org/grpc"
"net/http"
"strings"
)
// @Summary 获取用户标签信息
// @Description 用户获取自己的所有的标签
// @Tags 标签
// @ID GetUserTags
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetUserTagsReq true "请求"
// @Produce json
// @Success 0 {object} api.GetUserTagsResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/get_user_tags [post]
func GetUserTags(c *gin.Context) {
var (
req api.GetUserTagsReq
resp api.GetUserTagsResp
reqPb pbOffice.GetUserTagsReq
respPb *pbOffice.GetUserTagsResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.UserID = userID
reqPb.OperationID = req.OperationID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetUserTags(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserTags rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
if respPb.Tags != nil {
resp.Data.Tags = respPb.Tags
} else {
resp.Data.Tags = []*pbOffice.Tag{}
}
c.JSON(http.StatusOK, resp)
}
// @Summary 创建标签
// @Description 创建标签
// @Tags 标签
// @ID CreateTag
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateTagReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateTagResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/create_tag [post]
func CreateTag(c *gin.Context) {
var (
req api.CreateTagReq
resp api.CreateTagResp
reqPb pbOffice.CreateTagReq
respPb *pbOffice.CreateTagResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.CreateTag(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
c.JSON(http.StatusOK, resp)
}
// @Summary 删除标签
// @Description 根据标签ID创建标签
// @Tags 标签
// @ID DeleteTag
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteTagReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteTagResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/delete_tag [post]
func DeleteTag(c *gin.Context) {
var (
req api.DeleteTagReq
resp api.DeleteTagResp
reqPb pbOffice.DeleteTagReq
respPb *pbOffice.DeleteTagResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.DeleteTag(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
c.JSON(http.StatusOK, resp)
}
// @Summary 修改标签
// @Description 根据标签ID修改标签用户列表, 名称
// @Tags 标签
// @ID SetTag
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SetTagReq true "请求"
// @Produce json
// @Success 0 {object} api.SetTagResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/set_tag [post]
func SetTag(c *gin.Context) {
var (
req api.SetTagReq
resp api.SetTagResp
reqPb pbOffice.SetTagReq
respPb *pbOffice.SetTagResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.SetTag(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
c.JSON(http.StatusOK, resp)
}
// @Summary 发送标签消息
// @Description 对标签用户发送消息
// @Tags 标签
// @ID SendMsg2Tag
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SendMsg2TagReq true "请求"
// @Produce json
// @Success 0 {object} api.SendMsg2TagResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/send_msg_to_tag [post]
func SendMsg2Tag(c *gin.Context) {
var (
req api.SendMsg2TagReq
resp api.SendMsg2TagResp
reqPb pbOffice.SendMsg2TagReq
respPb *pbOffice.SendMsg2TagResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.SendID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.SendMsg2Tag(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
c.JSON(http.StatusOK, resp)
}
// @Summary 获取发送历史记录
// @Description 分页获取发送历史记录
// @Tags 标签
// @ID GetTagSendLogs
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetTagSendLogsReq true "请求"
// @Produce json
// @Success 0 {object} api.GetTagSendLogsResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/get_send_tag_log [post]
func GetTagSendLogs(c *gin.Context) {
var (
req api.GetTagSendLogsReq
resp api.GetTagSendLogsResp
reqPb pbOffice.GetTagSendLogsReq
respPb *pbOffice.GetTagSendLogsResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.UserID = userID
reqPb.OperationID = req.OperationID
reqPb.Pagination = &pbCommon.RequestPagination{
PageNumber: req.PageNumber,
ShowNumber: req.ShowNumber,
}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
maxSizeOption := grpc.MaxCallRecvMsgSize(1024 * 1024 * 20)
respPb, err := client.GetTagSendLogs(context.Background(), &reqPb, maxSizeOption)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagSendLogs failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetTagSendLogs rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
if respPb.TagSendLogs != nil {
resp.Data.Logs = respPb.TagSendLogs
} else {
resp.Data.Logs = []*pbOffice.TagSendLog{}
}
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
c.JSON(http.StatusOK, resp)
}
// @Summary 获取该用户的标签信息
// @Description 通过标签id获取该用户的标签信息
// @Tags 标签
// @ID GetUserTagByID
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetUserTagByIDReq true "请求"
// @Produce json
// @Success 0 {object} api.GetUserTagByIDResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/get_user_tag_by_id [post]
func GetUserTagByID(c *gin.Context) {
var (
req api.GetUserTagByIDReq
resp api.GetUserTagByIDResp
reqPb pbOffice.GetUserTagByIDReq
respPb *pbOffice.GetUserTagByIDResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.UserID = userID
reqPb.OperationID = req.OperationID
reqPb.TagID = req.TagID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetUserTagByID(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTagByID failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
resp.Data.Tag = respPb.Tag
c.JSON(http.StatusOK, resp)
}

View File

@@ -0,0 +1,671 @@
package office
import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbOffice "Open_IM/pkg/proto/office"
pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)
// @Summary 创建一条工作圈
// @Description 用户创建一条工作圈
// @Tags 工作圈
// @ID CreateOneWorkMoment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateOneWorkMomentReq true "请求 atUserList likeUserList permissionGroupList permissionUserList 字段中userName可以不填"
// @Produce json
// @Success 0 {object} api.CreateOneWorkMomentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/create_one_work_moment [post]
func CreateOneWorkMoment(c *gin.Context) {
var (
req api.CreateOneWorkMomentReq
resp api.CreateOneWorkMomentResp
reqPb pbOffice.CreateOneWorkMomentReq
respPb *pbOffice.CreateOneWorkMomentResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
reqPb.WorkMoment.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.CreateOneWorkMoment(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CreateOneWorkMoment rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateOneWorkMoment rpc server failed" + err.Error()})
return
}
resp.CommResp = api.CommResp{
ErrCode: respPb.CommonResp.ErrCode,
ErrMsg: respPb.CommonResp.ErrMsg,
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 删除一条工作圈
// @Description 根据用户工作圈ID删除一条工作圈
// @Tags 工作圈
// @ID DeleteOneWorkMoment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteOneWorkMomentReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteOneWorkMomentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/delete_one_work_moment [post]
func DeleteOneWorkMoment(c *gin.Context) {
var (
req api.DeleteOneWorkMomentReq
resp api.DeleteOneWorkMomentResp
reqPb pbOffice.DeleteOneWorkMomentReq
respPb *pbOffice.DeleteOneWorkMomentResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.DeleteOneWorkMoment(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteOneWorkMoment rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "DeleteOneWorkMoment rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 点赞一条工作圈
// @Description 工作圈ID点赞一条工作圈
// @Tags 工作圈
// @ID LikeOneWorkMoment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.LikeOneWorkMomentReq true "请求"
// @Produce json
// @Success 0 {object} api.LikeOneWorkMomentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/like_one_work_moment [post]
func LikeOneWorkMoment(c *gin.Context) {
var (
req api.LikeOneWorkMomentReq
resp api.LikeOneWorkMomentResp
reqPb pbOffice.LikeOneWorkMomentReq
respPb *pbOffice.LikeOneWorkMomentResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.LikeOneWorkMoment(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "LikeOneWorkMoment rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "LikeOneWorkMoment rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 评论一条工作圈
// @Description 评论一条工作圈
// @Tags 工作圈
// @ID CommentOneWorkMoment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CommentOneWorkMomentReq true "请求"
// @Produce json
// @Success 0 {object} api.CommentOneWorkMomentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/comment_one_work_moment [post]
func CommentOneWorkMoment(c *gin.Context) {
var (
req api.CommentOneWorkMomentReq
resp api.CommentOneWorkMomentResp
reqPb pbOffice.CommentOneWorkMomentReq
respPb *pbOffice.CommentOneWorkMomentResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.CommentOneWorkMoment(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CommentOneWorkMoment rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CommentOneWorkMoment rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 删除一条评论
// @Description 删除一条评论
// @Tags 工作圈
// @ID DeleteComment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteCommentReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteCommentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/delete_comment [post]
func DeleteComment(c *gin.Context) {
var (
req api.DeleteCommentReq
resp api.DeleteCommentResp
reqPb pbOffice.DeleteCommentReq
respPb *pbOffice.DeleteCommentResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), err.Error())
}
var ok bool
var errInfo string
ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.DeleteComment(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteComment rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "DeleteComment rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 通过ID获取工作圈
// @Description 通过ID获取工作圈
// @Tags 工作圈
// @ID GetWorkMomentByID
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetWorkMomentByIDReq true "请求"
// @Produce json
// @Success 0 {object} api.GetWorkMomentByIDResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/get_work_moment_by_id [post]
func GetWorkMomentByID(c *gin.Context) {
var (
req api.GetWorkMomentByIDReq
resp api.GetWorkMomentByIDResp
reqPb pbOffice.GetWorkMomentByIDReq
respPb *pbOffice.GetWorkMomentByIDResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.OperationID = req.OperationID
reqPb.OpUserID = userID
reqPb.WorkMomentID = req.WorkMomentID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetWorkMomentByID(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
resp.Data.WorkMoment = &api.WorkMoment{LikeUserList: []*api.WorkMomentUser{}, Comments: []*api.Comment{},
AtUserList: []*api.WorkMomentUser{}, PermissionUserList: []*api.WorkMomentUser{}}
if err := utils.CopyStructFields(&resp.Data.WorkMoment, respPb.WorkMoment); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 查询用户工作圈
// @Description 查询用户工作圈
// @Tags 工作圈
// @ID GetUserWorkMoments
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetUserWorkMomentsReq true "请求"
// @Produce json
// @Success 0 {object} api.GetUserWorkMomentsResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/get_user_work_moments [post]
func GetUserWorkMoments(c *gin.Context) {
var (
req api.GetUserWorkMomentsReq
resp api.GetUserWorkMomentsResp
reqPb pbOffice.GetUserWorkMomentsReq
respPb *pbOffice.GetUserWorkMomentsResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var opUserID string
ok, opUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.OperationID = req.OperationID
reqPb.Pagination = &pbCommon.RequestPagination{
PageNumber: req.PageNumber,
ShowNumber: req.ShowNumber,
}
reqPb.OpUserID = opUserID
reqPb.UserID = req.UserID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()})
return
}
resp.Data.WorkMoments = []*api.WorkMoment{}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
for _, v := range respPb.WorkMoments {
workMoment := api.WorkMoment{
WorkMomentID: v.WorkMomentID,
UserID: v.UserID,
Content: v.Content,
FaceURL: v.FaceURL,
UserName: v.UserName,
CreateTime: v.CreateTime,
Comments: make([]*api.Comment, len(v.Comments)),
LikeUserList: make([]*api.WorkMomentUser, len(v.LikeUserList)),
AtUserList: make([]*api.WorkMomentUser, len(v.AtUserList)),
PermissionUserList: make([]*api.WorkMomentUser, len(v.PermissionUserList)),
Permission: v.Permission,
}
for i, comment := range v.Comments {
workMoment.Comments[i] = &api.Comment{
UserID: comment.UserID,
UserName: comment.UserName,
ReplyUserID: comment.ReplyUserID,
ReplyUserName: comment.ReplyUserName,
ContentID: comment.ContentID,
Content: comment.Content,
CreateTime: comment.CreateTime,
}
}
for i, likeUser := range v.LikeUserList {
workMoment.LikeUserList[i] = &api.WorkMomentUser{
UserID: likeUser.UserID,
UserName: likeUser.UserName,
}
}
for i, atUser := range v.AtUserList {
workMoment.AtUserList[i] = &api.WorkMomentUser{
UserID: atUser.UserID,
UserName: atUser.UserName,
}
}
for i, permissionUser := range v.PermissionUserList {
workMoment.PermissionUserList[i] = &api.WorkMomentUser{
UserID: permissionUser.UserID,
UserName: permissionUser.UserName,
}
}
resp.Data.WorkMoments = append(resp.Data.WorkMoments, &workMoment)
}
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
// @Summary 查询自己大工作圈页面
// @Description 查询用户工作圈页面
// @Tags 工作圈
// @ID GetUserFriendWorkMoments
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetUserFriendWorkMomentsReq true "请求"
// @Produce json
// @Success 0 {object} api.GetUserFriendWorkMomentsResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /office/get_user_friend_work_moments [post]
func GetUserFriendWorkMoments(c *gin.Context) {
var (
req api.GetUserFriendWorkMomentsReq
resp api.GetUserFriendWorkMomentsResp
reqPb pbOffice.GetUserFriendWorkMomentsReq
respPb *pbOffice.GetUserFriendWorkMomentsResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb.OperationID = req.OperationID
reqPb.Pagination = &pbCommon.RequestPagination{
PageNumber: req.PageNumber,
ShowNumber: req.ShowNumber,
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetUserFriendWorkMoments(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserFriendWorkMoments rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
//if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil {
// log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
//}
resp.Data.WorkMoments = []*api.WorkMoment{}
for _, v := range respPb.WorkMoments {
workMoment := api.WorkMoment{
WorkMomentID: v.WorkMomentID,
UserID: v.UserID,
Content: v.Content,
FaceURL: v.FaceURL,
UserName: v.UserName,
CreateTime: v.CreateTime,
Comments: make([]*api.Comment, len(v.Comments)),
LikeUserList: make([]*api.WorkMomentUser, len(v.LikeUserList)),
AtUserList: make([]*api.WorkMomentUser, len(v.AtUserList)),
PermissionUserList: make([]*api.WorkMomentUser, len(v.PermissionUserList)),
Permission: v.Permission,
}
for i, comment := range v.Comments {
workMoment.Comments[i] = &api.Comment{
UserID: comment.UserID,
UserName: comment.UserName,
ReplyUserID: comment.ReplyUserID,
ReplyUserName: comment.ReplyUserName,
ContentID: comment.ContentID,
Content: comment.Content,
CreateTime: comment.CreateTime,
}
}
for i, likeUser := range v.LikeUserList {
workMoment.LikeUserList[i] = &api.WorkMomentUser{
UserID: likeUser.UserID,
UserName: likeUser.UserName,
}
}
for i, atUser := range v.AtUserList {
workMoment.AtUserList[i] = &api.WorkMomentUser{
UserID: atUser.UserID,
UserName: atUser.UserName,
}
}
for i, permissionUser := range v.PermissionUserList {
workMoment.PermissionUserList[i] = &api.WorkMomentUser{
UserID: permissionUser.UserID,
UserName: permissionUser.UserName,
}
}
resp.Data.WorkMoments = append(resp.Data.WorkMoments, &workMoment)
}
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}
func SetUserWorkMomentsLevel(c *gin.Context) {
var (
req api.SetUserWorkMomentsLevelReq
resp api.SetUserWorkMomentsLevelResp
reqPb pbOffice.SetUserWorkMomentsLevelReq
respPb *pbOffice.SetUserWorkMomentsLevelResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
var userID string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
if err := utils.CopyStructFields(&reqPb, req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
reqPb.UserID = userID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.SetUserWorkMomentsLevel(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetUserWorkMomentsLevel rpc failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "SetUserWorkMomentsLevel rpc server failed" + err.Error()})
return
}
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
c.JSON(http.StatusOK, resp)
}

View File

@@ -0,0 +1,659 @@
package organization
import (
jsonData "Open_IM/internal/utils"
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
rpc "Open_IM/pkg/proto/organization"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)
// @Summary 创建部门
// @Description 创建部门
// @Tags 组织架构相关
// @ID CreateDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateDepartmentResp{data=open_im_sdk.Department}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/create_department [post]
func CreateDepartment(c *gin.Context) {
params := api.CreateDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.CreateDepartmentReq{DepartmentInfo: &open_im_sdk.Department{}}
utils.CopyStructFields(req, &params)
utils.CopyStructFields(req.DepartmentInfo, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + " " + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.CreateDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc CreateDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.CreateDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, Department: RpcResp.DepartmentInfo}
apiResp.Data = jsonData.JsonDataOne(RpcResp.DepartmentInfo)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 更新部门信息
// @Description 更新部门信息
// @Tags 组织架构相关
// @ID UpdateDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UpdateDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.UpdateDepartmentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/update_department [post]
func UpdateDepartment(c *gin.Context) {
params := api.UpdateDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.UpdateDepartmentReq{DepartmentInfo: &open_im_sdk.Department{}}
utils.CopyStructFields(req, &params)
utils.CopyStructFields(req.DepartmentInfo, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.UpdateDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc UpdateDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.UpdateDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 获取子部门列表
// @Description 获取子部门列表
// @Tags 组织架构相关
// @ID GetSubDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetSubDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.GetSubDepartmentResp{data=[]open_im_sdk.Department}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/get_sub_department [post]
func GetSubDepartment(c *gin.Context) {
params := api.GetSubDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.GetSubDepartmentReq{}
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.GetSubDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc GetDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.GetSubDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, DepartmentList: RpcResp.DepartmentList}
apiResp.Data = jsonData.JsonDataList(RpcResp.DepartmentList)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
func GetAllDepartment(c *gin.Context) {
}
// @Summary 删除部门
// @Description 删除部门
// @Tags 组织架构相关
// @ID DeleteDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteDepartmentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/delete_department [post]
func DeleteDepartment(c *gin.Context) {
params := api.DeleteDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.DeleteDepartmentReq{}
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.DeleteDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc DeleteDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.DeleteDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 组织架构导入用户
// @Description 组织架构导入用户
// @Tags 组织架构相关
// @ID CreateOrganizationUser
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateOrganizationUserReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateOrganizationUserResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/create_organization_user [post]
func CreateOrganizationUser(c *gin.Context) {
params := api.CreateOrganizationUserReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.CreateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}}
utils.CopyStructFields(req, &params)
utils.CopyStructFields(req.OrganizationUser, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.CreateOrganizationUser(context.Background(), req)
if err != nil {
errMsg := "rpc CreateOrganizationUser failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.CreateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 更新组织架构中的用户
// @Description 更新组织架构中的用户
// @Tags 组织架构相关
// @ID UpdateOrganizationUser
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UpdateOrganizationUserReq true "请求"
// @Produce json
// @Success 0 {object} api.UpdateOrganizationUserResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/update_organization_user [post]
func UpdateOrganizationUser(c *gin.Context) {
params := api.UpdateOrganizationUserReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.UpdateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}}
utils.CopyStructFields(req, &params)
utils.CopyStructFields(req.OrganizationUser, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.UpdateOrganizationUser(context.Background(), req)
if err != nil {
errMsg := "rpc UpdateOrganizationUser failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.UpdateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 创建部门用户
// @Description 创建部门用户
// @Tags 组织架构相关
// @ID CreateDepartmentMember
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateDepartmentMemberReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateDepartmentMemberResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/create_department_member [post]
func CreateDepartmentMember(c *gin.Context) {
params := api.CreateDepartmentMemberReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.CreateDepartmentMemberReq{DepartmentMember: &open_im_sdk.DepartmentMember{}}
utils.CopyStructFields(req, &params)
utils.CopyStructFields(req.DepartmentMember, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.CreateDepartmentMember(context.Background(), req)
if err != nil {
errMsg := "rpc CreateDepartmentMember failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.CreateDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 获取部门中的所有用户
// @Description 获取部门中的所有用户
// @Tags 组织架构相关
// @ID GetUserInDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetUserInDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.GetUserInDepartmentResp{data=open_im_sdk.UserInDepartment}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/get_user_in_department [post]
func GetUserInDepartment(c *gin.Context) {
params := api.GetUserInDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.GetUserInDepartmentReq{}
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.GetUserInDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc GetUserInDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.GetUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, UserInDepartment: RpcResp.UserInDepartment}
apiResp.Data = jsonData.JsonDataOne(RpcResp.UserInDepartment)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 更新部门中某个用户
// @Description 更新部门中某个用户
// @Tags 组织架构相关
// @ID UpdateUserInDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UpdateUserInDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.UpdateUserInDepartmentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/update_user_in_department [post]
func UpdateUserInDepartment(c *gin.Context) {
params := api.UpdateUserInDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.UpdateUserInDepartmentReq{DepartmentMember: &open_im_sdk.DepartmentMember{}}
utils.CopyStructFields(req.DepartmentMember, &params)
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.UpdateUserInDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc UpdateUserInDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.UpdateUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 删除组织架构中某个用户
// @Description 删除组织架构中某个用户
// @Tags 组织架构相关
// @ID DeleteOrganizationUser
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteOrganizationUserReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteOrganizationUserResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/delete_organization_user [post]
func DeleteOrganizationUser(c *gin.Context) {
params := api.DeleteOrganizationUserReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.DeleteOrganizationUserReq{}
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.DeleteOrganizationUser(context.Background(), req)
if err != nil {
errMsg := "rpc DeleteOrganizationUser failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.DeleteOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 获取部门中所有成员
// @Description 获取部门中所有成员
// @Tags 组织架构相关
// @ID GetDepartmentMember
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetDepartmentMemberReq true "请求"
// @Produce json
// @Success 0 {object} api.GetDepartmentMemberResp{data=[]open_im_sdk.UserDepartmentMember}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/get_department_member [post]
func GetDepartmentMember(c *gin.Context) {
params := api.GetDepartmentMemberReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.GetDepartmentMemberReq{}
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.GetDepartmentMember(context.Background(), req)
if err != nil {
errMsg := "rpc GetDepartmentMember failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.GetDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, UserInDepartmentList: RpcResp.UserDepartmentMemberList}
apiResp.Data = jsonData.JsonDataList(RpcResp.UserDepartmentMemberList)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 删除部门中某个用户
// @Description 删除部门中某个用户
// @Tags 组织架构相关
// @ID DeleteUserInDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteUserInDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteUserInDepartmentResp
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/delete_user_in_department [post]
func DeleteUserInDepartment(c *gin.Context) {
params := api.DeleteUserInDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.DeleteUserInDepartmentReq{}
utils.CopyStructFields(req, &params)
err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID)
req.OpUserID = opUserID
if err != nil {
errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := rpc.NewOrganizationClient(etcdConn)
RpcResp, err := client.DeleteUserInDepartment(context.Background(), req)
if err != nil {
errMsg := "rpc DeleteUserInDepartment failed " + err.Error() + req.String()
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.DeleteUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}

View File

@@ -0,0 +1,101 @@
package apiThird
import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"fmt"
openapi "github.com/alibabacloud-go/darabonba-openapi/client"
sts20150401 "github.com/alibabacloud-go/sts-20150401/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/fatih/structs"
//"github.com/fatih/structs"
"github.com/gin-gonic/gin"
"net/http"
"time"
)
var stsClient *sts20150401.Client
/**
* 使用AK&SK初始化账号Client
* @param accessKeyId
* @param accessKeySecret
* @return Client
* @throws Exception
*/
func getStsClient() *sts20150401.Client {
if stsClient != nil {
return stsClient
}
conf := &openapi.Config{
// 您的AccessKey ID
AccessKeyId: tea.String(config.Config.Credential.Ali.AccessKeyID),
// 您的AccessKey Secret
AccessKeySecret: tea.String(config.Config.Credential.Ali.AccessKeySecret),
// Endpoint
Endpoint: tea.String(config.Config.Credential.Ali.StsEndpoint),
}
result, err := sts20150401.NewClient(conf)
if err != nil {
log.NewError("", "alists client初始化失败 ", err)
}
stsClient = result
return stsClient
}
func AliOSSCredential(c *gin.Context) {
req := api.OSSCredentialReq{}
if err := c.BindJSON(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
var ok bool
var userID string
var errInfo string
ok, userID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, "AliOSSCredential args ", userID)
stsResp, err := getStsClient().AssumeRole(&sts20150401.AssumeRoleRequest{
DurationSeconds: tea.Int64(config.Config.Credential.Ali.StsDurationSeconds),
Policy: nil,
RoleArn: tea.String(config.Config.Credential.Ali.OssRoleArn),
RoleSessionName: tea.String(fmt.Sprintf("%s-%d", userID, time.Now().Unix())),
})
resp := api.OSSCredentialResp{}
if err != nil {
resp.ErrCode = constant.ErrTencentCredential.ErrCode
resp.ErrMsg = err.Error()
} else {
resp = api.OSSCredentialResp{
CommResp: api.CommResp{},
OssData: api.OSSCredentialRespData{
Endpoint: config.Config.Credential.Ali.OssEndpoint,
AccessKeyId: *stsResp.Body.Credentials.AccessKeyId,
AccessKeySecret: *stsResp.Body.Credentials.AccessKeySecret,
Token: *stsResp.Body.Credentials.SecurityToken,
Bucket: config.Config.Credential.Ali.Bucket,
FinalHost: config.Config.Credential.Ali.FinalHost,
},
Data: nil,
}
}
resp.Data = structs.Map(&resp.OssData)
log.NewInfo(req.OperationID, "AliOSSCredential return ", resp)
c.JSON(http.StatusOK, resp)
}

View File

@@ -5,53 +5,91 @@ import (
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"context"
"fmt"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
url2 "net/url"
)
var (
minioClient *minio.Client
MinioClient *minio.Client
)
func MinioInit() {
log.NewInfo("", utils.GetSelfFuncName())
minioUrl, err := url2.Parse(config.Config.Credential.Minio.Endpoint)
operationID := utils.OperationIDGenerator()
log.NewInfo(operationID, utils.GetSelfFuncName(), "minio config: ", config.Config.Credential.Minio)
var initUrl string
if config.Config.Credential.Minio.EndpointInnerEnable {
initUrl = config.Config.Credential.Minio.EndpointInner
} else {
initUrl = config.Config.Credential.Minio.Endpoint
}
log.NewInfo(operationID, utils.GetSelfFuncName(), "use initUrl: ", initUrl)
minioUrl, err := url2.Parse(initUrl)
if err != nil {
log.NewError("", utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error())
log.NewError(operationID, utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error())
return
}
minioClient, err = minio.New(minioUrl.Host, &minio.Options{
Creds: credentials.NewStaticV4(config.Config.Credential.Minio.AccessKeyID, config.Config.Credential.Minio.SecretAccessKey, ""),
Secure: false,
})
opts := &minio.Options{
Creds: credentials.NewStaticV4(config.Config.Credential.Minio.AccessKeyID, config.Config.Credential.Minio.SecretAccessKey, ""),
}
if minioUrl.Scheme == "http" {
opts.Secure = false
} else if minioUrl.Scheme == "https" {
opts.Secure = true
}
log.NewInfo(operationID, utils.GetSelfFuncName(), "Parse ok ", config.Config.Credential.Minio)
MinioClient, err = minio.New(minioUrl.Host, opts)
log.NewInfo(operationID, utils.GetSelfFuncName(), "new ok ", config.Config.Credential.Minio)
if err != nil {
log.NewError("", utils.GetSelfFuncName(), "init minio client failed", err.Error())
log.NewError(operationID, utils.GetSelfFuncName(), "init minio client failed", err.Error())
return
}
opt := minio.MakeBucketOptions{
Region: config.Config.Credential.Minio.Location,
ObjectLocking: false,
}
err = minioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt)
err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt)
if err != nil {
log.NewInfo("", utils.GetSelfFuncName(), err.Error())
exists, err := minioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket)
log.NewInfo(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error())
exists, err := MinioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket)
if err == nil && exists {
log.NewInfo("", utils.GetSelfFuncName(), "We already own %s\n", config.Config.Credential.Minio.Bucket)
log.NewInfo(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket)
} else {
if err != nil {
log.NewError("", utils.GetSelfFuncName(), err.Error())
log.NewInfo(operationID, utils.GetSelfFuncName(), err.Error())
}
log.NewError("", utils.GetSelfFuncName(), "create bucket failed and bucket not exists")
log.NewInfo(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists")
return
}
}
// make app bucket
err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.AppBucket, opt)
if err != nil {
log.NewInfo(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error())
exists, err := MinioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket)
if err == nil && exists {
log.NewInfo(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket)
} else {
if err != nil {
log.NewInfo(operationID, utils.GetSelfFuncName(), err.Error())
}
log.NewInfo(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists")
return
}
}
// 自动化桶public的代码
//err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite)
//if err != nil {
// log.NewError("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error())
// return
//}
log.NewInfo("", utils.GetSelfFuncName(), "minio create and set policy success")
policyJsonString := fmt.Sprintf(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"],
"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`, config.Config.Credential.Minio.Bucket)
err = MinioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policyJsonString)
if err != nil {
log.NewInfo("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error())
}
policyJsonString = fmt.Sprintf(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject","s3:PutObject"],
"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::%s/*"],"Sid": ""}]}`, config.Config.Credential.Minio.AppBucket)
err = MinioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.AppBucket, policyJsonString)
if err != nil {
log.NewInfo("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error())
}
log.NewInfo(operationID, utils.GetSelfFuncName(), "minio create and set policy success")
}

View File

@@ -1,9 +1,10 @@
package apiThird
import (
apiStruct "Open_IM/pkg/base_info"
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
_ "Open_IM/pkg/common/token_verify"
@@ -16,10 +17,24 @@ import (
"net/http"
)
// @Summary minio上传文件(web api)
// @Description minio上传文件(web api), 请注意本api请求为form并非json
// @Tags 第三方服务相关
// @ID MinioUploadFile
// @Accept json
// @Param token header string true "im token"
// @Param file formData file true "要上传的文件文件"
// @Param fileType formData int true "文件类型"
// @Param operationID formData string true "操作唯一ID"
// @Produce json
// @Success 0 {object} api.MinioUploadFileResp ""
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /third/minio_upload [post]
func MinioUploadFile(c *gin.Context) {
var (
req apiStruct.MinioUploadFileReq
resp apiStruct.MinioUploadFileResp
req api.MinioUploadFileReq
resp api.MinioUploadFile
)
defer func() {
if r := recover(); r != nil {
@@ -33,8 +48,20 @@ func MinioUploadFile(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req)
var ok bool
var errInfo string
ok, _, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req)
switch req.FileType {
// videoType upload snapShot
case constant.VideoType:
snapShotFile, err := c.FormFile("snapShot")
if err != nil {
@@ -49,7 +76,7 @@ func MinioUploadFile(c *gin.Context) {
}
snapShotNewName, snapShotNewType := utils.GetNewFileNameAndContentType(snapShotFile.Filename, constant.ImageType)
log.Debug(req.OperationID, utils.GetSelfFuncName(), snapShotNewName, snapShotNewType)
_, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, snapShotNewName, snapShotFileObj, snapShotFile.Size, minio.PutObjectOptions{ContentType: snapShotNewType})
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, snapShotNewName, snapShotFileObj, snapShotFile.Size, minio.PutObjectOptions{ContentType: snapShotNewType})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject snapShotFile error", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
@@ -60,6 +87,7 @@ func MinioUploadFile(c *gin.Context) {
}
file, err := c.FormFile("file")
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "FormFile failed", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "missing file arg: " + err.Error()})
return
}
@@ -70,11 +98,11 @@ func MinioUploadFile(c *gin.Context) {
return
}
newName, newType := utils.GetNewFileNameAndContentType(file.Filename, req.FileType)
log.Debug(req.OperationID, utils.GetSelfFuncName(), newName, newType)
_, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType})
log.Debug(req.OperationID, utils.GetSelfFuncName(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, newType, MinioClient.EndpointURL())
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "open file error")
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "invalid file path" + err.Error()})
log.NewError(req.OperationID, utils.GetSelfFuncName(), "upload file error", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "upload file error" + err.Error()})
return
}
resp.NewName = newName
@@ -86,25 +114,36 @@ func MinioUploadFile(c *gin.Context) {
func MinioStorageCredential(c *gin.Context) {
var (
req apiStruct.MinioStorageCredentialReq
resp apiStruct.MiniostorageCredentialResp
req api.MinioStorageCredentialReq
resp api.MiniostorageCredentialResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
ok, _ := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
ok, _, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
log.NewError("", utils.GetSelfFuncName(), "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
var stsOpts cr.STSAssumeRoleOptions
stsOpts.AccessKey = config.Config.Credential.Minio.AccessKeyID
stsOpts.SecretKey = config.Config.Credential.Minio.SecretAccessKey
stsOpts.DurationSeconds = constant.MinioDurationTimes
li, err := cr.NewSTSAssumeRole(config.Config.Credential.Minio.Endpoint, stsOpts)
var endpoint string
if config.Config.Credential.Minio.EndpointInnerEnable {
endpoint = config.Config.Credential.Minio.EndpointInner
} else {
endpoint = config.Config.Credential.Minio.Endpoint
}
li, err := cr.NewSTSAssumeRole(endpoint, stsOpts)
if err != nil {
log.NewError("", utils.GetSelfFuncName(), "NewSTSAssumeRole failed", err.Error(), stsOpts, config.Config.Credential.Minio.Endpoint)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
@@ -123,3 +162,98 @@ func MinioStorageCredential(c *gin.Context) {
resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp})
}
func UploadUpdateApp(c *gin.Context) {
var (
req api.UploadUpdateAppReq
resp api.UploadUpdateAppResp
)
if err := c.Bind(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var yamlName string
if req.Yaml == nil {
yamlName = ""
} else {
yamlName = req.Yaml.Filename
}
fileObj, err := req.File.Open()
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "Open file error", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "Open file error" + err.Error()})
return
}
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, req.File.Filename, fileObj, req.File.Size, minio.PutObjectOptions{})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject file error")
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject file error" + err.Error()})
return
}
if yamlName != "" {
yamlObj, err := req.Yaml.Open()
if err == nil {
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, yamlName, yamlObj, req.Yaml.Size, minio.PutObjectOptions{})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject yaml error")
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject yaml error" + err.Error()})
return
}
} else {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
}
}
if err := imdb.UpdateAppVersion(req.Type, req.Version, req.ForceUpdate, req.File.Filename, yamlName, req.UpdateLog); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateAppVersion error", err.Error())
resp.ErrCode = http.StatusInternalServerError
resp.ErrMsg = err.Error()
c.JSON(http.StatusInternalServerError, resp)
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName())
c.JSON(http.StatusOK, resp)
}
func GetDownloadURL(c *gin.Context) {
var (
req api.GetDownloadURLReq
resp api.GetDownloadURLResp
)
defer func() {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
}()
if err := c.Bind(&req); err != nil {
log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
app, err := imdb.GetNewestVersion(req.Type)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "getNewestVersion failed", err.Error())
}
log.Debug(req.OperationID, utils.GetSelfFuncName(), "app: ", app)
if app != nil {
if app.Version != req.Version && app.Version != "" {
resp.Data.HasNewVersion = true
if app.ForceUpdate == true {
resp.Data.ForceUpdate = true
}
if app.YamlName != "" {
resp.Data.YamlURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.AppBucket + "/" + app.YamlName
}
resp.Data.FileURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.AppBucket + "/" + app.FileName
resp.Data.Version = app.Version
resp.Data.UpdateLog = app.UpdateLog
c.JSON(http.StatusOK, resp)
return
} else {
resp.Data.HasNewVersion = false
c.JSON(http.StatusOK, resp)
return
}
}
c.JSON(http.StatusBadRequest, gin.H{"errCode": 0, "errMsg": "not found app version"})
}

Some files were not shown because too many files have changed in this diff Show More