Search in sources :

Example 11 with LongIdentity

use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.

the class OrderManagingService method setInvisible.

public Order setInvisible(LongIdentity orderId) {
    Order order = orderRepository.instanceOf(orderId);
    order.setInvisible();
    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)

Example 12 with LongIdentity

use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.

the class ProductAppService method getDetail.

public ProductResponse getDetail(Long productIdLong) {
    LongIdentity productId = LongIdentity.from(productIdLong);
    Product product = managingService.detail(productId);
    return ProductResponse.from(product);
}
Also used : Product(com.stardata.starshop2.productcontext.command.domain.product.Product) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 13 with LongIdentity

use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.

the class ShopAppService method getDetail.

public ShopResponse getDetail(Long shopIdLong) {
    LongIdentity shopId = LongIdentity.from(shopIdLong);
    Shop shop = managingService.detail(shopId);
    return ShopResponse.from(shop);
}
Also used : Shop(com.stardata.starshop2.shopcontext.domain.Shop) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 14 with LongIdentity

use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.

the class OrderAppService method prepay.

public PrepayResponse prepay(Long orderIdLong) {
    LongIdentity orderId = LongIdentity.from(orderIdLong);
    WxPrepayOrder prepay = managingService.prepayOrder(orderId);
    return PrepayResponse.from(prepay);
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 15 with LongIdentity

use of com.stardata.starshop2.sharedcontext.domain.LongIdentity in project starshop by beautautumn.

the class ShoppingCartManagingService method queryShoppingCart.

public ShoppingCart queryShoppingCart(LongIdentity userId, LongIdentity shopId) {
    ShoppingCart shoppingCart = shoppingCartRepository.findForUserInShop(userId, shopId);
    settlementClient.settleProducts(shoppingCart);
    return shoppingCart;
}
Also used : ShoppingCart(com.stardata.starshop2.ordercontext.command.domain.shoppingcart.ShoppingCart)

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