當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpPacket.getData方法代碼示例

本文整理匯總了Java中org.grain.httpserver.HttpPacket.getData方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpPacket.getData方法的具體用法?Java HttpPacket.getData怎麽用?Java HttpPacket.getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.grain.httpserver.HttpPacket的用法示例。


在下文中一共展示了HttpPacket.getData方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createOrderRecordHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket createOrderRecordHandle(HttpPacket httpPacket) {
	CreateOrderRecordC message = (CreateOrderRecordC) httpPacket.getData();
	String appId = message.getAppId();
	App app = AppAction.getAppById(appId);
	if (app == null) {
		return null;
	}
	OrderRecordExt orderRecord = OrderRecordAction.createOrderRecord(appId, message.getOrderRecordOrderId(), message.getOrderRecordTotalPrice(), message.getOrderRecordUserId(), message.getOrderRecordOrderDetail(), message.getOrderRecordUserName(), message.getOrderRecordReturnUrl(), message.getOrderRecordNotifyUrl(), message.getOrderGoodsArrayList());
	if (orderRecord == null) {
		return null;
	}
	CreateOrderRecordS.Builder builder = CreateOrderRecordS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setOrderRecordData(OrderRecordAction.getOrderRecordBuilder(orderRecord));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:18,代碼來源:OrderRecordService.java

示例2: updateOrderRecordHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket updateOrderRecordHandle(HttpPacket httpPacket) {
	UpdateOrderRecordC message = (UpdateOrderRecordC) httpPacket.getData();
	OrderRecordExt orderRecord = OrderRecordAction.updateOrderRecord(message.getOrderRecordId(), message.getOrderRecordPayStatus(), message.getOrderRecordStatus(), message.getOrderRecordPayChannel(), message.getOrderRecordNotifyResult(), message.getOrderRecordNotifyTime());
	if (orderRecord == null) {
		return null;
	}
	List<OrderGoods> orderGoodsList = OrderRecordAction.getOrderGoodsListByOrderRecordId(orderRecord.getOrderRecordId());
	if (orderGoodsList == null) {
		return null;
	}
	orderRecord.orderGoodsArray = orderGoodsList;
	UpdateOrderRecordS.Builder builder = UpdateOrderRecordS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setOrderRecordData(OrderRecordAction.getOrderRecordBuilder(orderRecord));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:18,代碼來源:OrderRecordService.java

示例3: getOrderRecordListHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getOrderRecordListHandle(HttpPacket httpPacket) {
	GetOrderRecordListC message = (GetOrderRecordListC) httpPacket.getData();
	long count = OrderRecordAction.getOrderRecordListCount(message.getAppId(), message.getOrderRecordOrderId(), message.getOrderRecordCreateTimeGreaterThan(), message.getOrderRecordCreateTimeLessThan(), message.getOrderRecordPayStatus(), message.getOrderRecordStatus(), message.getOrderRecordUserId(), message.getOrderRecordPayChannel(), message.getOrderRecordOrderDetail(), message.getOrderRecordNotifyResult());
	if (count == -1) {
		return null;
	}
	PageObj pageObj = PageFormat.getStartAndEnd(message.getCurrentPage(), message.getPageSize(), (int) count);
	List<OrderRecordExt> orderRecordList = OrderRecordAction.getOrderRecordList(message.getAppId(), message.getOrderRecordOrderId(), message.getOrderRecordCreateTimeGreaterThan(), message.getOrderRecordCreateTimeLessThan(), message.getOrderRecordPayStatus(), message.getOrderRecordStatus(), message.getOrderRecordUserId(), message.getOrderRecordPayChannel(), message.getOrderRecordOrderDetail(), message.getOrderRecordNotifyResult(), pageObj.start, pageObj.pageSize);
	if (orderRecordList == null) {
		return null;
	}
	GetOrderRecordListS.Builder builder = GetOrderRecordListS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	for (int i = 0; i < orderRecordList.size(); i++) {
		OrderRecordExt orderRecord = orderRecordList.get(i);
		List<OrderGoods> orderGoodsList = OrderRecordAction.getOrderGoodsListByOrderRecordId(orderRecord.getOrderRecordId());
		orderRecord.orderGoodsArray = orderGoodsList;
		builder.addOrderRecordList(OrderRecordAction.getOrderRecordBuilder(orderRecord));
	}
	builder.setCurrentPage(pageObj.currentPage);
	builder.setAllNum(pageObj.allNum);
	builder.setPageSize(pageObj.pageSize);
	builder.setTotalPage(pageObj.totalPage);
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:27,代碼來源:OrderRecordService.java

示例4: getAppListHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getAppListHandle(HttpPacket httpPacket) {
	GetAppListC message = (GetAppListC) httpPacket.getData();
	long count = AppAction.getAppListCount(message.getAppName(), message.getAppCreateTimeGreaterThan(), message.getAppCreateTimeLessThan(), message.getAppState());
	if (count == -1) {
		return null;
	}
	PageObj pageObj = PageFormat.getStartAndEnd(message.getCurrentPage(), message.getPageSize(), (int) count);
	List<App> appList = AppAction.getAppList(message.getAppName(), message.getAppCreateTimeGreaterThan(), message.getAppCreateTimeLessThan(), message.getAppState(), pageObj.start, pageObj.pageSize);
	if (appList == null) {
		return null;
	}
	GetAppListS.Builder builder = GetAppListS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	for (int i = 0; i < appList.size(); i++) {
		App app = appList.get(i);
		builder.addAppList(AppAction.getAppBuilder(app));
	}
	builder.setCurrentPage(pageObj.currentPage);
	builder.setAllNum(pageObj.allNum);
	builder.setPageSize(pageObj.pageSize);
	builder.setTotalPage(pageObj.totalPage);
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:25,代碼來源:AppService.java

示例5: getUserGroupListHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getUserGroupListHandle(HttpPacket httpPacket) throws HttpException {
	GetUserGroupListC message = (GetUserGroupListC) httpPacket.getData();

	List<UserGroup> userGroupList = UserGroupAction.getUserGroupList(message.getUserGroupParentId(), message.getIsUserGroupParentIsNull(), message.getIsRecursion(), message.getUserGroupTopId(), message.getUserGroupState(), message.getUserGroupCreateTimeGreaterThan(), message.getUserGroupCreateTimeLessThan(), message.getUserGroupUpdateTimeGreaterThan(), message.getUserGroupUpdateTimeLessThan());
	int currentPage = message.getCurrentPage();
	int pageSize = message.getPageSize();
	PageObj pageObj = PageFormat.getStartAndEnd(currentPage, pageSize, userGroupList.size());
	GetUserGroupListS.Builder builder = GetUserGroupListS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setCurrentPage(pageObj.currentPage);
	builder.setPageSize(pageObj.pageSize);
	builder.setTotalPage(pageObj.totalPage);
	builder.setAllNum(pageObj.allNum);
	if (userGroupList != null) {
		for (int i = pageObj.start; i < pageObj.end; i++) {
			UserGroup userGroup = userGroupList.get(i);
			builder.addUserGroup(UserGroupAction.getUserGroupDataBuilder(userGroup));
		}
	}

	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:24,代碼來源:UserGroupService.java

示例6: getUserHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getUserHandle(HttpPacket httpPacket) throws HttpException {
	GetUserC message = (GetUserC) httpPacket.getData();
	User user;
	if (StringUtil.stringIsNull(message.getUserId())) {
		user = (User) httpPacket.hSession.otherData;
	} else {
		user = UserAction.getUserById(message.getUserId());

	}
	if (user == null) {
		UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_4, httpPacket.hSession.headParam.hOpCode);
		throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack);
	}
	GetUserS.Builder builder = GetUserS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setUser(UserAction.getUserDataBuilder(user, httpPacket.hSession.headParam.token));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:20,代碼來源:UserService.java

示例7: getUserListHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getUserListHandle(HttpPacket httpPacket) {
	GetUserListC message = (GetUserListC) httpPacket.getData();
	List<User> userList = UserAction.getUserList(message.getUserGroupId(), message.getIsRecursion(), message.getIsUserGroupIsNull(), message.getUserState(), message.getUserSex(), message.getUserRole(), message.getUserGroupTopId(), message.getUserName(), message.getUserCreateTimeGreaterThan(), message.getUserCreateTimeLessThan(), message.getUserUpdateTimeGreaterThan(), message.getUserUpdateTimeLessThan());
	int currentPage = message.getCurrentPage();
	int pageSize = message.getPageSize();
	PageObj pageObj = PageFormat.getStartAndEnd(currentPage, pageSize, userList.size());
	GetUserListS.Builder builder = GetUserListS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setCurrentPage(pageObj.currentPage);
	builder.setPageSize(pageObj.pageSize);
	builder.setTotalPage(pageObj.totalPage);
	builder.setAllNum(pageObj.allNum);
	if (userList != null) {
		for (int i = pageObj.start; i < pageObj.end; i++) {
			User user = userList.get(i);
			builder.addUser(UserAction.getUserDataBuilder(user, httpPacket.hSession.headParam.token));
		}
	}
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:22,代碼來源:UserService.java

示例8: getUserImgHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public ReplyImage getUserImgHandle(HttpPacket httpPacket) {
	GetUserImgC message = (GetUserImgC) httpPacket.getData();
	User user;
	if (StringUtil.stringIsNull(message.getUserId())) {
		user = (User) httpPacket.hSession.otherData;
	} else {
		user = UserAction.getUserById(message.getUserId());

	}
	if (user == null) {
		return null;
	}
	File file = UserAction.getUserImg(user.getUserImg());
	ReplyImage replyImage = new ReplyImage(file);
	return replyImage;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:17,代碼來源:UserService.java

示例9: loginHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket loginHandle(HttpPacket httpPacket) throws HttpException {
	LoginC message = (LoginC) httpPacket.getData();
	UserData userData = IdentityAction.getUser(message.getToken());
	if (userData == null) {
		PCError errorPack = PCErrorPack.create(PCErrorCode.ERROR_CODE_4, httpPacket.hSession.headParam.hOpCode);
		throw new HttpException(HOpCode.PC_ERROR, errorPack);
	}
	LoginS.Builder builder = LoginS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:13,代碼來源:LoginService.java

示例10: createAppHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket createAppHandle(HttpPacket httpPacket) {
	CreateAppC message = (CreateAppC) httpPacket.getData();
	App app = AppAction.createApp(message.getAppName(), message.getAppReturnUrl(), message.getAppNotifyUrl());
	if (app == null) {
		return null;
	}
	CreateAppS.Builder builder = CreateAppS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setApp(AppAction.getAppBuilder(app));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:13,代碼來源:AppService.java

示例11: updateAppHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket updateAppHandle(HttpPacket httpPacket) {
	UpdateAppC message = (UpdateAppC) httpPacket.getData();
	App app = AppAction.updateApp(message.getAppId(), message.getAppName(), message.getUpdateAppKey(), message.getAppState(), message.getAppReturnUrl(), message.getAppNotifyUrl());
	if (app == null) {
		return null;
	}
	UpdateAppS.Builder builder = UpdateAppS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setApp(AppAction.getAppBuilder(app));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:13,代碼來源:AppService.java

示例12: getAppHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getAppHandle(HttpPacket httpPacket) {
	GetAppC message = (GetAppC) httpPacket.getData();
	App app = AppAction.getAppById(message.getAppId());
	if (app == null) {
		return null;
	}
	GetAppS.Builder builder = GetAppS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setApp(AppAction.getAppBuilder(app));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:epay,代碼行數:13,代碼來源:AppService.java

示例13: createUserGroupHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket createUserGroupHandle(HttpPacket httpPacket) throws HttpException {
	CreateUserGroupC message = (CreateUserGroupC) httpPacket.getData();
	UserGroup userGroup = UserGroupAction.createUserGroup(message.getUserGroupName(), message.getUserGroupParentId());
	if (userGroup == null) {
		UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_10, httpPacket.hSession.headParam.hOpCode);
		throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack);
	}
	CreateUserGroupS.Builder builder = CreateUserGroupS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setUserGroup(UserGroupAction.getUserGroupDataBuilder(userGroup));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:14,代碼來源:UserGroupService.java

示例14: updateUserGroupHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket updateUserGroupHandle(HttpPacket httpPacket) throws HttpException {
	UpdateUserGroupC message = (UpdateUserGroupC) httpPacket.getData();
	UserGroup userGroup = UserGroupAction.updateUserGroup(message.getUserGroupId(), message.getUserGroupName(), message.getIsUpdateUserGroupParent(), message.getUserGroupParentId(), message.getUserGroupState());
	if (userGroup == null) {
		UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_11, httpPacket.hSession.headParam.hOpCode);
		throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack);
	}
	UpdateUserGroupS.Builder builder = UpdateUserGroupS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setUserGroup(UserGroupAction.getUserGroupDataBuilder(userGroup));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:14,代碼來源:UserGroupService.java

示例15: getUserGroupHandle

import org.grain.httpserver.HttpPacket; //導入方法依賴的package包/類
public HttpPacket getUserGroupHandle(HttpPacket httpPacket) throws HttpException {
	GetUserGroupC message = (GetUserGroupC) httpPacket.getData();

	UserGroup userGroup = UserGroupAction.getUserGroupById(message.getUserGroupId());
	if (userGroup == null) {
		UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_12, httpPacket.hSession.headParam.hOpCode);
		throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack);
	}

	GetUserGroupS.Builder builder = GetUserGroupS.newBuilder();
	builder.setHOpCode(httpPacket.hSession.headParam.hOpCode);
	builder.setUserGroup(UserGroupAction.getUserGroupDataBuilder(userGroup));
	HttpPacket packet = new HttpPacket(httpPacket.hSession.headParam.hOpCode, builder.build());
	return packet;
}
 
開發者ID:dianbaer,項目名稱:startpoint,代碼行數:16,代碼來源:UserGroupService.java


注:本文中的org.grain.httpserver.HttpPacket.getData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。