Search in sources :

Example 6 with UserGroupBean

use of com.akaxin.site.storage.bean.UserGroupBean in project openzaly by akaxincom.

the class SQLiteUserGroupDao method getUserGroupSetting.

public UserGroupBean getUserGroupSetting(String siteUserId, String siteGroupId) throws SQLException {
    long startTime = System.currentTimeMillis();
    String sql = "SELECT mute FROM " + USER_GROUP_TABLE + " WHERE site_user_id=? AND site_group_id=?;";
    PreparedStatement preStatement = SQLiteJDBCManager.getConnection().prepareStatement(sql);
    preStatement.setString(1, siteUserId);
    preStatement.setString(2, siteGroupId);
    ResultSet rs = preStatement.executeQuery();
    UserGroupBean bean = null;
    if (rs.next()) {
        bean = new UserGroupBean();
        bean.setMute(rs.getBoolean(1));
        bean.setSiteGroupId(siteGroupId);
    }
    LogUtils.dbDebugLog(logger, startTime, bean, sql, siteUserId, siteGroupId);
    return bean;
}
Also used : UserGroupBean(com.akaxin.site.storage.bean.UserGroupBean) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement)

Aggregations

UserGroupBean (com.akaxin.site.storage.bean.UserGroupBean)6 CommandResponse (com.akaxin.common.command.CommandResponse)4 ErrorCode2 (com.akaxin.common.constant.ErrorCode2)4 ApiGroupSettingProto (com.akaxin.proto.site.ApiGroupSettingProto)2 ApiGroupUpdateSettingProto (com.akaxin.proto.site.ApiGroupUpdateSettingProto)2 ApiGroupMuteProto (com.akaxin.proto.site.ApiGroupMuteProto)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1