package com.jwipc.shopping.impl;

import com.jwipc.shopping.base.ShoppingCartInfoDTO;
import com.jwipc.shopping.client.ShoppingCartInfoClient;
import com.jwipc.shopping.convert.ShoppingCartConvert;
import com.jwipc.shopping.logic.OnlineMallLogic;
import com.jwipc.shopping.model.po.ShoppingCartInfoPO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 邓京术
 * @date 2025/3/7 16:29
 * @desc
 */

@Service
@RequiredArgsConstructor
public class ShoppingCartInfoClientImpl implements ShoppingCartInfoClient {

    private final OnlineMallLogic onlineMallLogic;
    private final ShoppingCartConvert shoppingCartConvert;
    @Override
    public List<ShoppingCartInfoDTO> getShoppingCartInfoListPO(String billCode, String itemNo) {
        List<ShoppingCartInfoPO> shoppingCartInfoPOS = onlineMallLogic.getShoppingCartInfoListPO(billCode,itemNo);
        return shoppingCartConvert.dto2Entities(shoppingCartInfoPOS);
    }
}
