use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class OrderAppService method getDetail.
public OrderResponse getDetail(Long orderIdLong) {
LongIdentity orderId = LongIdentity.from(orderIdLong);
Order order = managingService.detail(orderId);
return OrderResponse.from(order);
}
use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class ShoppingCartAppService method query.
public ShoppingCartResponse query(Long userIdLong, Long shopIdLong) {
LongIdentity userId = LongIdentity.from(userIdLong);
LongIdentity shopId = LongIdentity.from(shopIdLong);
return ShoppingCartResponse.from((shoppingCartManagingService.queryShoppingCart(userId, shopId)));
}
use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class MobileNumberDecryptingService method decryptWxMobileNumber.
public MobileNumber decryptWxMobileNumber(LongIdentity userId, String encryptedData, String iv) {
User user = repository.instanceOf(userId);
if (user == null) {
throw new ApplicationValidationException(ApplicationValidationException.INVALID_REQUEST_ENTITY, "The user is not exists.");
}
MobileNumber mobileNumber = decryptingClient.decryptMobileNumber(user.currentToken(), encryptedData, iv);
user.updateMobileNumber(mobileNumber);
repository.update(user);
return mobileNumber;
}
use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class AuthAppService method decryptWxMobileNumber.
public MobileNumberResponse decryptWxMobileNumber(SessionUser loginUser, WxEncryptedUserInfo encryptedUserInfo) {
LongIdentity userId = LongIdentity.from(loginUser.getId());
String encryptedData = encryptedUserInfo.getEncryptedData();
String iv = encryptedUserInfo.getIv();
MobileNumber mobileNumber = decryptService.decryptWxMobileNumber(userId, encryptedData, iv);
return MobileNumberResponse.from(mobileNumber);
}
use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.
the class OrderManagingService method closeOrder.
public Order closeOrder(LongIdentity orderId) {
Order order = orderRepository.instanceOf(orderId);
order.close();
orderRepository.update(order);
return order;
}
Aggregations