Compare commits

..

No commits in common. "master" and "develop" have entirely different histories.

129 changed files with 1910 additions and 1937 deletions

0
0
View File

View File

@ -2,7 +2,7 @@
[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)
@ -17,7 +17,7 @@
简介
----
WindChat 是一款开源免费私有IM聊天软件由核心开发者SAM2O2O等维护主要面向企业定制IM开源、免费。
WindChat 是一款开源免费私有IM聊天软件原身是Akaxin即时通讯开源软件由原开发者SAM2O2O个人维护主要面向企业定制IM,全端开源,免费。
特性:
@ -85,10 +85,13 @@ WindChat Team版本 命令:
**2. 下载客户端**
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 暂未开源预计2020-06-14 开源
**3. 访问站点**
@ -117,7 +120,6 @@ iOS 客户端:
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
@ -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>

View File

@ -31,9 +31,9 @@
<gson_version>2.8.2</gson_version>
<fastjson_version>1.2.31</fastjson_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>
<mysql.version>8.0.16</mysql.version>
<mysql.version>8.0.11</mysql.version>
</properties>
<build>

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* Copyright 2018-2028 Akaxin Group
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* Copyright 2018-2028 Akaxin Group
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* Copyright 2018-2028 Akaxin Group
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View 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

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
#
# Copyright 2018-2028 WindChat Group
# 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.

View File

