Search in sources :

Example 6 with LongIdentity

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);
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 7 with LongIdentity

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)));
}
Also used : LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 8 with LongIdentity

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;
}
Also used : MobileNumber(com.stardata.starshop2.sharedcontext.domain.MobileNumber) User(com.stardata.starshop2.authcontext.domain.user.User) ApplicationValidationException(com.stardata.starshop2.sharedcontext.exception.ApplicationValidationException)

Example 9 with LongIdentity

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);
}
Also used : MobileNumber(com.stardata.starshop2.sharedcontext.domain.MobileNumber) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 10 with LongIdentity

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;
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order)

Aggregations

LongIdentity (com.stardata.starshop2.sharedcontext.domain.LongIdentity)11 WxPrepayOrder (com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder)6 Order (com.stardata.starshop2.ordercontext.command.domain.order.Order)5 MobileNumber (com.stardata.starshop2.sharedcontext.domain.MobileNumber)5 User (com.stardata.starshop2.authcontext.domain.user.User)4 WxAuthInfo (com.stardata.starshop2.authcontext.domain.user.WxAuthInfo)3 Product (com.stardata.starshop2.productcontext.command.domain.product.Product)3 ApplicationValidationException (com.stardata.starshop2.sharedcontext.exception.ApplicationValidationException)3 SessionUser (com.stardata.starshop2.sharedcontext.pl.SessionUser)3 Transactional (jakarta.transaction.Transactional)3 Test (org.junit.jupiter.api.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 Rollback (org.springframework.test.annotation.Rollback)3 ShoppingCart (com.stardata.starshop2.ordercontext.command.domain.shoppingcart.ShoppingCart)1 ProductSettlement (com.stardata.starshop2.productcontext.command.domain.product.ProductSettlement)1 Shop (com.stardata.starshop2.shopcontext.domain.Shop)1