package shop.alien.store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import shop.alien.entity.store.LifeUserExpertOrder;
import shop.alien.entity.store.LifeUserExpertWorks;
import shop.alien.entity.store.vo.LifeUserExpertWorksVo;
import shop.alien.mapper.LifeUserExpertOrderMapper;
import shop.alien.mapper.LifeUserExpertWorksMapper;
import shop.alien.store.service.LifeUserExpertOrderService;
import shop.alien.store.service.LifeUserExpertWorksService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 达人作品表 服务实现类
 * </p>
 *
 * @author ssk
 * @since 2025-02-19
 */
@Service
@RequiredArgsConstructor
public class LifeUserExpertWorksServiceImpl extends ServiceImpl<LifeUserExpertWorksMapper, LifeUserExpertWorks> implements LifeUserExpertWorksService {

    private final LifeUserExpertWorksMapper lifeUserExpertWorksMapper;
    private final LifeUserExpertOrderMapper lifeUserExpertOrderMapper;
    private final LifeUserExpertOrderService lifeUserExpertOrderService;


    @Override
    public Map<String, Object> getExpertOrderByStoreId(Long storeId) {
        Map<String, Object> params = new HashMap<>();
        List<LifeUserExpertWorksVo> expertOrderByStoreId = lifeUserExpertWorksMapper.getExpertOrderByStoreId(storeId);
        LambdaQueryWrapper<LifeUserExpertOrder> expertOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
        expertOrderLambdaQueryWrapper.eq(LifeUserExpertOrder::getStoreId, storeId);
        List<LifeUserExpertOrder> lifeUserExpertOrders = lifeUserExpertOrderMapper.selectList(expertOrderLambdaQueryWrapper);
        for (LifeUserExpertOrder lifeUserExpertOrder : lifeUserExpertOrders) {
            Integer id = lifeUserExpertOrder.getId();
            Integer expertId = lifeUserExpertOrder.getExpertId();

        }
        params.put("LifeUserExpertWorks", expertOrderByStoreId);
        params.put("lifeUserExpertOrders", lifeUserExpertOrders);
        return params;
    }
}
