feat: update

This commit is contained in:
librena 2020-10-21 23:35:02 +08:00
parent 3e74e05075
commit d0e6f04466
126 changed files with 1878 additions and 1825 deletions

0
0 Normal file
View File

View File

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

View File

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

View File

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

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

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

View File

@ -1,15 +1,18 @@
package com.windchat.im.business.bean;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* customized annotation
*
* @author Librena
* @since 2020-10-20
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Documented
public @interface WindChatActions {
public @interface ApiActions {
String action();

View File

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

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

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

View File

@ -1,12 +1,12 @@
/**
* Copyright 2018-2028 Akaxin Group
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.

View File

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

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 Akaxin Group
* 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.
@ -15,10 +15,14 @@
*/
package com.windchat.im.business.impl;
import java.lang.reflect.Method;
import com.windchat.im.business.dao.UserGroupDao;
import com.windchat.im.business.dao.UserProfileDao;
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 com.windchat.im.business.dao.UserGroupDao;
import com.windchat.im.business.dao.UserProfileDao;
import com.windchat.im.storage.bean.GroupProfileBean;
@ -27,62 +31,76 @@ 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 java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
/**
*
* @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);
private static final Logger logger = LoggerFactory.getLogger(AbstractRequest.class);
public CommandResponse execute(Command command) {
return executeMethodByReflect(command);
}
Cache<String, Method> cache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterWrite(10, TimeUnit.MINUTES).build();
private CommandResponse executeMethodByReflect(Command 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);
}
public CommandResponse execute(Command command) {
return executeMethodByReflect(command);
}
if (response == null) {
response = new CommandResponse().setVersion(CommandConst.PROTOCOL_VERSION)
.setAction(CommandConst.ACTION_RES).setErrCode2(errCode);
}
return response;
}
private CommandResponse executeMethodByReflect(Command command) {
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);
}
} catch (Exception e) {
LogUtils.requestErrorLog(logger, command, e);
}
//检查请求的参数中的siteUserId是否是存在的
public boolean checkUserIdLegal(String siteUserId) {
if (StringUtils.isNotEmpty(siteUserId)) {
SimpleUserBean userProfile = UserProfileDao.getInstance().getSimpleProfileById(siteUserId);
if (userProfile != null && StringUtils.isNotEmpty(userProfile.getSiteUserId())) {
return true;
}
}
return false;
}
if (response == null) {
response = new CommandResponse().setVersion(CommandConst.PROTOCOL_VERSION)
.setAction(CommandConst.ACTION_RES).setErrCode2(errCode);
}
return response;
}
//检查请求的参数中的groupId是否是存在的
public boolean checkGroupIdLegal(String groupId) {
if (StringUtils.isNotEmpty(groupId)) {
GroupProfileBean groupProfile = UserGroupDao.getInstance().getSimpleGroupBeanById(groupId);
if (groupProfile != null) {
return true;
}
}
return false;
}
//检查请求的参数中的siteUserId是否是存在的
public boolean checkUserIdLegal(String siteUserId) {
if (StringUtils.isNotEmpty(siteUserId)) {
SimpleUserBean userProfile = UserProfileDao.getInstance().getSimpleProfileById(siteUserId);
if (userProfile != null && StringUtils.isNotEmpty(userProfile.getSiteUserId())) {
return true;
}
}
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;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 Akaxin Group
* 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.
@ -15,23 +15,20 @@
*/
package com.windchat.im.business.impl.site;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
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 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 java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 管理站点配置相关信息

View File

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

View File

@ -1,5 +1,5 @@
/**
* Copyright 2018-2028 Akaxin Group
* 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.
@ -15,25 +15,23 @@
*/
package com.windchat.im.business.impl.tai;
import java.util.List;
import com.windchat.im.business.dao.UserDeviceDao;
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.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.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.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;
/**
*
@ -41,9 +39,11 @@ import com.windchat.im.storage.bean.UserDeviceBean;
* @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,6 +76,7 @@ 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;
@ -116,6 +117,7 @@ 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,23 +15,21 @@
*/
package com.windchat.im.business.impl.tai;
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.akaxin.proto.core.FileProto;
import com.akaxin.proto.site.ApiFileDownloadProto;
import com.akaxin.proto.site.ApiFileUploadProto;
import com.google.protobuf.ByteString;
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.FileProto;
import com.akaxin.proto.site.ApiFileDownloadProto;
import com.akaxin.proto.site.ApiFileUploadProto;
import com.windchat.im.business.bean.ApiActions;
import com.windchat.im.business.impl.AbstractRequest;
import com.windchat.im.business.utils.FilePathUtils;
import com.windchat.im.business.utils.FileServerUtils;
import com.google.protobuf.ByteString;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 文件图片语音上传下载
@ -39,9 +37,11 @@ import com.google.protobuf.ByteString;
* @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,6 +66,7 @@ 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 Akaxin Group
* 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.
@ -15,23 +15,6 @@
*/
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;
@ -45,6 +28,15 @@ 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;
@ -55,6 +47,11 @@ 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>
@ -73,6 +70,7 @@ import com.windchat.im.storage.bean.UserFriendBean;
* @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);
@ -82,6 +80,7 @@ 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;
@ -156,6 +155,7 @@ 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,6 +210,7 @@ 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;
@ -270,6 +271,7 @@ 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;
@ -309,6 +311,7 @@ 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;
@ -336,6 +339,7 @@ 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;
@ -382,6 +386,7 @@ 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;
@ -413,6 +418,7 @@ 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;
@ -451,6 +457,7 @@ 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;
@ -488,6 +495,7 @@ 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;
@ -520,6 +528,7 @@ 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;
@ -548,6 +557,13 @@ 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 Akaxin Group
* 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.
@ -15,18 +15,12 @@
*/
package com.windchat.im.business.impl.tai;
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.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 com.windchat.common.command.Command;
import com.windchat.common.command.CommandResponse;
import com.windchat.common.constant.CharsetCoding;
@ -37,16 +31,18 @@ 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.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.bean.ApiActions;
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 com.google.protobuf.ByteString;
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;
/**
* 处理客户端与服务点扩展之间功能
@ -54,6 +50,7 @@ import com.google.protobuf.ByteString;
* @author Sam{@link an.guoyue254@gmail.com}
* @since 2017-12-11 14:46:28
*/