Java Code Examples for com.akaxin.proto.plugin.HaiGroupProfileProto

The following examples show how to use com.akaxin.proto.plugin.HaiGroupProfileProto. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: wind-im   Source File: HttpGroupService.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * /hai/group/profile : 获取群组资料
 * 
 * @param command
 * @return
 */
public CommandResponse profile(Command command) {
	CommandResponse commandResponse = new CommandResponse();
	ErrorCode2 errCode = ErrorCode2.ERROR;
	try {
		HaiGroupProfileProto.HaiGroupProfileRequest request = HaiGroupProfileProto.HaiGroupProfileRequest
				.parseFrom(command.getParams());
		String groupId = request.getGroupId();
		LogUtils.requestDebugLog(logger, command, request.toString());

		GroupProfileBean groupBean = UserGroupDao.getInstance().getGroupProfile(groupId);

		if (groupBean != null && StringUtils.isNotBlank(groupBean.getGroupId())) {
			GroupProto.GroupProfile groupProfile = GroupProto.GroupProfile.newBuilder()
					.setId(groupBean.getGroupId()).setName(String.valueOf(groupBean.getGroupName()))
					.setIcon(String.valueOf(groupBean.getGroupPhoto())).build();
			HaiGroupProfileProto.HaiGroupProfileResponse.Builder responseBuilder = HaiGroupProfileProto.HaiGroupProfileResponse
					.newBuilder();
			responseBuilder.setProfile(groupProfile);
			commandResponse.setParams(responseBuilder.build().toByteArray());
			errCode = ErrorCode2.SUCCESS;
		}
	} catch (Exception e) {
		errCode = ErrorCode2.ERROR_SYSTEMERROR;
		LogUtils.requestErrorLog(logger, command, e);
	}
	return commandResponse.setErrCode2(errCode);
}
 
Example 2
Source Project: openzaly   Source File: HttpGroupService.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * /hai/group/profile : 获取群组资料
 * 
 * @param command
 * @return
 */
public CommandResponse profile(Command command) {
	CommandResponse commandResponse = new CommandResponse();
	ErrorCode2 errCode = ErrorCode2.ERROR;
	try {
		HaiGroupProfileProto.HaiGroupProfileRequest request = HaiGroupProfileProto.HaiGroupProfileRequest
				.parseFrom(command.getParams());
		String groupId = request.getGroupId();
		LogUtils.requestDebugLog(logger, command, request.toString());

		GroupProfileBean groupBean = UserGroupDao.getInstance().getGroupProfile(groupId);

		if (groupBean != null && StringUtils.isNotBlank(groupBean.getGroupId())) {
			GroupProto.GroupProfile groupProfile = GroupProto.GroupProfile.newBuilder()
					.setId(groupBean.getGroupId()).setName(String.valueOf(groupBean.getGroupName()))
					.setIcon(String.valueOf(groupBean.getGroupPhoto())).build();
			HaiGroupProfileProto.HaiGroupProfileResponse.Builder responseBuilder = HaiGroupProfileProto.HaiGroupProfileResponse
					.newBuilder();
			responseBuilder.setProfile(groupProfile);
			commandResponse.setParams(responseBuilder.build().toByteArray());
			errCode = ErrorCode2.SUCCESS;
		}
	} catch (Exception e) {
		errCode = ErrorCode2.ERROR_SYSTEMERROR;
		LogUtils.requestErrorLog(logger, command, e);
	}
	return commandResponse.setErrCode2(errCode);
}
 
Example 3
Source Project: openzaly   Source File: HttpGroupService.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * /hai/group/profile : 获取群组资料
 * 
 * @param command
 * @return
 */
public CommandResponse profile(Command command) {
	CommandResponse commandResponse = new CommandResponse();
	ErrorCode2 errCode = ErrorCode2.ERROR;
	try {
		HaiGroupProfileProto.HaiGroupProfileRequest request = HaiGroupProfileProto.HaiGroupProfileRequest
				.parseFrom(command.getParams());
		String groupId = request.getGroupId();
		LogUtils.requestDebugLog(logger, command, request.toString());

		GroupProfileBean groupBean = UserGroupDao.getInstance().getGroupProfile(groupId);

		if (groupBean != null && StringUtils.isNotBlank(groupBean.getGroupId())) {
			GroupProto.GroupProfile groupProfile = GroupProto.GroupProfile.newBuilder()
					.setId(groupBean.getGroupId()).setName(String.valueOf(groupBean.getGroupName()))
					.setIcon(String.valueOf(groupBean.getGroupPhoto())).build();
			HaiGroupProfileProto.HaiGroupProfileResponse.Builder responseBuilder = HaiGroupProfileProto.HaiGroupProfileResponse
					.newBuilder();
			responseBuilder.setProfile(groupProfile);
			commandResponse.setParams(responseBuilder.build().toByteArray());
			errCode = ErrorCode2.SUCCESS;
		}
	} catch (Exception e) {
		errCode = ErrorCode2.ERROR_SYSTEMERROR;
		LogUtils.requestErrorLog(logger, command, e);
	}
	return commandResponse.setErrCode2(errCode);
}