/** * 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.windchat.im.business.dao;
import java.sql.SQLException;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.akaxin.proto.core.PluginProto;
import com.windchat.im.storage.api.IPluginDao;
import com.windchat.im.storage.bean.PluginBean;
import com.windchat.im.storage.service.PluginServiceDao;
public class SitePluginDao {
private static final Logger logger = LoggerFactory.getLogger(SitePluginDao.class);
private IPluginDao pluginDao = new PluginServiceDao();
private static SitePluginDao instance = new SitePluginDao();
public static SitePluginDao getInstance() {
return instance;
}
/**
* 新增扩展
*
* @param bean
* @return
*/
public boolean addPlugin(PluginBean bean) {
try {
return pluginDao.addPlugin(bean);
} catch (SQLException e) {
logger.error("add plugin error.", e);
}
return false;
}
/**
* 删除扩展
*
* @param pluginId
* @return
*/
public boolean deletePlugin(int pluginId) {
try {
return pluginDao.deletePlugin(pluginId);
} catch (SQLException e) {
logger.error("delete plugin error.", e);
}
return false;
}
public boolean updatePlugin(PluginBean bean) {
try {
return pluginDao.updatePlugin(bean);
} catch (SQLException e) {
logger.error("update plugin error.", e);
}
return false;
}
/**
* 获取管理员的扩展列表
*
* @param pageNum
* @param pageSize
* @param position
* @return
*/
public List