@ -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();
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -22,9 +22,9 @@ package com.windchat.im.business.constant;
* @since 2017-12-28 14:38:15
*/
public interface NoticeText {
String USER_ADD_FRIEND = "我通过了你的好友验证,现在可以开始聊天了";
String USER_ADD_GROUP = " 加入了群聊";
public String USER_ADD_FRIEND = "我通过了你的好友验证,现在可以开始聊天了";
public String USER_ADD_GROUP = " 加入了群聊";
String USER_ADD_GROUP_QR_CODE = " 通过群组二维码加入群聊";
public String USER_ADD_GROUP_QR_CODE = " 通过群组二维码加入群聊";
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,14 +15,10 @@
*/
package com.windchat.im.business.impl;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
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.logs.LogUtils;
import com.windchat.im.business.bean.ApiActions;
import java.lang.reflect.Method;
import com.windchat.im.business.dao.UserGroupDao;
import com.windchat.im.business.dao.UserProfileDao;
import com.windchat.im.business.dao.UserGroupDao;
import com.windchat.im.business.dao.UserProfileDao;
import com.windchat.im.storage.bean.GroupProfileBean;
@ -31,18 +27,20 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
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.logs.LogUtils;
/**
*
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2018-01-31 12:20:14
*/
public abstract class AbstractRequest implements IRequestService {
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);
}
@ -51,25 +49,9 @@ public abstract class AbstractRequest implements IRequestService {
CommandResponse response = null;
ErrorCode2 errCode = ErrorCode2.ERROR;
try {
Method actionMethod = cache.getIfPresent(command.getAction());
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);
}
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);
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,21 +15,24 @@
*/
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.HashSet;
import java.util.List;
import java.util.Map;
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;
/**
* 管理站点配置相关信息
*

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,23 +15,25 @@
*/
package com.windchat.im.business.impl.tai;
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.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 java.util.List;
import com.windchat.im.business.dao.UserDeviceDao;
import com.windchat.im.business.impl.AbstractRequest;
import com.windchat.im.storage.bean.UserDeviceBean;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
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
*
*/
@ApiActions(action = "api.device")
public class ApiDeviceService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiDeviceService.class);
@ApiActions(action = ".profile")
public CommandResponse profile(Command command) {
CommandResponse commandResponse = new CommandResponse();
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -76,7 +76,6 @@ public class ApiDeviceService extends AbstractRequest {
return commandResponse.setErrCode2(errCode);
}
@ApiActions(action = ".list")
public CommandResponse list(Command command) {
CommandResponse commandResponse = new CommandResponse();
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -117,7 +116,6 @@ public class ApiDeviceService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".boundList")
public CommandResponse boundList(Command command) {
CommandResponse commandResponse = new CommandResponse();
ErrorCode2 errCode = ErrorCode2.ERROR;

View File

@ -15,21 +15,23 @@
*/
package com.windchat.im.business.impl.tai;
import com.akaxin.proto.core.FileProto;
import com.akaxin.proto.site.ApiFileDownloadProto;
import com.akaxin.proto.site.ApiFileUploadProto;
import com.google.protobuf.ByteString;
import com.windchat.im.business.impl.AbstractRequest;
import com.windchat.im.business.utils.FilePathUtils;
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.ErrorCode2;
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.utils.FilePathUtils;
import com.windchat.im.business.utils.FileServerUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.protobuf.ByteString;
/**
* 文件图片语音上传下载
@ -37,11 +39,9 @@ import org.slf4j.LoggerFactory;
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2018-01-25 17:52:08
*/
@ApiActions(action = "api.file")
public class ApiFileService extends AbstractRequest {
private static Logger logger = LoggerFactory.getLogger(ApiFileService.class);
@ApiActions(action = ".upload")
public CommandResponse upload(Command command) {
CommandResponse commandResponse = new CommandResponse();
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -66,7 +66,6 @@ public class ApiFileService extends AbstractRequest {
return commandResponse.setErrCode2(errCode);
}
@ApiActions(action = ".download")
public CommandResponse download(Command command) {
CommandResponse commandResponse = new CommandResponse();
ErrorCode2 errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,6 +15,23 @@
*/
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.site.ApiFriendApplyCountProto;
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.ApiFriendUpdateMuteProto;
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.UserProfileDao;
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.SimpleUserBean;
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>
@ -70,7 +73,6 @@ import java.util.List;
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2017.11.24 18:36:59
*/
@ApiActions(action = "api.friend")
public class ApiFriendService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiFriendService.class);
@ -80,7 +82,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".profile")
public CommandResponse profile(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -155,7 +156,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".list")
public CommandResponse list(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -210,7 +210,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".apply")
public CommandResponse apply(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -271,7 +270,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".applyList")
public CommandResponse applyList(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -311,7 +309,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".applyCount")
public CommandResponse applyCount(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -339,7 +336,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".applyResult")
public CommandResponse applyResult(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -386,7 +382,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".delete")
public CommandResponse delete(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -418,7 +413,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".setting")
public CommandResponse setting(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -457,7 +451,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".updateSetting")
public CommandResponse updateSetting(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -495,7 +488,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".mute")
public CommandResponse mute(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -528,7 +520,6 @@ public class ApiFriendService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".updateMute")
public CommandResponse updateMute(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -557,13 +548,6 @@ public class ApiFriendService extends AbstractRequest {
return commandResponse.setErrCode2(errCode);
}
/**
* 设置好友备注
*
* @param command
* @return
*/
@ApiActions(action =".remark")
public CommandResponse remark(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,6 +15,26 @@
*/
package com.windchat.im.business.impl.tai;
import java.util.List;
import java.util.UUID;
import com.windchat.im.business.constant.GroupConfig;
import com.windchat.im.business.dao.ExpireTokenDao;
import com.windchat.im.business.dao.UserGroupDao;
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.ZalyException;
import com.windchat.common.exceptions.ZalyException2;
import com.windchat.common.logs.LogUtils;
import com.akaxin.proto.core.GroupProto;
import com.akaxin.proto.core.TokenProto;
import com.akaxin.proto.core.UserProto;
@ -33,18 +53,6 @@ import com.akaxin.proto.site.ApiGroupRemoveMemberProto;
import com.akaxin.proto.site.ApiGroupSettingProto;
import com.akaxin.proto.site.ApiGroupUpdateProfileProto;
import com.akaxin.proto.site.ApiGroupUpdateSettingProto;
import com.google.common.collect.Lists;
import com.google.protobuf.ProtocolStringList;
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.ZalyException;
import com.windchat.common.exceptions.ZalyException2;
import com.windchat.common.exceptions.ZalyWarning;
import com.windchat.common.logs.LogUtils;
import com.windchat.im.business.bean.ApiActions;
import com.windchat.im.business.constant.GroupConfig;
import com.windchat.im.business.dao.ExpireTokenDao;
import com.windchat.im.business.dao.UserGroupDao;
@ -57,12 +65,8 @@ import com.windchat.im.storage.bean.GroupProfileBean;
import com.windchat.im.storage.bean.SimpleGroupBean;
import com.windchat.im.storage.bean.SimpleUserBean;
import com.windchat.im.storage.bean.UserGroupBean;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.UUID;
import com.google.common.collect.Lists;
import com.google.protobuf.ProtocolStringList;
/**
* 扩展服务器与站点之间通过hai接口管理群组功能
@ -70,7 +74,6 @@ import java.util.UUID;
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2018-01-13 21:48:35
*/
@ApiActions(action = "api.group")
public class ApiGroupService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiGroupService.class);
@ -81,7 +84,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".list")
public CommandResponse list(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -127,7 +129,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".create")
public CommandResponse create(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -160,7 +161,7 @@ public class ApiGroupService extends AbstractRequest {
}
if (groupMemberIds.size() < 3) {
throw new ZalyWarning(ErrorCode2.ERROR_GROUP_MEMBERLESS3);
throw new ZalyException(ErrorCode2.ERROR_GROUP_MEMBERLESS3);
}
GroupProfileBean groupBean = UserGroupDao.getInstance().createGroup(siteUserId, groupName, groupMemberIds);
@ -183,16 +184,12 @@ public class ApiGroupService extends AbstractRequest {
}
} catch (Exception e) {
if (e instanceof ZalyWarning) {
errCode = ((ZalyWarning) e).getErrCode();
LogUtils.requestWarnLog(logger, command, errCode.getInfo());
} else if (e instanceof ZalyException) {
if (e instanceof ZalyException) {
errCode = ((ZalyException) e).getErrCode();
LogUtils.requestErrorLog(logger, command, e);
} else {
errCode = ErrorCode2.ERROR_SYSTEMERROR;
LogUtils.requestErrorLog(logger, command, e);
}
LogUtils.requestErrorLog(logger, command, e);
}
return commandResponse.setErrCode(errCode);
}
@ -206,7 +203,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".delete")
public CommandResponse delete(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -255,7 +251,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".profile")
public CommandResponse profile(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -338,7 +333,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".updateProfile")
public CommandResponse updateProfile(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -406,7 +400,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".addMember")
public CommandResponse addMember(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -482,7 +475,6 @@ public class ApiGroupService extends AbstractRequest {
return false;
}
@ApiActions(action = ".removeMember")
public CommandResponse removeMember(Command command) {
return deleteMember(command);
}
@ -494,7 +486,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".deleteMember")
public CommandResponse deleteMember(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -541,7 +532,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".quit")
public CommandResponse quit(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -573,7 +563,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".members")
public CommandResponse members(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -627,7 +616,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".nonMembers")
public CommandResponse nonMembers(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -683,7 +671,6 @@ public class ApiGroupService extends AbstractRequest {
* @return
*/
@Deprecated
@ApiActions(action = ".setting")
public CommandResponse setting(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -722,7 +709,6 @@ public class ApiGroupService extends AbstractRequest {
* @return
*/
@Deprecated
@ApiActions(action = ".updateSetting")
public CommandResponse updateSetting(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -754,13 +740,6 @@ public class ApiGroupService extends AbstractRequest {
return commandResponse.setErrCode(errCode);
}
/**
* 获取群静音状态
*
* @param command
* @return
*/
@ApiActions(action = ".mute")
public CommandResponse mute(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -801,12 +780,11 @@ public class ApiGroupService extends AbstractRequest {
}
/**
* 设置群静音状态
* 个人更新群设置信息
*
* @param command
* @return
*/
@ApiActions(action = ".updateMute")
public CommandResponse updateMute(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -857,7 +835,6 @@ public class ApiGroupService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".applyToken")
public CommandResponse applyToken(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -916,13 +893,6 @@ public class ApiGroupService extends AbstractRequest {
return commandResponse.setErrCode(errCode);
}
/**
* 通过扫二维码入群
*
* @param command
* @return
*/
@ApiActions(action = ".joinByToken")
public CommandResponse joinByToken(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,12 +15,18 @@
*/
package com.windchat.im.business.impl.tai;
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.google.protobuf.ByteString;
import java.util.Base64;
import java.util.List;
import java.util.Map;
//import org.apache.commons.codec.binary.Base64;
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.CommandResponse;
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.http.ZalyHttpClient;
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.impl.AbstractRequest;
import com.windchat.im.business.impl.site.SiteConfig;
import com.windchat.im.storage.bean.PluginBean;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import com.google.protobuf.ByteString;
/**
* 处理客户端与服务点扩展之间功能
@ -50,7 +54,6 @@ import java.util.Map;
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2017-12-11 14:46:28
*/
@ApiActions(action = "api.plugin")
public class ApiPluginService extends AbstractRequest {
private static Logger logger = LoggerFactory.getLogger(ApiPluginService.class);
private static final String HTTP_PREFFIX = "http://";
@ -62,7 +65,6 @@ public class ApiPluginService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".list")
public CommandResponse list(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -132,7 +134,6 @@ public class ApiPluginService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".page")
public CommandResponse page(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -208,7 +209,6 @@ public class ApiPluginService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".proxy")
public CommandResponse proxy(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,23 +15,24 @@
*/
package com.windchat.im.business.impl.tai;
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 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.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.site.SiteConfig;
import com.windchat.im.storage.api.IUserDeviceDao;
import com.windchat.im.storage.bean.UserDeviceBean;
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}
* @since 2017.10.20
*/
@ApiActions(action = "api.secretChat")
public class ApiSecretChatService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiSecretChatService.class);
private IUserDeviceDao userDeviceDao = new DeviceDaoService();
@ -50,7 +50,6 @@ public class ApiSecretChatService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".applyU2")
public CommandResponse applyU2(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* Copyright 2018-2028 Akaxin Group
* <p>
* Licensed under the Apache License, Version 2.0 (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;
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 java.security.PublicKey;
import java.security.Signature;
import java.util.Base64;
import java.util.Map;
import java.util.Set;
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.CommandResponse;
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.utils.StringHelper;
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.dao.SiteConfigDao;
import com.windchat.im.business.dao.SiteLoginDao;
@ -51,25 +64,14 @@ import com.windchat.im.storage.bean.UserDeviceBean;
import com.windchat.im.storage.bean.UserProfileBean;
import com.windchat.im.storage.bean.UserSessionBean;
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}
* @since 2017-10-17 18:14:10
*/
@ApiActions(action = "api.site")
public class ApiSiteService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiSiteService.class);
@ -77,12 +79,14 @@ public class ApiSiteService extends AbstractRequest {
private IUserDeviceDao userDeviceDao = new DeviceDaoService();
/**
* <pre>
* api.site.config
* 获取站点配置信息
* </pre>
*
* @param command
* @return
*/
@ApiActions(action = ".config")
public CommandResponse config(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -134,13 +138,6 @@ public class ApiSiteService extends AbstractRequest {
return commandResponse.setErrCode2(errCode);
}
/**
* 注册站点账户
*
* @param command
* @return
*/
@ApiActions(action = ".register")
public CommandResponse register(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -296,12 +293,11 @@ public class ApiSiteService extends AbstractRequest {
}
/**
* 执行用户登录站点行为
* 执行用户登陆站点行为
*
* @param command
* @return
*/
@ApiActions(action = ".login")
public CommandResponse login(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,12 +15,16 @@
*/
package com.windchat.im.business.impl.tai;
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 java.util.regex.Matcher;
import java.util.regex.Pattern;
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;
@ -30,18 +34,17 @@ import com.windchat.common.exceptions.ZalyException2;
import com.windchat.common.logs.LogUtils;
import com.windchat.common.utils.StringHelper;
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.UserProfileDao;
import com.windchat.im.business.impl.AbstractRequest;
import com.windchat.im.storage.bean.UserFriendBean;
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}
* @since 2017.11.25 15:10:36
*/
@ApiActions(action = "api.user")
public class ApiUserService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiUserService.class);
@ -59,7 +61,6 @@ public class ApiUserService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".search")
public CommandResponse search(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -149,7 +150,6 @@ public class ApiUserService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".profile")
public CommandResponse profile(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errorCode = ErrorCode2.ERROR;
@ -206,7 +206,6 @@ public class ApiUserService extends AbstractRequest {
* @param command
* @return
*/
@ApiActions(action = ".updateProfile")
public CommandResponse updateProfile(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;
@ -272,13 +271,6 @@ public class ApiUserService extends AbstractRequest {
return commandResponse.setErrCode(errCode);
}
/**
* 获取消息免打扰状态
*
* @param command
* @return
*/
@ApiActions(action = ".mute")
public CommandResponse mute(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;
@ -298,13 +290,6 @@ public class ApiUserService extends AbstractRequest {
return commandResponse.setErrCode2(errCode);
}
/**
* 设置消息免打扰状态
*
* @param command
* @return
*/
@ApiActions(action = ".updateMute")
public CommandResponse updateMute(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
ErrorCode2 errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,7 +15,11 @@
*/
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.CommandResponse;
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.exceptions.ZalyException;
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.impl.AbstractRequest;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* webim服务
@ -36,11 +37,9 @@ import org.slf4j.LoggerFactory;
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2017.11.25 15:10:36
*/
@ApiActions(action = "api.web")
public class ApiWebService extends AbstractRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiWebService.class);
@ApiActions(action = ".auth")
public CommandResponse auth(Command command) {
CommandResponse commandResponse = new CommandResponse().setAction(CommandConst.ACTION_RES);
IErrorCode errCode = ErrorCode2.ERROR;

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,28 +15,30 @@
*/
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.CommandResponse;
import com.windchat.common.constant.CommandConst;
import com.windchat.common.constant.ErrorCode2;
import com.windchat.common.utils.StringHelper;
import com.windchat.im.business.api.IRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* API处理业务逻辑
*
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2017.10.16
*
*/
public class ApiRequestService implements IRequest {
private static final Logger logger = LoggerFactory.getLogger(ApiRequestService.class);
public CommandResponse process(Command command) {
try {
String action = command.getRety() + "." + command.getService();
return ApiServiceFactory.getService(action).execute(command);
return ApiServiceFactory.getService(command.getService()).execute(command);
} catch (Exception e) {
logger.error(StringHelper.format("api request service error.command={}", command), e);
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,7 +15,10 @@
*/
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.tai.ApiDeviceService;
import com.windchat.im.business.impl.tai.ApiFileService;
@ -25,13 +28,6 @@ import com.windchat.im.business.impl.tai.ApiPluginService;
import com.windchat.im.business.impl.tai.ApiSecretChatService;
import com.windchat.im.business.impl.tai.ApiSiteService;
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业务请求分发工厂
@ -42,33 +38,30 @@ import java.util.Map;
public class ApiServiceFactory {
private static final Logger logger = LoggerFactory.getLogger(ApiServiceFactory.class);
private static Map<String, IRequestService> serviceMap = new LinkedHashMap<String, IRequestService>();
private static List<IRequestService> serviceList = new LinkedList<IRequestService>();
static {
serviceList.add(new ApiSiteService());
serviceList.add(new ApiUserService());
serviceList.add(new ApiFriendService());
serviceList.add(new ApiGroupService());
serviceList.add(new ApiSecretChatService());
serviceList.add(new ApiFileService());
serviceList.add(new ApiDeviceService());
serviceList.add(new ApiPluginService());
init();
public static IRequestService getService(String serviceName) {
RequestAction nameEnum = RequestAction.getAction(serviceName);
switch (nameEnum) {
case SITE:
return new ApiSiteService();
case API_USER:
return new ApiUserService();
case API_FRIEND:
return new ApiFriendService();
case API_GROUP:
return new ApiGroupService();
case API_SECRETCHAT:
return new ApiSecretChatService();
case API_FILE:
return new ApiFileService();
case API_DEVICE:
return new ApiDeviceService();
case API_PLUGIN:
return new ApiPluginService();
default:
logger.error("api business service error.service={}", nameEnum.getName());
break;
}
private static void init() {
for (IRequestService requestService : serviceList) {
ApiActions serviceApiAction = requestService.getClass().getDeclaredAnnotation(ApiActions.class);
if (serviceApiAction != null) {
serviceMap.put(serviceApiAction.action(), requestService);
}
}
}
public static IRequestService getService(String serviceAction) {
return serviceMap.get(serviceAction);
return null;
}
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,6 +15,10 @@
*/
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.CommandResponse;
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.HttpSiteService;
import com.windchat.im.business.impl.hai.HttpUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Http请求服务分发

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,14 +15,18 @@
*/
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.constant.CommandConst;
import com.windchat.common.utils.StringHelper;
import io.netty.channel.ChannelHandlerContext;
import org.apache.commons.lang3.StringUtils;
import java.util.HashMap;
import java.util.Map;
import io.netty.channel.ChannelHandlerContext;
/**
* 处理完成后的消息载体

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -16,11 +16,11 @@
package com.windchat.common.constant;
public interface IErrorCode {
String getCode();
public String getCode();
String getInfo();
public String getInfo();
boolean isSuccess();
public boolean isSuccess();
String toString();
public String toString();
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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;
}
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -22,6 +22,10 @@ import org.slf4j.Logger;
import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;
import com.windchat.common.command.Command;
import com.windchat.common.command.CommandResponse;
import com.windchat.common.utils.StringHelper;
/**
* 封装log针对网络日志以及数据库操作日志
*
@ -37,13 +41,6 @@ public class LogUtils extends LogCreater {
return;
}
public static void requestWarnLog(Logger logger, Command command, String messagePattern, Object... objects) {
FormattingTuple format = MessageFormatter.arrayFormat(messagePattern, objects);
logger.warn("client={} siteUserId={} action={} msg={}", command.getClientIp(), command.getSiteUserId(),
command.getAction(), command.toString(), format.getMessage());
return;
}
public static void requestDebugLog(Logger logger, Command command, String requestStr) {
logger.debug("client={} siteUserId={} action={} command={} request={}", command.getClientIp(),
command.getSiteUserId(), command.getAction(), command.toString(), requestStr);

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,6 +15,7 @@
*/
package com.windchat.common.netty;
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 {
RedisCommand getRedisCommand();
public RedisCommand getRedisCommand();
boolean isSuccess();
public boolean isSuccess();
String getErrInfo();
public String getErrInfo();
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,9 +15,17 @@
*/
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.netty.codec.MessageDecoder;
import com.windchat.common.netty.codec.MessageEncoder;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
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.Promise;
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}
@ -89,7 +93,7 @@ public class NettyClient2 {
this.channelPromise = connectFuture.channel().newPromise();
} catch (Exception e) {
logger.error("connect to WindChat platform error.", e);
logger.error("connect to akaxin platform error.", e);
}
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,14 +15,18 @@
*/
package com.windchat.common.netty;
import com.akaxin.proto.core.CoreProto;
import com.windchat.common.command.Command;
import com.windchat.common.command.RedisCommand;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
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}
* @since 2018-01-19 18:54:30

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,14 +15,18 @@
*/
package com.windchat.common.netty;
import com.akaxin.proto.core.CoreProto;
import com.windchat.common.command.Command;
import com.windchat.common.command.RedisCommand;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
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}
* @since 2018-01-19 18:54:30

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,10 +15,21 @@
*/
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.netty.codec.MessageDecoder;
import com.windchat.common.netty.codec.MessageEncoder;
import com.windchat.common.ssl.ZalySSLContext;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
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.Promise;
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}
@ -104,7 +110,7 @@ public class PlatformSSLClient {
this.channelPromise = connectFuture.channel().newPromise();
} catch (Exception e) {
logger.error("connect to WindChat platform error.", e);
logger.error("connect to akaxin platform error.", e);
}
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -15,17 +15,20 @@
*/
package com.windchat.common.netty.codec;
import java.nio.ByteBuffer;
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.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
/**
* 编码器

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -30,6 +30,6 @@ import io.netty.channel.Channel;
*/
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;
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.
@ -32,6 +32,8 @@ import io.netty.util.concurrent.GenericFutureListener;
*
* @author Sam
* @since 2017.10.19
*
* @param <Command>
*/
public class WSRequestHandler extends AbstractCommonHandler<Command, CommandResponse> {
private static final Logger logger = LoggerFactory.getLogger(WSRequestHandler.class);

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 WindChat Group
* 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.

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