Compare commits
No commits in common. "master" and "develop" have entirely different histories.
16
README.md
16
README.md
@ -2,7 +2,7 @@
|
|||||||
[WindChat-风信](https://gitee.com/wind-chat/wind-im/blob/master/README.md)
|
[WindChat-风信](https://gitee.com/wind-chat/wind-im/blob/master/README.md)
|
||||||
====
|
====
|
||||||
|
|
||||||
<img src="https://images.gitee.com/uploads/images/2020/1030/003214_2ce45893_1566564.png" alt="WindChat.png" width=200>
|
![输入图片说明](https://images.gitee.com/uploads/images/2020/0215/212822_dfebbbfe_1566564.png "屏幕截图.png")
|
||||||
|
|
||||||
|
|
||||||
[![License](https://img.shields.io/badge/license-apache2-blue.svg)](LICENSE)
|
[![License](https://img.shields.io/badge/license-apache2-blue.svg)](LICENSE)
|
||||||
@ -17,7 +17,7 @@
|
|||||||
简介
|
简介
|
||||||
----
|
----
|
||||||
|
|
||||||
WindChat 是一款开源免费私有IM聊天软件,由核心开发者SAM2O2O等维护,主要面向企业定制IM,开源、免费。
|
WindChat 是一款开源免费私有IM聊天软件,原身是Akaxin即时通讯开源软件,由原开发者SAM2O2O个人维护,主要面向企业定制IM,全端开源,免费。
|
||||||
|
|
||||||
特性:
|
特性:
|
||||||
|
|
||||||
@ -85,10 +85,13 @@ WindChat Team版本 命令:
|
|||||||
**2. 下载客户端**
|
**2. 下载客户端**
|
||||||
|
|
||||||
Android 客户端:
|
Android 客户端:
|
||||||
> Android 端暂未开源,敬请期待
|
> * [Android 源码地址GitHub](https://github.com/WindChat/wind-android.git)
|
||||||
|
> * GitHube地址 : https://github.com/WindChat/wind-android.git
|
||||||
|
> * [Android 源码地址Gitee](https://gitee.com/wind-chat/wind-android.git)
|
||||||
|
> * Gitee地址 :(https://gitee.com/wind-chat/wind-android.git)
|
||||||
|
|
||||||
iOS 客户端:
|
iOS 客户端:
|
||||||
> iOS 端暂未开源,敬请期待
|
> iOS 暂未开源,预计2020-06-14 开源
|
||||||
|
|
||||||
|
|
||||||
**3. 访问站点**
|
**3. 访问站点**
|
||||||
@ -117,7 +120,6 @@ iOS 客户端:
|
|||||||
WindChat 具有灵活、强大的扩展机制 `(“管理平台” 就是一个扩展)`。通过嵌入WEB页面,与后端的扩展API进行交互, 可以很轻松的构建丰富的业务功能,如:
|
WindChat 具有灵活、强大的扩展机制 `(“管理平台” 就是一个扩展)`。通过嵌入WEB页面,与后端的扩展API进行交互, 可以很轻松的构建丰富的业务功能,如:
|
||||||
|
|
||||||
* 附近交友
|
* 附近交友
|
||||||
* 线上打卡
|
|
||||||
* 店铺点评
|
* 店铺点评
|
||||||
* 在线游戏
|
* 在线游戏
|
||||||
* 等等等等
|
* 等等等等
|
||||||
@ -140,7 +142,7 @@ WindChat 具有灵活、强大的扩展机制 `(“管理平台” 就是一个
|
|||||||
|
|
||||||
**向我们提问**
|
**向我们提问**
|
||||||
|
|
||||||
>官方微信:<img src="https://images.gitee.com/uploads/images/2020/1030/003752_de901b73_1566564.jpeg" width=200>
|
>官方微信:<img src="https://images.gitee.com/uploads/images/2020/0215/213526_62461f9d_1566564.png" width=200>
|
||||||
|
|
||||||
> 联系邮件:an.guoyue254@gmail.com
|
> 联系邮件:an.guoyue254@gmail.com
|
||||||
|
|
||||||
@ -149,6 +151,6 @@ WindChat 具有灵活、强大的扩展机制 `(“管理平台” 就是一个
|
|||||||
|
|
||||||
开源本不易,如果你觉得对你有帮助,请捐赠以表示支持,感谢!
|
开源本不易,如果你觉得对你有帮助,请捐赠以表示支持,感谢!
|
||||||
|
|
||||||
<img src="https://images.gitee.com/uploads/images/2020/1030/003539_1f1b9765_1566564.jpeg" width=200>
|
<img src="https://images.gitee.com/uploads/images/2020/0511/223112_e93a61ab_1566564.png" width=200>
|
||||||
|
|
||||||
<img src="https://images.gitee.com/uploads/images/2020/0511/223222_9ac22d03_1566564.png" width=200>
|
<img src="https://images.gitee.com/uploads/images/2020/0511/223222_9ac22d03_1566564.png" width=200>
|
||||||
|
4
pom.xml
4
pom.xml
@ -31,9 +31,9 @@
|
|||||||
<gson_version>2.8.2</gson_version>
|
<gson_version>2.8.2</gson_version>
|
||||||
<fastjson_version>1.2.31</fastjson_version>
|
<fastjson_version>1.2.31</fastjson_version>
|
||||||
<slf4j_version>1.7.25</slf4j_version>
|
<slf4j_version>1.7.25</slf4j_version>
|
||||||
<guava_version>29.0-jre</guava_version>
|
<guava_version>23.6-jre</guava_version>
|
||||||
<sqlite.version>3.21.0.1</sqlite.version>
|
<sqlite.version>3.21.0.1</sqlite.version>
|
||||||
<mysql.version>8.0.16</mysql.version>
|
<mysql.version>8.0.11</mysql.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
82
windchat-boot/openzaly-server.config
Executable file
82
windchat-boot/openzaly-server.config
Executable file
@ -0,0 +1,82 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2018-2028 Akaxin Group
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
### ***************Akaxin ***************
|
||||||
|
### openzaly-server
|
||||||
|
########################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## personal/PERSONAL edition : use sqlite database
|
||||||
|
## team/TEAM edition : use mysql database,support one master with several slaves
|
||||||
|
## enterprise/ENTERPRISE edition : use mysql + redis database ,support im server distribution
|
||||||
|
## ultimate edition : team or enterprise customization
|
||||||
|
openzaly.edition=PERSONAL
|
||||||
|
|
||||||
|
|
||||||
|
# openzaly version
|
||||||
|
openzaly.version=1.0.7
|
||||||
|
|
||||||
|
##### site tcp address,clients connect to site.address
|
||||||
|
site.address=0.0.0.0
|
||||||
|
# site tcp port default 2021
|
||||||
|
site.port=2021
|
||||||
|
|
||||||
|
# pluginapi server address
|
||||||
|
pluginapi.address=0.0.0.0
|
||||||
|
# pluginapi server port
|
||||||
|
pluginapi.port=8280
|
||||||
|
|
||||||
|
# default back-stage management address
|
||||||
|
site.admin.address=127.0.0.1
|
||||||
|
# default back-stage management port
|
||||||
|
site.admin.port=8288
|
||||||
|
|
||||||
|
# first user login site,use this user invite code(UIC)
|
||||||
|
site.uic=000000
|
||||||
|
|
||||||
|
# deposit pictures,audio,db default current path
|
||||||
|
# site.baseDir=${pwd}
|
||||||
|
# goup max members count = 100
|
||||||
|
# group.members.count=100
|
||||||
|
|
||||||
|
## if openzaly.edition = personal/PERSONAL
|
||||||
|
openzaly.sqlite.url=openzalyDB.sqlite3
|
||||||
|
|
||||||
|
|
||||||
|
## if openzaly.edition = team/TEAM
|
||||||
|
openzaly.mysql.host=localhost
|
||||||
|
openzaly.mysql.port=3306
|
||||||
|
openzaly.mysql.database=openzaly
|
||||||
|
|
||||||
|
openzaly.mysql.username=root
|
||||||
|
openzaly.mysql.password=1234567890
|
||||||
|
openzaly.mysql.initial-size=10
|
||||||
|
openzaly.mysql.max-size=100
|
||||||
|
openzaly.mysql.max-idle=60
|
||||||
|
|
||||||
|
openzaly.mysql.useUnicode=true
|
||||||
|
openzaly.mysql.characterEncoding=utf-8
|
||||||
|
openzaly.mysql.verifyServerCertificate=false
|
||||||
|
openzaly.mysql.useSSL=true
|
||||||
|
|
||||||
|
|
||||||
|
## if openzaly.edition = enterprise/ENTERPRISE
|
||||||
|
#### support support im server distribution
|
||||||
|
|
||||||
|
## if openzaly.edition = ultimate edition
|
||||||
|
#### openzaly support customed for team or enterprise
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2018-2028 WindChat Group
|
# Copyright 2018-2028 Akaxin Group
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
package com.windchat.im.business.bean;
|
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* customized annotation
|
|
||||||
*
|
|
||||||
* @author Librena
|
|
||||||
* @since 2020-10-20
|
|
||||||
*/
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
public @interface ApiActions {
|
|
||||||
|
|
||||||
String action();
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -22,9 +22,9 @@ package com.windchat.im.business.constant;
|
|||||||
* @since 2017-12-28 14:38:15
|
* @since 2017-12-28 14:38:15
|
||||||
*/
|
*/
|
||||||
public interface NoticeText {
|
public interface NoticeText {
|
||||||
String USER_ADD_FRIEND = "我通过了你的好友验证,现在可以开始聊天了";
|
public String USER_ADD_FRIEND = "我通过了你的好友验证,现在可以开始聊天了";
|
||||||
String USER_ADD_GROUP = " 加入了群聊";
|
public String USER_ADD_GROUP = " 加入了群聊";
|
||||||
|
|
||||||
String USER_ADD_GROUP_QR_CODE = " 通过群组二维码加入群聊";
|
public String USER_ADD_GROUP_QR_CODE = " 通过群组二维码加入群聊";
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,14 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl;
|
package com.windchat.im.business.impl;
|
||||||
|
|
||||||
import com.google.common.cache.Cache;
|
import java.lang.reflect.Method;
|
||||||
import com.google.common.cache.CacheBuilder;
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.im.business.dao.UserGroupDao;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.im.business.dao.UserProfileDao;
|
||||||
import com.windchat.common.constant.CommandConst;
|
|
||||||
import com.windchat.common.constant.ErrorCode2;
|
|
||||||
import com.windchat.common.logs.LogUtils;
|
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
|
||||||
import com.windchat.im.business.dao.UserGroupDao;
|
import com.windchat.im.business.dao.UserGroupDao;
|
||||||
import com.windchat.im.business.dao.UserProfileDao;
|
import com.windchat.im.business.dao.UserProfileDao;
|
||||||
import com.windchat.im.storage.bean.GroupProfileBean;
|
import com.windchat.im.storage.bean.GroupProfileBean;
|
||||||
@ -31,76 +27,62 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import com.windchat.common.command.Command;
|
||||||
import java.util.concurrent.TimeUnit;
|
import com.windchat.common.command.CommandResponse;
|
||||||
|
import com.windchat.common.constant.CommandConst;
|
||||||
|
import com.windchat.common.constant.ErrorCode2;
|
||||||
|
import com.windchat.common.logs.LogUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2018-01-31 12:20:14
|
* @since 2018-01-31 12:20:14
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractRequest implements IRequestService {
|
public abstract class AbstractRequest implements IRequestService {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(AbstractRequest.class);
|
private static final Logger logger = LoggerFactory.getLogger(AbstractRequest.class);
|
||||||
|
|
||||||
Cache<String, Method> cache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterWrite(10, TimeUnit.MINUTES).build();
|
public CommandResponse execute(Command command) {
|
||||||
|
return executeMethodByReflect(command);
|
||||||
|
}
|
||||||
|
|
||||||
public CommandResponse execute(Command command) {
|
private CommandResponse executeMethodByReflect(Command command) {
|
||||||
return executeMethodByReflect(command);
|
CommandResponse response = null;
|
||||||
}
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
|
try {
|
||||||
|
String methodName = command.getMethod();
|
||||||
|
Method m = this.getClass().getDeclaredMethod(methodName, command.getClass());
|
||||||
|
response = (CommandResponse) m.invoke(this, command);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.requestErrorLog(logger, command, e);
|
||||||
|
}
|
||||||
|
|
||||||
private CommandResponse executeMethodByReflect(Command command) {
|
if (response == null) {
|
||||||
CommandResponse response = null;
|
response = new CommandResponse().setVersion(CommandConst.PROTOCOL_VERSION)
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
.setAction(CommandConst.ACTION_RES).setErrCode2(errCode);
|
||||||
try {
|
}
|
||||||
Method actionMethod = cache.getIfPresent(command.getAction());
|
return response;
|
||||||
if (actionMethod == null) {
|
}
|
||||||
Method[] allMethods = this.getClass().getDeclaredMethods();
|
|
||||||
ApiActions serviceAction = this.getClass().getDeclaredAnnotation(ApiActions.class);
|
|
||||||
for (Method method : allMethods) {
|
|
||||||
ApiActions apiActions = method.getAnnotation(ApiActions.class);
|
|
||||||
if (apiActions == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String action = serviceAction.action() + apiActions.action();
|
|
||||||
if (action.equals(command.getAction())) {
|
|
||||||
response = (CommandResponse) method.invoke(this, command);
|
|
||||||
cache.put(action, method);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
response = (CommandResponse) actionMethod.invoke(this, command);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
LogUtils.requestErrorLog(logger, command, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response == null) {
|
//检查请求的参数中的siteUserId是否是存在的
|
||||||
response = new CommandResponse().setVersion(CommandConst.PROTOCOL_VERSION)
|
public boolean checkUserIdLegal(String siteUserId) {
|
||||||
.setAction(CommandConst.ACTION_RES).setErrCode2(errCode);
|
if (StringUtils.isNotEmpty(siteUserId)) {
|
||||||
}
|
SimpleUserBean userProfile = UserProfileDao.getInstance().getSimpleProfileById(siteUserId);
|
||||||
return response;
|
if (userProfile != null && StringUtils.isNotEmpty(userProfile.getSiteUserId())) {
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//检查请求的参数中的siteUserId是否是存在的
|
//检查请求的参数中的groupId是否是存在的
|
||||||
public boolean checkUserIdLegal(String siteUserId) {
|
public boolean checkGroupIdLegal(String groupId) {
|
||||||
if (StringUtils.isNotEmpty(siteUserId)) {
|
if (StringUtils.isNotEmpty(groupId)) {
|
||||||
SimpleUserBean userProfile = UserProfileDao.getInstance().getSimpleProfileById(siteUserId);
|
GroupProfileBean groupProfile = UserGroupDao.getInstance().getSimpleGroupBeanById(groupId);
|
||||||
if (userProfile != null && StringUtils.isNotEmpty(userProfile.getSiteUserId())) {
|
if (groupProfile != null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查请求的参数中的groupId是否是存在的
|
|
||||||
public boolean checkGroupIdLegal(String groupId) {
|
|
||||||
if (StringUtils.isNotEmpty(groupId)) {
|
|
||||||
GroupProfileBean groupProfile = UserGroupDao.getInstance().getSimpleGroupBeanById(groupId);
|
|
||||||
if (groupProfile != null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,21 +15,24 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.site;
|
package com.windchat.im.business.impl.site;
|
||||||
|
|
||||||
import com.akaxin.proto.core.ConfigProto;
|
|
||||||
import com.windchat.im.business.constant.GroupConfig;
|
|
||||||
import com.windchat.im.business.dao.SiteConfigDao;
|
|
||||||
import com.windchat.im.message.utils.SiteConfigHelper;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.commons.lang3.math.NumberUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.windchat.im.business.constant.GroupConfig;
|
||||||
|
import com.windchat.im.business.dao.SiteConfigDao;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.akaxin.proto.core.ConfigProto;
|
||||||
|
import com.windchat.im.business.constant.GroupConfig;
|
||||||
|
import com.windchat.im.business.dao.SiteConfigDao;
|
||||||
|
import com.windchat.im.message.utils.SiteConfigHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理站点配置相关信息
|
* 管理站点配置相关信息
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,23 +15,25 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.core.DeviceProto;
|
import java.util.List;
|
||||||
import com.akaxin.proto.site.ApiDeviceBoundListProto;
|
|
||||||
import com.akaxin.proto.site.ApiDeviceListProto;
|
|
||||||
import com.akaxin.proto.site.ApiDeviceProfileProto;
|
|
||||||
import com.windchat.common.command.Command;
|
|
||||||
import com.windchat.common.command.CommandResponse;
|
|
||||||
import com.windchat.common.constant.ErrorCode2;
|
|
||||||
import com.windchat.common.logs.LogUtils;
|
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
|
||||||
import com.windchat.im.business.dao.UserDeviceDao;
|
import com.windchat.im.business.dao.UserDeviceDao;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.windchat.im.storage.bean.UserDeviceBean;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.List;
|
import com.windchat.common.command.Command;
|
||||||
|
import com.windchat.common.command.CommandResponse;
|
||||||
|
import com.windchat.common.constant.ErrorCode2;
|
||||||
|
import com.windchat.common.logs.LogUtils;
|
||||||
|
import com.akaxin.proto.core.DeviceProto;
|
||||||
|
import com.akaxin.proto.site.ApiDeviceBoundListProto;
|
||||||
|
import com.akaxin.proto.site.ApiDeviceListProto;
|
||||||
|
import com.akaxin.proto.site.ApiDeviceProfileProto;
|
||||||
|
import com.windchat.im.business.dao.UserDeviceDao;
|
||||||
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
|
import com.windchat.im.storage.bean.UserDeviceBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -39,11 +41,9 @@ import java.util.List;
|
|||||||
* @since 2017.10.20
|
* @since 2017.10.20
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.device")
|
|
||||||
public class ApiDeviceService extends AbstractRequest {
|
public class ApiDeviceService extends AbstractRequest {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiDeviceService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiDeviceService.class);
|
||||||
|
|
||||||
@ApiActions(action = ".profile")
|
|
||||||
public CommandResponse profile(Command command) {
|
public CommandResponse profile(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse();
|
CommandResponse commandResponse = new CommandResponse();
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -76,7 +76,6 @@ public class ApiDeviceService extends AbstractRequest {
|
|||||||
return commandResponse.setErrCode2(errCode);
|
return commandResponse.setErrCode2(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiActions(action = ".list")
|
|
||||||
public CommandResponse list(Command command) {
|
public CommandResponse list(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse();
|
CommandResponse commandResponse = new CommandResponse();
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -117,7 +116,6 @@ public class ApiDeviceService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".boundList")
|
|
||||||
public CommandResponse boundList(Command command) {
|
public CommandResponse boundList(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse();
|
CommandResponse commandResponse = new CommandResponse();
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
|
@ -15,21 +15,23 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.core.FileProto;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.akaxin.proto.site.ApiFileDownloadProto;
|
import com.windchat.im.business.utils.FilePathUtils;
|
||||||
import com.akaxin.proto.site.ApiFileUploadProto;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.google.protobuf.ByteString;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.ErrorCode2;
|
import com.windchat.common.constant.ErrorCode2;
|
||||||
import com.windchat.common.logs.LogUtils;
|
import com.windchat.common.logs.LogUtils;
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import com.akaxin.proto.core.FileProto;
|
||||||
|
import com.akaxin.proto.site.ApiFileDownloadProto;
|
||||||
|
import com.akaxin.proto.site.ApiFileUploadProto;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.windchat.im.business.utils.FilePathUtils;
|
import com.windchat.im.business.utils.FilePathUtils;
|
||||||
import com.windchat.im.business.utils.FileServerUtils;
|
import com.windchat.im.business.utils.FileServerUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import com.google.protobuf.ByteString;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件(图片,语音)上传下载
|
* 文件(图片,语音)上传下载
|
||||||
@ -37,11 +39,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2018-01-25 17:52:08
|
* @since 2018-01-25 17:52:08
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.file")
|
|
||||||
public class ApiFileService extends AbstractRequest {
|
public class ApiFileService extends AbstractRequest {
|
||||||
private static Logger logger = LoggerFactory.getLogger(ApiFileService.class);
|
private static Logger logger = LoggerFactory.getLogger(ApiFileService.class);
|
||||||
|
|
||||||
@ApiActions(action = ".upload")
|
|
||||||
public CommandResponse upload(Command command) {
|
public CommandResponse upload(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse();
|
CommandResponse commandResponse = new CommandResponse();
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -66,7 +66,6 @@ public class ApiFileService extends AbstractRequest {
|
|||||||
return commandResponse.setErrCode2(errCode);
|
return commandResponse.setErrCode2(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiActions(action = ".download")
|
|
||||||
public CommandResponse download(Command command) {
|
public CommandResponse download(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse();
|
CommandResponse commandResponse = new CommandResponse();
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,6 +15,23 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.windchat.im.business.dao.UserFriendDao;
|
||||||
|
import com.windchat.im.business.dao.UserProfileDao;
|
||||||
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.windchat.common.command.Command;
|
||||||
|
import com.windchat.common.command.CommandResponse;
|
||||||
|
import com.windchat.common.constant.CommandConst;
|
||||||
|
import com.windchat.common.constant.ErrorCode2;
|
||||||
|
import com.windchat.common.constant.IErrorCode;
|
||||||
|
import com.windchat.common.exceptions.ZalyException2;
|
||||||
|
import com.windchat.common.logs.LogUtils;
|
||||||
|
import com.windchat.common.utils.StringHelper;
|
||||||
import com.akaxin.proto.core.UserProto;
|
import com.akaxin.proto.core.UserProto;
|
||||||
import com.akaxin.proto.site.ApiFriendApplyCountProto;
|
import com.akaxin.proto.site.ApiFriendApplyCountProto;
|
||||||
import com.akaxin.proto.site.ApiFriendApplyListProto;
|
import com.akaxin.proto.site.ApiFriendApplyListProto;
|
||||||
@ -28,15 +45,6 @@ import com.akaxin.proto.site.ApiFriendRemarkProto;
|
|||||||
import com.akaxin.proto.site.ApiFriendSettingProto;
|
import com.akaxin.proto.site.ApiFriendSettingProto;
|
||||||
import com.akaxin.proto.site.ApiFriendUpdateMuteProto;
|
import com.akaxin.proto.site.ApiFriendUpdateMuteProto;
|
||||||
import com.akaxin.proto.site.ApiFriendUpdateSettingProto;
|
import com.akaxin.proto.site.ApiFriendUpdateSettingProto;
|
||||||
import com.windchat.common.command.Command;
|
|
||||||
import com.windchat.common.command.CommandResponse;
|
|
||||||
import com.windchat.common.constant.CommandConst;
|
|
||||||
import com.windchat.common.constant.ErrorCode2;
|
|
||||||
import com.windchat.common.constant.IErrorCode;
|
|
||||||
import com.windchat.common.exceptions.ZalyException2;
|
|
||||||
import com.windchat.common.logs.LogUtils;
|
|
||||||
import com.windchat.common.utils.StringHelper;
|
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
|
||||||
import com.windchat.im.business.dao.UserFriendDao;
|
import com.windchat.im.business.dao.UserFriendDao;
|
||||||
import com.windchat.im.business.dao.UserProfileDao;
|
import com.windchat.im.business.dao.UserProfileDao;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
@ -47,11 +55,6 @@ import com.windchat.im.storage.bean.ApplyFriendBean;
|
|||||||
import com.windchat.im.storage.bean.ApplyUserBean;
|
import com.windchat.im.storage.bean.ApplyUserBean;
|
||||||
import com.windchat.im.storage.bean.SimpleUserBean;
|
import com.windchat.im.storage.bean.SimpleUserBean;
|
||||||
import com.windchat.im.storage.bean.UserFriendBean;
|
import com.windchat.im.storage.bean.UserFriendBean;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -70,7 +73,6 @@ import java.util.List;
|
|||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017.11.24 18:36:59
|
* @since 2017.11.24 18:36:59
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.friend")
|
|
||||||
public class ApiFriendService extends AbstractRequest {
|
public class ApiFriendService extends AbstractRequest {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiFriendService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiFriendService.class);
|
||||||
|
|
||||||
@ -80,7 +82,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".profile")
|
|
||||||
public CommandResponse profile(Command command) {
|
public CommandResponse profile(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -155,7 +156,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".list")
|
|
||||||
public CommandResponse list(Command command) {
|
public CommandResponse list(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -210,7 +210,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".apply")
|
|
||||||
public CommandResponse apply(Command command) {
|
public CommandResponse apply(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
@ -271,7 +270,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".applyList")
|
|
||||||
public CommandResponse applyList(Command command) {
|
public CommandResponse applyList(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -311,7 +309,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".applyCount")
|
|
||||||
public CommandResponse applyCount(Command command) {
|
public CommandResponse applyCount(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -339,7 +336,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".applyResult")
|
|
||||||
public CommandResponse applyResult(Command command) {
|
public CommandResponse applyResult(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -386,7 +382,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".delete")
|
|
||||||
public CommandResponse delete(Command command) {
|
public CommandResponse delete(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -418,7 +413,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".setting")
|
|
||||||
public CommandResponse setting(Command command) {
|
public CommandResponse setting(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -457,7 +451,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".updateSetting")
|
|
||||||
public CommandResponse updateSetting(Command command) {
|
public CommandResponse updateSetting(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -495,7 +488,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".mute")
|
|
||||||
public CommandResponse mute(Command command) {
|
public CommandResponse mute(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -528,7 +520,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".updateMute")
|
|
||||||
public CommandResponse updateMute(Command command) {
|
public CommandResponse updateMute(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -557,13 +548,6 @@ public class ApiFriendService extends AbstractRequest {
|
|||||||
return commandResponse.setErrCode2(errCode);
|
return commandResponse.setErrCode2(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置好友备注
|
|
||||||
*
|
|
||||||
* @param command
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiActions(action =".remark")
|
|
||||||
public CommandResponse remark(Command command) {
|
public CommandResponse remark(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,12 +15,18 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.core.CoreProto;
|
import java.util.Base64;
|
||||||
import com.akaxin.proto.core.PluginProto;
|
import java.util.List;
|
||||||
import com.akaxin.proto.site.ApiPluginListProto;
|
import java.util.Map;
|
||||||
import com.akaxin.proto.site.ApiPluginPageProto;
|
|
||||||
import com.akaxin.proto.site.ApiPluginProxyProto;
|
//import org.apache.commons.codec.binary.Base64;
|
||||||
import com.google.protobuf.ByteString;
|
import com.windchat.im.business.dao.SitePluginDao;
|
||||||
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
|
import com.windchat.im.business.impl.site.SiteConfig;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CharsetCoding;
|
import com.windchat.common.constant.CharsetCoding;
|
||||||
@ -31,18 +37,16 @@ import com.windchat.common.crypto.AESCrypto;
|
|||||||
import com.windchat.common.exceptions.ZalyException2;
|
import com.windchat.common.exceptions.ZalyException2;
|
||||||
import com.windchat.common.http.ZalyHttpClient;
|
import com.windchat.common.http.ZalyHttpClient;
|
||||||
import com.windchat.common.logs.LogUtils;
|
import com.windchat.common.logs.LogUtils;
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import com.akaxin.proto.core.CoreProto;
|
||||||
|
import com.akaxin.proto.core.PluginProto;
|
||||||
|
import com.akaxin.proto.site.ApiPluginListProto;
|
||||||
|
import com.akaxin.proto.site.ApiPluginPageProto;
|
||||||
|
import com.akaxin.proto.site.ApiPluginProxyProto;
|
||||||
import com.windchat.im.business.dao.SitePluginDao;
|
import com.windchat.im.business.dao.SitePluginDao;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.windchat.im.business.impl.site.SiteConfig;
|
import com.windchat.im.business.impl.site.SiteConfig;
|
||||||
import com.windchat.im.storage.bean.PluginBean;
|
import com.windchat.im.storage.bean.PluginBean;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import com.google.protobuf.ByteString;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理客户端与服务点扩展之间功能
|
* 处理客户端与服务点扩展之间功能
|
||||||
@ -50,7 +54,6 @@ import java.util.Map;
|
|||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017-12-11 14:46:28
|
* @since 2017-12-11 14:46:28
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.plugin")
|
|
||||||
public class ApiPluginService extends AbstractRequest {
|
public class ApiPluginService extends AbstractRequest {
|
||||||
private static Logger logger = LoggerFactory.getLogger(ApiPluginService.class);
|
private static Logger logger = LoggerFactory.getLogger(ApiPluginService.class);
|
||||||
private static final String HTTP_PREFFIX = "http://";
|
private static final String HTTP_PREFFIX = "http://";
|
||||||
@ -62,7 +65,6 @@ public class ApiPluginService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".list")
|
|
||||||
public CommandResponse list(Command command) {
|
public CommandResponse list(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
@ -132,7 +134,6 @@ public class ApiPluginService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".page")
|
|
||||||
public CommandResponse page(Command command) {
|
public CommandResponse page(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -208,7 +209,6 @@ public class ApiPluginService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".proxy")
|
|
||||||
public CommandResponse proxy(Command command) {
|
public CommandResponse proxy(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,23 +15,24 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.core.ConfigProto;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.akaxin.proto.core.DeviceProto;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.akaxin.proto.site.ApiSecretChatApplyU2Proto;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
import com.windchat.common.constant.ErrorCode2;
|
import com.windchat.common.constant.ErrorCode2;
|
||||||
import com.windchat.common.logs.LogUtils;
|
import com.windchat.common.logs.LogUtils;
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import com.akaxin.proto.core.ConfigProto;
|
||||||
|
import com.akaxin.proto.core.DeviceProto;
|
||||||
|
import com.akaxin.proto.site.ApiSecretChatApplyU2Proto;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.windchat.im.business.impl.site.SiteConfig;
|
import com.windchat.im.business.impl.site.SiteConfig;
|
||||||
import com.windchat.im.storage.api.IUserDeviceDao;
|
import com.windchat.im.storage.api.IUserDeviceDao;
|
||||||
import com.windchat.im.storage.bean.UserDeviceBean;
|
import com.windchat.im.storage.bean.UserDeviceBean;
|
||||||
import com.windchat.im.storage.service.DeviceDaoService;
|
import com.windchat.im.storage.service.DeviceDaoService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户开启二人/群聊 绝密聊天
|
* 用户开启二人/群聊 绝密聊天
|
||||||
@ -39,7 +40,6 @@ import org.slf4j.LoggerFactory;
|
|||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017.10.20
|
* @since 2017.10.20
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.secretChat")
|
|
||||||
public class ApiSecretChatService extends AbstractRequest {
|
public class ApiSecretChatService extends AbstractRequest {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiSecretChatService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiSecretChatService.class);
|
||||||
private IUserDeviceDao userDeviceDao = new DeviceDaoService();
|
private IUserDeviceDao userDeviceDao = new DeviceDaoService();
|
||||||
@ -50,7 +50,6 @@ public class ApiSecretChatService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".applyU2")
|
|
||||||
public CommandResponse applyU2(Command command) {
|
public CommandResponse applyU2(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,12 +15,20 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.core.ConfigProto;
|
import java.security.PublicKey;
|
||||||
import com.akaxin.proto.core.CoreProto;
|
import java.security.Signature;
|
||||||
import com.akaxin.proto.core.UserProto;
|
import java.util.Base64;
|
||||||
import com.akaxin.proto.site.ApiSiteConfigProto;
|
import java.util.Map;
|
||||||
import com.akaxin.proto.site.ApiSiteLoginProto;
|
import java.util.Set;
|
||||||
import com.akaxin.proto.site.ApiSiteRegisterProto;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.windchat.im.business.bean.PlatformPhoneBean;
|
||||||
|
import com.windchat.im.business.dao.*;
|
||||||
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
@ -32,7 +40,12 @@ import com.windchat.common.exceptions.ZalyException2;
|
|||||||
import com.windchat.common.logs.LogUtils;
|
import com.windchat.common.logs.LogUtils;
|
||||||
import com.windchat.common.utils.StringHelper;
|
import com.windchat.common.utils.StringHelper;
|
||||||
import com.windchat.common.utils.UserIdUtils;
|
import com.windchat.common.utils.UserIdUtils;
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import com.akaxin.proto.core.ConfigProto;
|
||||||
|
import com.akaxin.proto.core.CoreProto;
|
||||||
|
import com.akaxin.proto.core.UserProto;
|
||||||
|
import com.akaxin.proto.site.ApiSiteConfigProto;
|
||||||
|
import com.akaxin.proto.site.ApiSiteLoginProto;
|
||||||
|
import com.akaxin.proto.site.ApiSiteRegisterProto;
|
||||||
import com.windchat.im.business.bean.PlatformPhoneBean;
|
import com.windchat.im.business.bean.PlatformPhoneBean;
|
||||||
import com.windchat.im.business.dao.SiteConfigDao;
|
import com.windchat.im.business.dao.SiteConfigDao;
|
||||||
import com.windchat.im.business.dao.SiteLoginDao;
|
import com.windchat.im.business.dao.SiteLoginDao;
|
||||||
@ -51,439 +64,422 @@ import com.windchat.im.storage.bean.UserDeviceBean;
|
|||||||
import com.windchat.im.storage.bean.UserProfileBean;
|
import com.windchat.im.storage.bean.UserProfileBean;
|
||||||
import com.windchat.im.storage.bean.UserSessionBean;
|
import com.windchat.im.storage.bean.UserSessionBean;
|
||||||
import com.windchat.im.storage.service.DeviceDaoService;
|
import com.windchat.im.storage.service.DeviceDaoService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.security.PublicKey;
|
|
||||||
import java.security.Signature;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取站点信息
|
* 获取站点信息 <br>
|
||||||
* 执行注册&&登陆
|
* 执行注册&&登陆
|
||||||
*
|
*
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017-10-17 18:14:10
|
* @since 2017-10-17 18:14:10
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.site")
|
|
||||||
public class ApiSiteService extends AbstractRequest {
|
public class ApiSiteService extends AbstractRequest {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiSiteService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiSiteService.class);
|
||||||
private static final int DEFAULT_PORT = 2021;
|
private static final int DEFAULT_PORT = 2021;
|
||||||
private IUserDeviceDao userDeviceDao = new DeviceDaoService();
|
private IUserDeviceDao userDeviceDao = new DeviceDaoService();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取站点配置信息
|
* <pre>
|
||||||
*
|
* api.site.config
|
||||||
* @param command
|
* 获取站点配置信息
|
||||||
* @return
|
* </pre>
|
||||||
*/
|
*
|
||||||
@ApiActions(action = ".config")
|
* @param command
|
||||||
public CommandResponse config(Command command) {
|
* @return
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
*/
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
public CommandResponse config(Command command) {
|
||||||
try {
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
Map<Integer, String> configMap = SiteConfig.getConfigMap();
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
LogUtils.requestDebugLog(logger, command, "");
|
try {
|
||||||
|
Map<Integer, String> configMap = SiteConfig.getConfigMap();
|
||||||
|
LogUtils.requestDebugLog(logger, command, "");
|
||||||
|
|
||||||
if (configMap != null) {
|
if (configMap != null) {
|
||||||
ConfigProto.SiteConfig.Builder configBuilder = ConfigProto.SiteConfig.newBuilder();
|
ConfigProto.SiteConfig.Builder configBuilder = ConfigProto.SiteConfig.newBuilder();
|
||||||
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_ADDRESS_VALUE))) {
|
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_ADDRESS_VALUE))) {
|
||||||
configBuilder.setSiteAddress(configMap.get(ConfigProto.ConfigKey.SITE_ADDRESS_VALUE));
|
configBuilder.setSiteAddress(configMap.get(ConfigProto.ConfigKey.SITE_ADDRESS_VALUE));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNumeric(configMap.get(ConfigProto.ConfigKey.SITE_PORT_VALUE))) {
|
if (StringUtils.isNumeric(configMap.get(ConfigProto.ConfigKey.SITE_PORT_VALUE))) {
|
||||||
configBuilder.setSitePort(Integer.valueOf(configMap.get(ConfigProto.ConfigKey.SITE_PORT_VALUE)));
|
configBuilder.setSitePort(Integer.valueOf(configMap.get(ConfigProto.ConfigKey.SITE_PORT_VALUE)));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_NAME_VALUE))) {
|
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_NAME_VALUE))) {
|
||||||
configBuilder.setSiteName(configMap.get(ConfigProto.ConfigKey.SITE_NAME_VALUE));
|
configBuilder.setSiteName(configMap.get(ConfigProto.ConfigKey.SITE_NAME_VALUE));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_LOGO_VALUE))) {
|
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_LOGO_VALUE))) {
|
||||||
configBuilder.setSiteLogo(configMap.get(ConfigProto.ConfigKey.SITE_LOGO_VALUE));
|
configBuilder.setSiteLogo(configMap.get(ConfigProto.ConfigKey.SITE_LOGO_VALUE));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_VERSION_VALUE))) {
|
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_VERSION_VALUE))) {
|
||||||
configBuilder.setSiteVersion(configMap.get(ConfigProto.ConfigKey.SITE_VERSION_VALUE));
|
configBuilder.setSiteVersion(configMap.get(ConfigProto.ConfigKey.SITE_VERSION_VALUE));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_INTRODUCTION_VALUE))) {
|
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.SITE_INTRODUCTION_VALUE))) {
|
||||||
configBuilder.setSiteIntroduction(configMap.get(ConfigProto.ConfigKey.SITE_INTRODUCTION_VALUE));
|
configBuilder.setSiteIntroduction(configMap.get(ConfigProto.ConfigKey.SITE_INTRODUCTION_VALUE));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.PIC_SIZE_VALUE))) {
|
if (StringUtils.isNotBlank(configMap.get(ConfigProto.ConfigKey.PIC_SIZE_VALUE))) {
|
||||||
configBuilder.setPicSize(configMap.get(ConfigProto.ConfigKey.PIC_SIZE_VALUE));
|
configBuilder.setPicSize(configMap.get(ConfigProto.ConfigKey.PIC_SIZE_VALUE));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNumeric(configMap.get(ConfigProto.ConfigKey.REALNAME_STATUS_VALUE))) {
|
if (StringUtils.isNumeric(configMap.get(ConfigProto.ConfigKey.REALNAME_STATUS_VALUE))) {
|
||||||
configBuilder.setRealNameConfigValue(
|
configBuilder.setRealNameConfigValue(
|
||||||
Integer.valueOf(configMap.get(ConfigProto.ConfigKey.REALNAME_STATUS_VALUE)));
|
Integer.valueOf(configMap.get(ConfigProto.ConfigKey.REALNAME_STATUS_VALUE)));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNumeric(configMap.get(ConfigProto.ConfigKey.INVITE_CODE_STATUS_VALUE))) {
|
if (StringUtils.isNumeric(configMap.get(ConfigProto.ConfigKey.INVITE_CODE_STATUS_VALUE))) {
|
||||||
configBuilder.setInviteCodeConfigValue(
|
configBuilder.setInviteCodeConfigValue(
|
||||||
Integer.valueOf(configMap.get(ConfigProto.ConfigKey.INVITE_CODE_STATUS_VALUE)));
|
Integer.valueOf(configMap.get(ConfigProto.ConfigKey.INVITE_CODE_STATUS_VALUE)));
|
||||||
}
|
}
|
||||||
ApiSiteConfigProto.ApiSiteConfigResponse response = ApiSiteConfigProto.ApiSiteConfigResponse
|
ApiSiteConfigProto.ApiSiteConfigResponse response = ApiSiteConfigProto.ApiSiteConfigResponse
|
||||||
.newBuilder().setSiteConfig(configBuilder.build()).build();
|
.newBuilder().setSiteConfig(configBuilder.build()).build();
|
||||||
commandResponse.setParams(response.toByteArray());
|
commandResponse.setParams(response.toByteArray());
|
||||||
errCode = ErrorCode2.SUCCESS;
|
errCode = ErrorCode2.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
errCode = ErrorCode2.ERROR_SYSTEMERROR;
|
errCode = ErrorCode2.ERROR_SYSTEMERROR;
|
||||||
LogUtils.requestErrorLog(logger, command, e);
|
LogUtils.requestErrorLog(logger, command, e);
|
||||||
}
|
}
|
||||||
return commandResponse.setErrCode2(errCode);
|
return commandResponse.setErrCode2(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public CommandResponse register(Command command) {
|
||||||
* 注册站点账户
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
*
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
* @param command
|
try {
|
||||||
* @return
|
ApiSiteRegisterProto.ApiSiteRegisterRequest request = ApiSiteRegisterProto.ApiSiteRegisterRequest
|
||||||
*/
|
.parseFrom(command.getParams());
|
||||||
@ApiActions(action = ".register")
|
String userIdPubk = request.getUserIdPubk();
|
||||||
public CommandResponse register(Command command) {
|
String userName = request.getUserName();
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
String userPhoto = request.getUserPhoto();
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
String userUic = request.getUserUic();
|
||||||
try {
|
String applyInfo = request.getApplyInfo();
|
||||||
ApiSiteRegisterProto.ApiSiteRegisterRequest request = ApiSiteRegisterProto.ApiSiteRegisterRequest
|
String phoneToken = request.getPhoneToken();
|
||||||
.parseFrom(command.getParams());
|
String fullPhoneId = null;// 通过phoneToken 查询的 counrtyCode:phoneId
|
||||||
String userIdPubk = request.getUserIdPubk();
|
String siteUserId = UUID.randomUUID().toString();// siteUserId保证各站不同
|
||||||
String userName = request.getUserName();
|
String siteLoginId = request.getSiteLoginId();// 站点账号
|
||||||
String userPhoto = request.getUserPhoto();
|
|
||||||
String userUic = request.getUserUic();
|
|
||||||
String applyInfo = request.getApplyInfo();
|
|
||||||
String phoneToken = request.getPhoneToken();
|
|
||||||
String fullPhoneId = null;// 通过phoneToken 查询的 counrtyCode:phoneId
|
|
||||||
String siteUserId = UUID.randomUUID().toString();// siteUserId保证各站不同
|
|
||||||
String siteLoginId = request.getSiteLoginId();// 站点账号
|
|
||||||
|
|
||||||
LogUtils.requestDebugLog(logger, command, request.toString());
|
LogUtils.requestDebugLog(logger, command, request.toString());
|
||||||
|
|
||||||
if (StringUtils.isAnyEmpty(userIdPubk, userName)) {
|
if (StringUtils.isAnyEmpty(userIdPubk, userName)) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR_PARAMETER);
|
throw new ZalyException2(ErrorCode2.ERROR_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userName.length() > 16) {
|
if (userName.length() > 16) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR_PARAMETER_NICKNAME);
|
throw new ZalyException2(ErrorCode2.ERROR_PARAMETER_NICKNAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否开启实名
|
// 是否开启实名
|
||||||
ConfigProto.RealNameConfig realNameConfig = SiteConfig.getRealNameConfig();
|
ConfigProto.RealNameConfig realNameConfig = SiteConfig.getRealNameConfig();
|
||||||
switch (realNameConfig) {
|
switch (realNameConfig) {
|
||||||
case REALNAME_YES:
|
case REALNAME_YES:
|
||||||
if (StringUtils.isNotBlank(phoneToken)) {
|
if (StringUtils.isNotBlank(phoneToken)) {
|
||||||
PlatformPhoneBean bean = PlatformUserPhone.getInstance().getPhoneIdFromPlatform(phoneToken);
|
PlatformPhoneBean bean = PlatformUserPhone.getInstance().getPhoneIdFromPlatform(phoneToken);
|
||||||
fullPhoneId = bean.getFullPhoneId();
|
fullPhoneId = bean.getFullPhoneId();
|
||||||
logger.debug("user realname register,get phoneid from platform:{}", fullPhoneId);
|
logger.debug("user realname register,get phoneid from platform:{}", fullPhoneId);
|
||||||
|
|
||||||
if (StringUtils.isEmpty(fullPhoneId)) {
|
if (StringUtils.isEmpty(fullPhoneId)) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR_REGISTER_PHONEID);
|
throw new ZalyException2(ErrorCode2.ERROR_REGISTER_PHONEID);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR_REGISTER_PHONETOKEN);
|
throw new ZalyException2(ErrorCode2.ERROR_REGISTER_PHONETOKEN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否开启邀请码
|
// 是否开启邀请码
|
||||||
ConfigProto.InviteCodeConfig uicConfig = SiteConfig.getUICConfig();
|
ConfigProto.InviteCodeConfig uicConfig = SiteConfig.getUICConfig();
|
||||||
switch (uicConfig) {
|
switch (uicConfig) {
|
||||||
case UIC_YES:
|
case UIC_YES:
|
||||||
logger.debug("注册方式:邀请码注册");
|
logger.debug("注册方式:邀请码注册");
|
||||||
if (!UserUic.getInstance().checkUic(userUic, siteUserId)) {
|
if (!UserUic.getInstance().checkUic(userUic, siteUserId)) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR_REGISTER_UIC);
|
throw new ZalyException2(ErrorCode2.ERROR_REGISTER_UIC);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserProfileBean regBean = new UserProfileBean();
|
UserProfileBean regBean = new UserProfileBean();
|
||||||
regBean.setSiteUserId(siteUserId);
|
regBean.setSiteUserId(siteUserId);
|
||||||
regBean.setUserIdPubk(userIdPubk);
|
regBean.setUserIdPubk(userIdPubk);
|
||||||
regBean.setUserName(userName);
|
regBean.setUserName(userName);
|
||||||
regBean.setUserNameInLatin(StringHelper.toLatinPinYin(userName));
|
regBean.setUserNameInLatin(StringHelper.toLatinPinYin(userName));
|
||||||
regBean.setApplyInfo(applyInfo);
|
regBean.setApplyInfo(applyInfo);
|
||||||
regBean.setUserPhoto(userPhoto);
|
regBean.setUserPhoto(userPhoto);
|
||||||
regBean.setPhoneId(fullPhoneId);
|
regBean.setPhoneId(fullPhoneId);
|
||||||
regBean.setUserStatus(UserProto.UserStatus.NORMAL_VALUE);
|
regBean.setUserStatus(UserProto.UserStatus.NORMAL_VALUE);
|
||||||
regBean.setRegisterTime(System.currentTimeMillis());
|
regBean.setRegisterTime(System.currentTimeMillis());
|
||||||
|
|
||||||
if (SiteLoginDao.getInstance().registerUser(regBean)) {
|
if (SiteLoginDao.getInstance().registerUser(regBean)) {
|
||||||
ApiSiteRegisterProto.ApiSiteRegisterResponse response = ApiSiteRegisterProto.ApiSiteRegisterResponse
|
ApiSiteRegisterProto.ApiSiteRegisterResponse response = ApiSiteRegisterProto.ApiSiteRegisterResponse
|
||||||
.newBuilder().setSiteUserId(siteUserId).build();
|
.newBuilder().setSiteUserId(siteUserId).build();
|
||||||
commandResponse.setParams(response.toByteArray());
|
commandResponse.setParams(response.toByteArray());
|
||||||
errCode = ErrorCode2.SUCCESS;
|
errCode = ErrorCode2.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
errCode = ErrorCode2.ERROR_REGISTER_USERID_UNIQUE;
|
errCode = ErrorCode2.ERROR_REGISTER_USERID_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ErrorCode2.SUCCESS == errCode) {
|
if (ErrorCode2.SUCCESS == errCode) {
|
||||||
addUserDefaultFriendsAndGroups(siteUserId);
|
addUserDefaultFriendsAndGroups(siteUserId);
|
||||||
// 注册成功,需要做一个管理员身份验证
|
// 注册成功,需要做一个管理员身份验证
|
||||||
justForAdminUser(siteUserId, command.getHeader());
|
justForAdminUser(siteUserId, command.getHeader());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
errCode = ErrorCode2.ERROR_SYSTEMERROR;
|
errCode = ErrorCode2.ERROR_SYSTEMERROR;
|
||||||
LogUtils.requestErrorLog(logger, command, e);
|
LogUtils.requestErrorLog(logger, command, e);
|
||||||
} catch (ZalyException2 e) {
|
} catch (ZalyException2 e) {
|
||||||
errCode = e.getErrCode();
|
errCode = e.getErrCode();
|
||||||
LogUtils.requestErrorLog(logger, command, e);
|
LogUtils.requestErrorLog(logger, command, e);
|
||||||
}
|
}
|
||||||
return commandResponse.setErrCode(errCode);
|
return commandResponse.setErrCode(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 增加默认好友以及群组
|
// 增加默认好友以及群组
|
||||||
private void addUserDefaultFriendsAndGroups(String siteUserId) {
|
private void addUserDefaultFriendsAndGroups(String siteUserId) {
|
||||||
try {
|
try {
|
||||||
Set<String> defaultFriends = SiteConfig.getUserDefaultFriends();
|
Set<String> defaultFriends = SiteConfig.getUserDefaultFriends();
|
||||||
if (defaultFriends != null && defaultFriends.size() > 0) {
|
if (defaultFriends != null && defaultFriends.size() > 0) {
|
||||||
for (String siteFriendId : defaultFriends) {
|
for (String siteFriendId : defaultFriends) {
|
||||||
UserFriendDao.getInstance().saveFriendApply(siteFriendId, siteUserId, "我已成为你的好友,给我发消息试试吧");
|
UserFriendDao.getInstance().saveFriendApply(siteFriendId, siteUserId, "我已成为你的好友,给我发消息试试吧");
|
||||||
UserFriendDao.getInstance().agreeApply(siteUserId, siteFriendId, true);
|
UserFriendDao.getInstance().agreeApply(siteUserId, siteFriendId, true);
|
||||||
ApplyFriendBean applyBean = UserFriendDao.getInstance().agreeApplyWithClear(siteUserId,
|
ApplyFriendBean applyBean = UserFriendDao.getInstance().agreeApplyWithClear(siteUserId,
|
||||||
siteFriendId, true);
|
siteFriendId, true);
|
||||||
new User2Notice().addFriendTextMessage(applyBean);
|
new User2Notice().addFriendTextMessage(applyBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.debug("{} add default friends={}", siteUserId, defaultFriends);
|
logger.debug("{} add default friends={}", siteUserId, defaultFriends);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("add default friends error", e);
|
logger.error("add default friends error", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Set<String> defaultGroups = SiteConfig.getUserDefaultGroups();
|
Set<String> defaultGroups = SiteConfig.getUserDefaultGroups();
|
||||||
if (defaultGroups != null && defaultGroups.size() > 0) {
|
if (defaultGroups != null && defaultGroups.size() > 0) {
|
||||||
for (String groupId : defaultGroups) {
|
for (String groupId : defaultGroups) {
|
||||||
UserGroupDao.getInstance().addDefaultGroupMember(groupId, siteUserId);
|
UserGroupDao.getInstance().addDefaultGroupMember(groupId, siteUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.debug("{} add default groups={}", siteUserId, defaultGroups);
|
logger.debug("{} add default groups={}", siteUserId, defaultGroups);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("add user default groups error", e);
|
logger.error("add user default groups error", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void justForAdminUser(String siteUserId, Map<Integer, String> header) {
|
private void justForAdminUser(String siteUserId, Map<Integer, String> header) {
|
||||||
try {
|
try {
|
||||||
// 如果站点没有管理员
|
// 如果站点没有管理员
|
||||||
if (SiteConfig.hasNoAdminUser()) {
|
if (SiteConfig.hasNoAdminUser()) {
|
||||||
logger.debug("user first time to register site server ,set it as admin:{} map:{}", siteUserId, header);
|
logger.debug("user first time to register site server ,set it as admin:{} map:{}", siteUserId, header);
|
||||||
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_ADMIN_VALUE, siteUserId);
|
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_ADMIN_VALUE, siteUserId);
|
||||||
if (header != null) {
|
if (header != null) {
|
||||||
String host = header.get(CoreProto.HeaderKey.CLIENT_REQUEST_SERVER_HOST_VALUE);
|
String host = header.get(CoreProto.HeaderKey.CLIENT_REQUEST_SERVER_HOST_VALUE);
|
||||||
if (StringUtils.isNotEmpty(host)) {
|
if (StringUtils.isNotEmpty(host)) {
|
||||||
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_ADDRESS_VALUE, host);
|
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_ADDRESS_VALUE, host);
|
||||||
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_NAME_VALUE, host);
|
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_NAME_VALUE, host);
|
||||||
}
|
}
|
||||||
String port = header.get(CoreProto.HeaderKey.CLIENT_REQUEST_SERVER_HOST_VALUE);
|
String port = header.get(CoreProto.HeaderKey.CLIENT_REQUEST_SERVER_HOST_VALUE);
|
||||||
if (StringUtils.isNotBlank(port)) {
|
if (StringUtils.isNotBlank(port)) {
|
||||||
port = "" + DEFAULT_PORT;
|
port = "" + DEFAULT_PORT;
|
||||||
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_PORT_VALUE, port);
|
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.SITE_PORT_VALUE, port);
|
||||||
}
|
}
|
||||||
// 修改邀请码注册方式
|
// 修改邀请码注册方式
|
||||||
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.INVITE_CODE_STATUS_VALUE,
|
SiteConfigDao.getInstance().updateSiteConfig(ConfigProto.ConfigKey.INVITE_CODE_STATUS_VALUE,
|
||||||
ConfigProto.InviteCodeConfig.UIC_NO_VALUE + "");
|
ConfigProto.InviteCodeConfig.UIC_NO_VALUE + "");
|
||||||
}
|
}
|
||||||
SiteConfig.updateConfig();
|
SiteConfig.updateConfig();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("set site admin error", e);
|
logger.error("set site admin error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行用户登录站点行为
|
* 执行用户登陆站点行为
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".login")
|
public CommandResponse login(Command command) {
|
||||||
public CommandResponse login(Command command) {
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
try {
|
||||||
try {
|
ApiSiteLoginProto.ApiSiteLoginRequest loginRequest = ApiSiteLoginProto.ApiSiteLoginRequest
|
||||||
ApiSiteLoginProto.ApiSiteLoginRequest loginRequest = ApiSiteLoginProto.ApiSiteLoginRequest
|
.parseFrom(command.getParams());
|
||||||
.parseFrom(command.getParams());
|
String userIdPubk = loginRequest.getUserIdPubk();
|
||||||
String userIdPubk = loginRequest.getUserIdPubk();
|
String userIdSignBase64 = loginRequest.getUserIdSignBase64();
|
||||||
String userIdSignBase64 = loginRequest.getUserIdSignBase64();
|
String userDeviceIdPubk = loginRequest.getUserDeviceIdPubk();
|
||||||
String userDeviceIdPubk = loginRequest.getUserDeviceIdPubk();
|
String userDeviceIdSignBase64 = loginRequest.getUserDeviceIdSignBase64();
|
||||||
String userDeviceIdSignBase64 = loginRequest.getUserDeviceIdSignBase64();
|
String userDeviceName = loginRequest.getUserDeviceName();
|
||||||
String userDeviceName = loginRequest.getUserDeviceName();
|
String userToken = loginRequest.getUserToken();
|
||||||
String userToken = loginRequest.getUserToken();
|
String phoneToken = loginRequest.getPhoneToken();
|
||||||
String phoneToken = loginRequest.getPhoneToken();
|
LogUtils.requestDebugLog(logger, command, loginRequest.toString());
|
||||||
LogUtils.requestDebugLog(logger, command, loginRequest.toString());
|
|
||||||
|
|
||||||
if (StringUtils.isAnyEmpty(userIdPubk, userIdSignBase64)) {
|
if (StringUtils.isAnyEmpty(userIdPubk, userIdSignBase64)) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_USERID_EMPTY);
|
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_USERID_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isAnyEmpty(userDeviceIdPubk, userDeviceIdSignBase64)) {
|
if (StringUtils.isAnyEmpty(userDeviceIdPubk, userDeviceIdSignBase64)) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_DEVICEID_EMPTY);
|
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_DEVICEID_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (StringUtils.isEmpty(userToken)) {
|
// if (StringUtils.isEmpty(userToken)) {
|
||||||
// throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_USERTOKEN_EMPTY);
|
// throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_USERTOKEN_EMPTY);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
PublicKey userPubKey = RSACrypto.getRSAPubKeyFromPem(userIdPubk);// 个人身份公钥,解密Sign签名,解密Key
|
PublicKey userPubKey = RSACrypto.getRSAPubKeyFromPem(userIdPubk);// 个人身份公钥,解密Sign签名,解密Key
|
||||||
Signature userSign = Signature.getInstance("SHA512withRSA");
|
Signature userSign = Signature.getInstance("SHA512withRSA");
|
||||||
userSign.initVerify(userPubKey);
|
userSign.initVerify(userPubKey);
|
||||||
userSign.update(userIdPubk.getBytes());// 原文
|
userSign.update(userIdPubk.getBytes());// 原文
|
||||||
boolean userSignResult = userSign.verify(Base64.getDecoder().decode(userIdSignBase64));
|
boolean userSignResult = userSign.verify(Base64.getDecoder().decode(userIdSignBase64));
|
||||||
logger.debug("userSignResult={}", userSignResult);
|
logger.debug("userSignResult={}", userSignResult);
|
||||||
|
|
||||||
if (userSignResult) {
|
if (userSignResult) {
|
||||||
Signature userDeviceSign = Signature.getInstance("SHA512withRSA");
|
Signature userDeviceSign = Signature.getInstance("SHA512withRSA");
|
||||||
userDeviceSign.initVerify(userPubKey);
|
userDeviceSign.initVerify(userPubKey);
|
||||||
userDeviceSign.update(userDeviceIdPubk.getBytes());// 原文
|
userDeviceSign.update(userDeviceIdPubk.getBytes());// 原文
|
||||||
userSignResult = userDeviceSign.verify(Base64.getDecoder().decode(userDeviceIdSignBase64));
|
userSignResult = userDeviceSign.verify(Base64.getDecoder().decode(userDeviceIdSignBase64));
|
||||||
}
|
}
|
||||||
logger.debug("deviceSignResult={}", userSignResult);
|
logger.debug("deviceSignResult={}", userSignResult);
|
||||||
|
|
||||||
// 用户身份校验成功,方可执行登陆操作
|
// 用户身份校验成功,方可执行登陆操作
|
||||||
if (!userSignResult) {
|
if (!userSignResult) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_ERRORSIGN);
|
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_ERRORSIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 登陆去平台实名机制校验
|
// 登陆去平台实名机制校验
|
||||||
String globalUserId = verifyPlatformPhoneAndGetGlobalUserId(userIdPubk, phoneToken);
|
String globalUserId = verifyPlatformPhoneAndGetGlobalUserId(userIdPubk, phoneToken);
|
||||||
|
|
||||||
// 判断用户,是否已经注册,从主库中查找
|
// 判断用户,是否已经注册,从主库中查找
|
||||||
SimpleUserBean subean = UserProfileDao.getInstance().getSimpleProfileByGlobalUserId(globalUserId, true);
|
SimpleUserBean subean = UserProfileDao.getInstance().getSimpleProfileByGlobalUserId(globalUserId, true);
|
||||||
if (subean == null || StringUtils.isEmpty(subean.getUserId())) {
|
if (subean == null || StringUtils.isEmpty(subean.getUserId())) {
|
||||||
logger.info("login site: new user need to register before login site");
|
logger.info("login site: new user need to register before login site");
|
||||||
errCode = ErrorCode2.ERROR2_LOGGIN_NOREGISTER;// 未注册,告知用户执行注册行为
|
errCode = ErrorCode2.ERROR2_LOGGIN_NOREGISTER;// 未注册,告知用户执行注册行为
|
||||||
return commandResponse.setErrCode(errCode);
|
return commandResponse.setErrCode(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subean.getUserStatus() == UserProto.UserStatus.SEALUP_VALUE) {
|
if (subean.getUserStatus() == UserProto.UserStatus.SEALUP_VALUE) {
|
||||||
logger.info("login site: user no permision as sealed up");
|
logger.info("login site: user no permision as sealed up");
|
||||||
errCode = ErrorCode2.ERROR2_LOGGIN_SEALUPUSER;// 禁封用户禁止登陆
|
errCode = ErrorCode2.ERROR2_LOGGIN_SEALUPUSER;// 禁封用户禁止登陆
|
||||||
return commandResponse.setErrCode(errCode);
|
return commandResponse.setErrCode(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
String siteUserId = subean.getUserId();
|
String siteUserId = subean.getUserId();
|
||||||
String deviceId = HashCrypto.MD5(userDeviceIdPubk);
|
String deviceId = HashCrypto.MD5(userDeviceIdPubk);
|
||||||
|
|
||||||
// 保存设备信息
|
// 保存设备信息
|
||||||
UserDeviceBean deviceBean = new UserDeviceBean();
|
UserDeviceBean deviceBean = new UserDeviceBean();
|
||||||
deviceBean.setDeviceId(deviceId);
|
deviceBean.setDeviceId(deviceId);
|
||||||
deviceBean.setDeviceName(userDeviceName);
|
deviceBean.setDeviceName(userDeviceName);
|
||||||
deviceBean.setSiteUserId(siteUserId);
|
deviceBean.setSiteUserId(siteUserId);
|
||||||
deviceBean.setUserDevicePubk(userDeviceIdPubk);
|
deviceBean.setUserDevicePubk(userDeviceIdPubk);
|
||||||
deviceBean.setUserToken(userToken);
|
deviceBean.setUserToken(userToken);
|
||||||
deviceBean.setActiveTime(System.currentTimeMillis());
|
deviceBean.setActiveTime(System.currentTimeMillis());
|
||||||
deviceBean.setAddTime(System.currentTimeMillis());
|
deviceBean.setAddTime(System.currentTimeMillis());
|
||||||
|
|
||||||
boolean loginResult = SiteLoginDao.getInstance().updateUserDevice(deviceBean);
|
boolean loginResult = SiteLoginDao.getInstance().updateUserDevice(deviceBean);
|
||||||
|
|
||||||
if (!loginResult) {// 更新失败,则重新保存数据
|
if (!loginResult) {// 更新失败,则重新保存数据
|
||||||
loginResult = SiteLoginDao.getInstance().saveUserDevice(deviceBean);
|
loginResult = SiteLoginDao.getInstance().saveUserDevice(deviceBean);
|
||||||
// 在新增设备情况下,控制设备数量
|
// 在新增设备情况下,控制设备数量
|
||||||
limitUserDevice(siteUserId);
|
limitUserDevice(siteUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("login site: save device result={} deviceBean={}", loginResult, deviceBean.toString());
|
logger.debug("login site: save device result={} deviceBean={}", loginResult, deviceBean.toString());
|
||||||
|
|
||||||
if (!loginResult) {
|
if (!loginResult) {
|
||||||
// 身份校验失败
|
// 身份校验失败
|
||||||
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_UPDATE_DEVICE);
|
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_UPDATE_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成session
|
// 生成session
|
||||||
String sessionId = UUID.randomUUID().toString();
|
String sessionId = UUID.randomUUID().toString();
|
||||||
|
|
||||||
UserSessionBean sessionBean = new UserSessionBean();
|
UserSessionBean sessionBean = new UserSessionBean();
|
||||||
sessionBean.setLoginTime(System.currentTimeMillis());
|
sessionBean.setLoginTime(System.currentTimeMillis());
|
||||||
sessionBean.setSiteUserId(siteUserId);
|
sessionBean.setSiteUserId(siteUserId);
|
||||||
sessionBean.setOnline(true);
|
sessionBean.setOnline(true);
|
||||||
sessionBean.setSessionId(sessionId);
|
sessionBean.setSessionId(sessionId);
|
||||||
sessionBean.setDeviceId(deviceId);
|
sessionBean.setDeviceId(deviceId);
|
||||||
sessionBean.setLoginTime(System.currentTimeMillis());// 上次登陆(auth)时间
|
sessionBean.setLoginTime(System.currentTimeMillis());// 上次登陆(auth)时间
|
||||||
|
|
||||||
loginResult = loginResult && SiteLoginDao.getInstance().saveUserSession(sessionBean);
|
loginResult = loginResult && SiteLoginDao.getInstance().saveUserSession(sessionBean);
|
||||||
|
|
||||||
if (loginResult) {
|
if (loginResult) {
|
||||||
ApiSiteLoginProto.ApiSiteLoginResponse response = ApiSiteLoginProto.ApiSiteLoginResponse.newBuilder()
|
ApiSiteLoginProto.ApiSiteLoginResponse response = ApiSiteLoginProto.ApiSiteLoginResponse.newBuilder()
|
||||||
.setSiteUserId(siteUserId).setUserSessionId(sessionId).build();
|
.setSiteUserId(siteUserId).setUserSessionId(sessionId).build();
|
||||||
commandResponse.setParams(response.toByteArray());
|
commandResponse.setParams(response.toByteArray());
|
||||||
errCode = ErrorCode2.SUCCESS;
|
errCode = ErrorCode2.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
errCode = ErrorCode2.ERROR2_LOGGIN_UPDATE_SESSION;
|
errCode = ErrorCode2.ERROR2_LOGGIN_UPDATE_SESSION;
|
||||||
}
|
}
|
||||||
} catch (ZalyException2 e) {
|
} catch (ZalyException2 e) {
|
||||||
errCode = e.getErrCode();
|
errCode = e.getErrCode();
|
||||||
LogUtils.requestErrorLog(logger, command, e);
|
LogUtils.requestErrorLog(logger, command, e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
errCode = ErrorCode2.ERROR_SYSTEMERROR;
|
errCode = ErrorCode2.ERROR_SYSTEMERROR;
|
||||||
LogUtils.requestErrorLog(logger, command, e);
|
LogUtils.requestErrorLog(logger, command, e);
|
||||||
}
|
}
|
||||||
return commandResponse.setErrCode(errCode);
|
return commandResponse.setErrCode(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String verifyPlatformPhoneAndGetGlobalUserId(String userIdPubk, String phoneToken) throws ZalyException2 {
|
private String verifyPlatformPhoneAndGetGlobalUserId(String userIdPubk, String phoneToken) throws ZalyException2 {
|
||||||
phoneToken = null;
|
phoneToken = null;
|
||||||
if (StringUtils.isEmpty(phoneToken)) {
|
if (StringUtils.isEmpty(phoneToken)) {
|
||||||
logger.debug("api.site.login with phoneToken={}", phoneToken);
|
logger.debug("api.site.login with phoneToken={}", phoneToken);
|
||||||
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 登陆去平台校验实名机制
|
// 登陆去平台校验实名机制
|
||||||
ConfigProto.RealNameConfig realNameConfig = SiteConfig.getRealNameConfig();
|
ConfigProto.RealNameConfig realNameConfig = SiteConfig.getRealNameConfig();
|
||||||
|
|
||||||
if (ConfigProto.RealNameConfig.REALNAME_YES == realNameConfig) {
|
if (ConfigProto.RealNameConfig.REALNAME_YES == realNameConfig) {
|
||||||
PlatformPhoneBean bean = PlatformUserPhone.getInstance().getPhoneIdFromPlatform(phoneToken);
|
PlatformPhoneBean bean = PlatformUserPhone.getInstance().getPhoneIdFromPlatform(phoneToken);
|
||||||
String fullPhoneId = bean.getFullPhoneId();
|
String fullPhoneId = bean.getFullPhoneId();
|
||||||
String platformUserIdPubk = bean.getUserIdPubk();
|
String platformUserIdPubk = bean.getUserIdPubk();
|
||||||
logger.debug("get platform realname phone info bean={}", bean);
|
logger.debug("get platform realname phone info bean={}", bean);
|
||||||
|
|
||||||
if (StringUtils.isEmpty(fullPhoneId)) {
|
if (StringUtils.isEmpty(fullPhoneId)) {
|
||||||
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userIdPubk.equals(platformUserIdPubk)) {
|
if (!userIdPubk.equals(platformUserIdPubk)) {
|
||||||
logger.error("api.site.login equals={} userIdPubk={} platformUserIdPubk={}", false, userIdPubk,
|
logger.error("api.site.login equals={} userIdPubk={} platformUserIdPubk={}", false, userIdPubk,
|
||||||
platformUserIdPubk);
|
platformUserIdPubk);
|
||||||
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 手机号查询用户身份
|
// 手机号查询用户身份
|
||||||
UserProfileBean profile = UserProfileDao.getInstance().getUserProfileByFullPhoneId(fullPhoneId);
|
UserProfileBean profile = UserProfileDao.getInstance().getUserProfileByFullPhoneId(fullPhoneId);
|
||||||
|
|
||||||
if (profile != null && StringUtils.isNoneEmpty(platformUserIdPubk, profile.getUserIdPubk())) {
|
if (profile != null && StringUtils.isNoneEmpty(platformUserIdPubk, profile.getUserIdPubk())) {
|
||||||
|
|
||||||
if (platformUserIdPubk.equals(profile.getUserIdPubk())) {
|
if (platformUserIdPubk.equals(profile.getUserIdPubk())) {
|
||||||
logger.debug("new site realname login verifyPlatformPhone success");
|
logger.debug("new site realname login verifyPlatformPhone success");
|
||||||
return UserIdUtils.getV1GlobalUserId(platformUserIdPubk);
|
return UserIdUtils.getV1GlobalUserId(platformUserIdPubk);
|
||||||
} else {
|
} else {
|
||||||
// 更新数据
|
// 更新数据
|
||||||
String globalUserId = UserIdUtils.getV1GlobalUserId(platformUserIdPubk);
|
String globalUserId = UserIdUtils.getV1GlobalUserId(platformUserIdPubk);
|
||||||
boolean updateRes = UserProfileDao.getInstance().updateUserIdPubk(profile.getSiteUserId(),
|
boolean updateRes = UserProfileDao.getInstance().updateUserIdPubk(profile.getSiteUserId(),
|
||||||
globalUserId, userIdPubk);
|
globalUserId, userIdPubk);
|
||||||
|
|
||||||
if (!updateRes) {
|
if (!updateRes) {
|
||||||
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_UPDATENEWPUBK);
|
throw new ZalyException2(ErrorCode2.ERROR2_LOGGIN_UPDATENEWPUBK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
return UserIdUtils.getV1GlobalUserId(userIdPubk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 控制用户的设备数量
|
// 控制用户的设备数量
|
||||||
private void limitUserDevice(String siteUserId) {
|
private void limitUserDevice(String siteUserId) {
|
||||||
try {
|
try {
|
||||||
int limitNumber = 4;
|
int limitNumber = 4;
|
||||||
userDeviceDao.limitDeviceNum(siteUserId, limitNumber);
|
userDeviceDao.limitDeviceNum(siteUserId, limitNumber);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(StringHelper.format("limit siteUserId={} device num error", siteUserId), e);
|
logger.error(StringHelper.format("limit siteUserId={} device num error", siteUserId), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,12 +15,16 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.core.UserProto;
|
import java.util.regex.Matcher;
|
||||||
import com.akaxin.proto.site.ApiUserMuteProto;
|
import java.util.regex.Pattern;
|
||||||
import com.akaxin.proto.site.ApiUserProfileProto;
|
|
||||||
import com.akaxin.proto.site.ApiUserSearchProto;
|
import com.windchat.im.business.dao.UserFriendDao;
|
||||||
import com.akaxin.proto.site.ApiUserUpdateMuteProto;
|
import com.windchat.im.business.dao.UserProfileDao;
|
||||||
import com.akaxin.proto.site.ApiUserUpdateProfileProto;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
@ -30,18 +34,17 @@ import com.windchat.common.exceptions.ZalyException2;
|
|||||||
import com.windchat.common.logs.LogUtils;
|
import com.windchat.common.logs.LogUtils;
|
||||||
import com.windchat.common.utils.StringHelper;
|
import com.windchat.common.utils.StringHelper;
|
||||||
import com.windchat.common.utils.ValidatorPattern;
|
import com.windchat.common.utils.ValidatorPattern;
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import com.akaxin.proto.core.UserProto;
|
||||||
|
import com.akaxin.proto.site.ApiUserMuteProto;
|
||||||
|
import com.akaxin.proto.site.ApiUserProfileProto;
|
||||||
|
import com.akaxin.proto.site.ApiUserSearchProto;
|
||||||
|
import com.akaxin.proto.site.ApiUserUpdateMuteProto;
|
||||||
|
import com.akaxin.proto.site.ApiUserUpdateProfileProto;
|
||||||
import com.windchat.im.business.dao.UserFriendDao;
|
import com.windchat.im.business.dao.UserFriendDao;
|
||||||
import com.windchat.im.business.dao.UserProfileDao;
|
import com.windchat.im.business.dao.UserProfileDao;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import com.windchat.im.storage.bean.UserFriendBean;
|
import com.windchat.im.storage.bean.UserFriendBean;
|
||||||
import com.windchat.im.storage.bean.UserProfileBean;
|
import com.windchat.im.storage.bean.UserProfileBean;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户个人自身资料相关功能
|
* 用户个人自身资料相关功能
|
||||||
@ -49,7 +52,6 @@ import java.util.regex.Pattern;
|
|||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017.11.25 15:10:36
|
* @since 2017.11.25 15:10:36
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.user")
|
|
||||||
public class ApiUserService extends AbstractRequest {
|
public class ApiUserService extends AbstractRequest {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiUserService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiUserService.class);
|
||||||
|
|
||||||
@ -59,7 +61,6 @@ public class ApiUserService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".search")
|
|
||||||
public CommandResponse search(Command command) {
|
public CommandResponse search(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
@ -149,7 +150,6 @@ public class ApiUserService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".profile")
|
|
||||||
public CommandResponse profile(Command command) {
|
public CommandResponse profile(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errorCode = ErrorCode2.ERROR;
|
ErrorCode2 errorCode = ErrorCode2.ERROR;
|
||||||
@ -206,7 +206,6 @@ public class ApiUserService extends AbstractRequest {
|
|||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = ".updateProfile")
|
|
||||||
public CommandResponse updateProfile(Command command) {
|
public CommandResponse updateProfile(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
@ -272,13 +271,6 @@ public class ApiUserService extends AbstractRequest {
|
|||||||
return commandResponse.setErrCode(errCode);
|
return commandResponse.setErrCode(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取消息免打扰状态
|
|
||||||
*
|
|
||||||
* @param command
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiActions(action = ".mute")
|
|
||||||
public CommandResponse mute(Command command) {
|
public CommandResponse mute(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
@ -298,13 +290,6 @@ public class ApiUserService extends AbstractRequest {
|
|||||||
return commandResponse.setErrCode2(errCode);
|
return commandResponse.setErrCode2(errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置消息免打扰状态
|
|
||||||
*
|
|
||||||
* @param command
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiActions(action = ".updateMute")
|
|
||||||
public CommandResponse updateMute(Command command) {
|
public CommandResponse updateMute(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
ErrorCode2 errCode = ErrorCode2.ERROR;
|
ErrorCode2 errCode = ErrorCode2.ERROR;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,7 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.impl.tai;
|
package com.windchat.im.business.impl.tai;
|
||||||
|
|
||||||
import com.akaxin.proto.site.ApiWebAuthProto;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
@ -23,12 +27,9 @@ import com.windchat.common.constant.ErrorCode2;
|
|||||||
import com.windchat.common.constant.IErrorCode;
|
import com.windchat.common.constant.IErrorCode;
|
||||||
import com.windchat.common.exceptions.ZalyException;
|
import com.windchat.common.exceptions.ZalyException;
|
||||||
import com.windchat.common.logs.LogUtils;
|
import com.windchat.common.logs.LogUtils;
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import com.akaxin.proto.site.ApiWebAuthProto;
|
||||||
import com.windchat.im.business.cache.WebSessionCache;
|
import com.windchat.im.business.cache.WebSessionCache;
|
||||||
import com.windchat.im.business.impl.AbstractRequest;
|
import com.windchat.im.business.impl.AbstractRequest;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* webim服务
|
* webim服务
|
||||||
@ -36,11 +37,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017.11.25 15:10:36
|
* @since 2017.11.25 15:10:36
|
||||||
*/
|
*/
|
||||||
@ApiActions(action = "api.web")
|
|
||||||
public class ApiWebService extends AbstractRequest {
|
public class ApiWebService extends AbstractRequest {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiWebService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiWebService.class);
|
||||||
|
|
||||||
@ApiActions(action = ".auth")
|
|
||||||
public CommandResponse auth(Command command) {
|
public CommandResponse auth(Command command) {
|
||||||
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
|
||||||
IErrorCode errCode = ErrorCode2.ERROR;
|
IErrorCode errCode = ErrorCode2.ERROR;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -11,37 +11,39 @@
|
|||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.windchat.im.business.service;
|
package com.windchat.im.business.service;
|
||||||
|
|
||||||
|
import com.windchat.im.business.api.IRequest;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
import com.windchat.common.constant.ErrorCode2;
|
import com.windchat.common.constant.ErrorCode2;
|
||||||
import com.windchat.common.utils.StringHelper;
|
import com.windchat.common.utils.StringHelper;
|
||||||
import com.windchat.im.business.api.IRequest;
|
import com.windchat.im.business.api.IRequest;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API处理业务逻辑
|
* API处理业务逻辑
|
||||||
*
|
*
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017.10.16
|
* @since 2017.10.16
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class ApiRequestService implements IRequest {
|
public class ApiRequestService implements IRequest {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiRequestService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiRequestService.class);
|
||||||
|
|
||||||
public CommandResponse process(Command command) {
|
public CommandResponse process(Command command) {
|
||||||
try {
|
try {
|
||||||
String action = command.getRety() + "." + command.getService();
|
return ApiServiceFactory.getService(command.getService()).execute(command);
|
||||||
return ApiServiceFactory.getService(action).execute(command);
|
} catch (Exception e) {
|
||||||
} catch (Exception e) {
|
logger.error(StringHelper.format("api request service error.command={}", command), e);
|
||||||
logger.error(StringHelper.format("api request service error.command={}", command), e);
|
}
|
||||||
}
|
return new CommandResponse().setVersion(CommandConst.PROTOCOL_VERSION).setAction(CommandConst.ACTION_RES)
|
||||||
return new CommandResponse().setVersion(CommandConst.PROTOCOL_VERSION).setAction(CommandConst.ACTION_RES)
|
.setErrCode2(ErrorCode2.ERROR);
|
||||||
.setErrCode2(ErrorCode2.ERROR);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -11,11 +11,14 @@
|
|||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.windchat.im.business.service;
|
package com.windchat.im.business.service;
|
||||||
|
|
||||||
import com.windchat.im.business.bean.ApiActions;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.windchat.common.constant.RequestAction;
|
||||||
import com.windchat.im.business.impl.IRequestService;
|
import com.windchat.im.business.impl.IRequestService;
|
||||||
import com.windchat.im.business.impl.tai.ApiDeviceService;
|
import com.windchat.im.business.impl.tai.ApiDeviceService;
|
||||||
import com.windchat.im.business.impl.tai.ApiFileService;
|
import com.windchat.im.business.impl.tai.ApiFileService;
|
||||||
@ -25,50 +28,40 @@ import com.windchat.im.business.impl.tai.ApiPluginService;
|
|||||||
import com.windchat.im.business.impl.tai.ApiSecretChatService;
|
import com.windchat.im.business.impl.tai.ApiSecretChatService;
|
||||||
import com.windchat.im.business.impl.tai.ApiSiteService;
|
import com.windchat.im.business.impl.tai.ApiSiteService;
|
||||||
import com.windchat.im.business.impl.tai.ApiUserService;
|
import com.windchat.im.business.impl.tai.ApiUserService;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API业务请求,分发工厂
|
* API业务请求,分发工厂
|
||||||
*
|
*
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2017.10.24 18:25:31
|
* @since 2017.10.24 18:25:31
|
||||||
*/
|
*/
|
||||||
public class ApiServiceFactory {
|
public class ApiServiceFactory {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApiServiceFactory.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApiServiceFactory.class);
|
||||||
|
|
||||||
private static Map<String, IRequestService> serviceMap = new LinkedHashMap<String, IRequestService>();
|
public static IRequestService getService(String serviceName) {
|
||||||
private static List<IRequestService> serviceList = new LinkedList<IRequestService>();
|
RequestAction nameEnum = RequestAction.getAction(serviceName);
|
||||||
|
switch (nameEnum) {
|
||||||
static {
|
case SITE:
|
||||||
serviceList.add(new ApiSiteService());
|
return new ApiSiteService();
|
||||||
serviceList.add(new ApiUserService());
|
case API_USER:
|
||||||
serviceList.add(new ApiFriendService());
|
return new ApiUserService();
|
||||||
serviceList.add(new ApiGroupService());
|
case API_FRIEND:
|
||||||
serviceList.add(new ApiSecretChatService());
|
return new ApiFriendService();
|
||||||
serviceList.add(new ApiFileService());
|
case API_GROUP:
|
||||||
serviceList.add(new ApiDeviceService());
|
return new ApiGroupService();
|
||||||
serviceList.add(new ApiPluginService());
|
case API_SECRETCHAT:
|
||||||
|
return new ApiSecretChatService();
|
||||||
init();
|
case API_FILE:
|
||||||
}
|
return new ApiFileService();
|
||||||
|
case API_DEVICE:
|
||||||
private static void init() {
|
return new ApiDeviceService();
|
||||||
for (IRequestService requestService : serviceList) {
|
case API_PLUGIN:
|
||||||
ApiActions serviceApiAction = requestService.getClass().getDeclaredAnnotation(ApiActions.class);
|
return new ApiPluginService();
|
||||||
if (serviceApiAction != null) {
|
default:
|
||||||
serviceMap.put(serviceApiAction.action(), requestService);
|
logger.error("api business service error.service={}", nameEnum.getName());
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
public static IRequestService getService(String serviceAction) {
|
|
||||||
return serviceMap.get(serviceAction);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.im.business.service;
|
package com.windchat.im.business.service;
|
||||||
|
|
||||||
|
import com.windchat.im.business.api.IRequest;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.CommandResponse;
|
import com.windchat.common.command.CommandResponse;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
@ -28,8 +32,6 @@ import com.windchat.im.business.impl.hai.HttpPushService;
|
|||||||
import com.windchat.im.business.impl.hai.HttpSessionService;
|
import com.windchat.im.business.impl.hai.HttpSessionService;
|
||||||
import com.windchat.im.business.impl.hai.HttpSiteService;
|
import com.windchat.im.business.impl.hai.HttpSiteService;
|
||||||
import com.windchat.im.business.impl.hai.HttpUserService;
|
import com.windchat.im.business.impl.hai.HttpUserService;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Http请求服务分发
|
* Http请求服务分发
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,14 +15,18 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.command;
|
package com.windchat.common.command;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.windchat.common.channel.ChannelSession;
|
||||||
|
import com.windchat.common.utils.StringHelper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.windchat.common.channel.ChannelSession;
|
import com.windchat.common.channel.ChannelSession;
|
||||||
import com.windchat.common.constant.CommandConst;
|
import com.windchat.common.constant.CommandConst;
|
||||||
import com.windchat.common.utils.StringHelper;
|
import com.windchat.common.utils.StringHelper;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理完成后的消息载体
|
* 处理完成后的消息载体
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -16,11 +16,11 @@
|
|||||||
package com.windchat.common.constant;
|
package com.windchat.common.constant;
|
||||||
|
|
||||||
public interface IErrorCode {
|
public interface IErrorCode {
|
||||||
String getCode();
|
public String getCode();
|
||||||
|
|
||||||
String getInfo();
|
public String getInfo();
|
||||||
|
|
||||||
boolean isSuccess();
|
public boolean isSuccess();
|
||||||
|
|
||||||
String toString();
|
public String toString();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2018-2028 WindChat Group
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.windchat.common.exceptions;
|
|
||||||
|
|
||||||
import com.windchat.common.constant.IErrorCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义API请求过程中产生的特殊异常
|
|
||||||
*
|
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
|
||||||
* @since 2018-04-09 12:32:08
|
|
||||||
*/
|
|
||||||
public class ZalyWarning extends Exception {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private IErrorCode errCode;
|
|
||||||
|
|
||||||
public ZalyWarning(IErrorCode errCode) {
|
|
||||||
super(errCode.toString());
|
|
||||||
this.errCode = errCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IErrorCode getErrCode() {
|
|
||||||
return this.errCode;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -11,7 +11,7 @@
|
|||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.windchat.common.logs;
|
package com.windchat.common.logs;
|
||||||
|
|
||||||
@ -22,68 +22,65 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.helpers.FormattingTuple;
|
import org.slf4j.helpers.FormattingTuple;
|
||||||
import org.slf4j.helpers.MessageFormatter;
|
import org.slf4j.helpers.MessageFormatter;
|
||||||
|
|
||||||
|
import com.windchat.common.command.Command;
|
||||||
|
import com.windchat.common.command.CommandResponse;
|
||||||
|
import com.windchat.common.utils.StringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 封装log,针对网络日志以及数据库操作日志
|
* 封装log,针对网络日志以及数据库操作日志
|
||||||
*
|
*
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2018-01-25 16:13:00
|
* @since 2018-01-25 16:13:00
|
||||||
*/
|
*/
|
||||||
public class LogUtils extends LogCreater {
|
public class LogUtils extends LogCreater {
|
||||||
|
|
||||||
public static void requestInfoLog(Logger logger, Command command, String messagePattern, Object... objects) {
|
public static void requestInfoLog(Logger logger, Command command, String messagePattern, Object... objects) {
|
||||||
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
||||||
logger.info("client={} siteUserId={} action={} msg={}", command.getClientIp(), command.getSiteUserId(),
|
logger.info("client={} siteUserId={} action={} msg={}", command.getClientIp(), command.getSiteUserId(),
|
||||||
command.getAction(), command.toString(), format.getMessage());
|
command.getAction(), command.toString(), format.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void requestWarnLog(Logger logger, Command command, String messagePattern, Object... objects) {
|
public static void requestDebugLog(Logger logger, Command command, String requestStr) {
|
||||||
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
logger.debug("client={} siteUserId={} action={} command={} request={}", command.getClientIp(),
|
||||||
logger.warn("client={} siteUserId={} action={} msg={}", command.getClientIp(), command.getSiteUserId(),
|
command.getSiteUserId(), command.getAction(), command.toString(), requestStr);
|
||||||
command.getAction(), command.toString(), format.getMessage());
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void requestDebugLog(Logger logger, Command command, String requestStr) {
|
public static void requestErrorLog(Logger logger, Command command, Throwable t) {
|
||||||
logger.debug("client={} siteUserId={} action={} command={} request={}", command.getClientIp(),
|
logger.error(StringHelper.format("client={} siteUserId={} action={} uri={} error", command.getClientIp(),
|
||||||
command.getSiteUserId(), command.getAction(), command.toString(), requestStr);
|
command.getSiteUserId(), command.getAction(), command.getUri()), t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void requestErrorLog(Logger logger, Command command, Throwable t) {
|
public static void requestErrorLog(Logger logger, Command command, Class<?> clazz, Throwable t) {
|
||||||
logger.error(StringHelper.format("client={} siteUserId={} action={} uri={} error", command.getClientIp(),
|
logger.error(StringHelper.format("client={} siteUserId={} action={} uri={} {} error", command.getClientIp(),
|
||||||
command.getSiteUserId(), command.getAction(), command.getUri()), t);
|
command.getSiteUserId(), command.getAction(), command.getUri(), clazz.getClass().getName()), t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void requestErrorLog(Logger logger, Command command, Class<?> clazz, Throwable t) {
|
public static void requestResultLog(Logger logger, Command command, CommandResponse response) {
|
||||||
logger.error(StringHelper.format("client={} siteUserId={} action={} uri={} {} error", command.getClientIp(),
|
try {
|
||||||
command.getSiteUserId(), command.getAction(), command.getUri(), clazz.getClass().getName()), t);
|
logger.info("client={} clientVersion={} siteUserId={} action={} uri={} cost={}ms result=[{}]",
|
||||||
}
|
command.getClientIp(), command.getClientVersion(), command.getSiteUserId(), command.getAction(),
|
||||||
|
command.getUri(), System.currentTimeMillis() - command.getStartTime(), response.getErrorCodeInfo());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(StringHelper.format("request result log error command={} response={}", command, response), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void requestResultLog(Logger logger, Command command, CommandResponse response) {
|
public static void dbDebugLog(Logger logger, long startTime, Object result, String sql, Object... objects) {
|
||||||
try {
|
String messagePattern = sql.replace("?", "{}");
|
||||||
logger.info("client={} clientVersion={} siteUserId={} action={} uri={} cost={}ms result=[{}]",
|
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
||||||
command.getClientIp(), command.getClientVersion(), command.getSiteUserId(), command.getAction(),
|
logger.debug("[windchat-db] cost:{}ms result:{} sql:{}", System.currentTimeMillis() - startTime, result,
|
||||||
command.getUri(), System.currentTimeMillis() - command.getStartTime(), response.getErrorCodeInfo());
|
format.getMessage());
|
||||||
} catch (Exception e) {
|
}
|
||||||
logger.error(StringHelper.format("request result log error command={} response={}", command, response), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void dbDebugLog(Logger logger, long startTime, Object result, String sql, Object... objects) {
|
public static void info(org.apache.log4j.Logger logger, String messagePattern, Object object) {
|
||||||
String messagePattern = sql.replace("?", "{}");
|
FormattingTuple format = MessageFormatter.format(messagePattern, object);
|
||||||
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
logger.info(format.getMessage());
|
||||||
logger.debug("[windchat-db] cost:{}ms result:{} sql:{}", System.currentTimeMillis() - startTime, result,
|
}
|
||||||
format.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void info(org.apache.log4j.Logger logger, String messagePattern, Object object) {
|
public static void info(org.apache.log4j.Logger logger, String messagePattern, Object... objects) {
|
||||||
FormattingTuple format = MessageFormatter.format(messagePattern, object);
|
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
||||||
logger.info(format.getMessage());
|
logger.info(format.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void info(org.apache.log4j.Logger logger, String messagePattern, Object... objects) {
|
|
||||||
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
|
|
||||||
logger.info(format.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.netty;
|
package com.windchat.common.netty;
|
||||||
|
|
||||||
|
import com.windchat.common.command.RedisCommand;
|
||||||
import com.windchat.common.command.RedisCommand;
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,10 +26,10 @@ import com.windchat.common.command.RedisCommand;
|
|||||||
*/
|
*/
|
||||||
public interface IRedisCommandResponse {
|
public interface IRedisCommandResponse {
|
||||||
|
|
||||||
RedisCommand getRedisCommand();
|
public RedisCommand getRedisCommand();
|
||||||
|
|
||||||
boolean isSuccess();
|
public boolean isSuccess();
|
||||||
|
|
||||||
String getErrInfo();
|
public String getErrInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,9 +15,17 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.netty;
|
package com.windchat.common.netty;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
import com.windchat.common.netty.codec.MessageDecoder;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.RedisCommand;
|
import com.windchat.common.command.RedisCommand;
|
||||||
import com.windchat.common.netty.codec.MessageDecoder;
|
import com.windchat.common.netty.codec.MessageDecoder;
|
||||||
import com.windchat.common.netty.codec.MessageEncoder;
|
import com.windchat.common.netty.codec.MessageEncoder;
|
||||||
|
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
@ -36,10 +44,6 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||||||
import io.netty.util.concurrent.GlobalEventExecutor;
|
import io.netty.util.concurrent.GlobalEventExecutor;
|
||||||
import io.netty.util.concurrent.Promise;
|
import io.netty.util.concurrent.Promise;
|
||||||
import io.netty.util.concurrent.SucceededFuture;
|
import io.netty.util.concurrent.SucceededFuture;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
@ -89,7 +93,7 @@ public class NettyClient2 {
|
|||||||
this.channelPromise = connectFuture.channel().newPromise();
|
this.channelPromise = connectFuture.channel().newPromise();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("connect to WindChat platform error.", e);
|
logger.error("connect to akaxin platform error.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,14 +15,18 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.netty;
|
package com.windchat.common.netty;
|
||||||
|
|
||||||
import com.akaxin.proto.core.CoreProto;
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.RedisCommand;
|
import com.windchat.common.command.RedisCommand;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.windchat.common.command.Command;
|
||||||
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
import com.akaxin.proto.core.CoreProto;
|
||||||
|
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2018-01-19 18:54:30
|
* @since 2018-01-19 18:54:30
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,14 +15,18 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.netty;
|
package com.windchat.common.netty;
|
||||||
|
|
||||||
import com.akaxin.proto.core.CoreProto;
|
|
||||||
import com.windchat.common.command.Command;
|
import com.windchat.common.command.Command;
|
||||||
import com.windchat.common.command.RedisCommand;
|
import com.windchat.common.command.RedisCommand;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.windchat.common.command.Command;
|
||||||
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
import com.akaxin.proto.core.CoreProto;
|
||||||
|
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
* @since 2018-01-19 18:54:30
|
* @since 2018-01-19 18:54:30
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,10 +15,21 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.netty;
|
package com.windchat.common.netty;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLEngine;
|
||||||
|
|
||||||
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
import com.windchat.common.netty.codec.MessageDecoder;
|
||||||
|
import com.windchat.common.ssl.ZalySSLContext;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.windchat.common.command.RedisCommand;
|
import com.windchat.common.command.RedisCommand;
|
||||||
import com.windchat.common.netty.codec.MessageDecoder;
|
import com.windchat.common.netty.codec.MessageDecoder;
|
||||||
import com.windchat.common.netty.codec.MessageEncoder;
|
import com.windchat.common.netty.codec.MessageEncoder;
|
||||||
import com.windchat.common.ssl.ZalySSLContext;
|
import com.windchat.common.ssl.ZalySSLContext;
|
||||||
|
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
@ -39,11 +50,6 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||||||
import io.netty.util.concurrent.GlobalEventExecutor;
|
import io.netty.util.concurrent.GlobalEventExecutor;
|
||||||
import io.netty.util.concurrent.Promise;
|
import io.netty.util.concurrent.Promise;
|
||||||
import io.netty.util.concurrent.SucceededFuture;
|
import io.netty.util.concurrent.SucceededFuture;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.net.ssl.SSLEngine;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sam{@link an.guoyue254@gmail.com}
|
* @author Sam{@link an.guoyue254@gmail.com}
|
||||||
@ -104,7 +110,7 @@ public class PlatformSSLClient {
|
|||||||
this.channelPromise = connectFuture.channel().newPromise();
|
this.channelPromise = connectFuture.channel().newPromise();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("connect to WindChat platform error.", e);
|
logger.error("connect to akaxin platform error.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,17 +15,20 @@
|
|||||||
*/
|
*/
|
||||||
package com.windchat.common.netty.codec;
|
package com.windchat.common.netty.codec;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import com.windchat.common.command.RedisCommand;
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.windchat.common.command.RedisCommand;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.ChannelPromise;
|
||||||
import io.netty.handler.codec.MessageToByteEncoder;
|
import io.netty.handler.codec.MessageToByteEncoder;
|
||||||
import io.netty.util.concurrent.Future;
|
import io.netty.util.concurrent.Future;
|
||||||
import io.netty.util.concurrent.GenericFutureListener;
|
import io.netty.util.concurrent.GenericFutureListener;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码器
|
* 编码器
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
* <p>
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
* <p>
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -30,6 +30,6 @@ import io.netty.channel.Channel;
|
|||||||
*/
|
*/
|
||||||
public interface IProtocolParser {
|
public interface IProtocolParser {
|
||||||
|
|
||||||
void readAndOut(Channel ch, ByteBuf inByte, List<Object> out, MessageDecoder decoder) throws Exception;
|
public void readAndOut(Channel ch, ByteBuf inByte, List<Object> out, MessageDecoder decoder) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -32,6 +32,8 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||||||
*
|
*
|
||||||
* @author Sam
|
* @author Sam
|
||||||
* @since 2017.10.19
|
* @since 2017.10.19
|
||||||
|
*
|
||||||
|
* @param <Command>
|
||||||
*/
|
*/
|
||||||
public class WSRequestHandler extends AbstractCommonHandler<Command, CommandResponse> {
|
public class WSRequestHandler extends AbstractCommonHandler<Command, CommandResponse> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(WSRequestHandler.class);
|
private static final Logger logger = LoggerFactory.getLogger(WSRequestHandler.class);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2018-2028 WindChat Group
|
* Copyright 2018-2028 Akaxin Group
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user