/** * 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.
*/
package com.akaxin.site.web.admin.service.impl;
import java.io.File;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import com.akaxin.site.business.dao.UserGroupDao;
import com.akaxin.site.business.dao.UserProfileDao;
import com.akaxin.site.business.impl.site.SiteConfig;
import com.akaxin.site.business.utils.FilePathUtils;
import com.windchat.im.storage.api.IGroupDao;
import com.windchat.im.storage.api.IMessageDao;
import com.windchat.im.storage.api.IUserDeviceDao;
import com.windchat.im.storage.api.IUserFriendDao;
import com.windchat.im.storage.api.IUserProfileDao;
import com.windchat.im.storage.api.IUserSessionDao;
import com.windchat.im.storage.bean.SimpleGroupBean;
import com.windchat.im.storage.bean.SimpleUserBean;
import com.windchat.im.storage.bean.UserDeviceBean;
import com.windchat.im.storage.bean.UserProfileBean;
import com.windchat.im.storage.service.DeviceDaoService;
import com.windchat.im.storage.service.GroupDaoService;
import com.windchat.im.storage.service.MessageDaoService;
import com.windchat.im.storage.service.UserFriendDaoService;
import com.windchat.im.storage.service.UserProfileDaoService;
import com.windchat.im.storage.service.UserSessionDaoService;
import com.akaxin.site.web.admin.service.IUserService;
@Service("userManageService")
public class UserManageService implements IUserService {
private IMessageDao messageDao = new MessageDaoService();
private IUserFriendDao friendDao = new UserFriendDaoService();
private IGroupDao groupDao = new GroupDaoService();
private IUserProfileDao profileDao = new UserProfileDaoService();
private IUserDeviceDao deviceDao = new DeviceDaoService();
private IUserSessionDao sessionDao = new UserSessionDaoService();
private static final Logger logger = LoggerFactory.getLogger(UserManageService.class);
@Override
public UserProfileBean getUserProfile(String siteUserId) {
UserProfileBean bean = UserProfileDao.getInstance().getUserProfileById(siteUserId);
bean.setDefaultState(isUserDefaultFriend(bean.getSiteUserId()) ? 1 : 0);
return bean;
}
private boolean isUserDefaultFriend(String siteUserId) {
Set