package com.ruoyi.web.modules.store.facade.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.modules.merchant.facade.IMerchantShopFacade;
import com.ruoyi.web.modules.merchant.mapper.BizMerchantMapper;
import com.ruoyi.web.modules.merchant.vo.MerchantShopBriefVO;
import com.ruoyi.web.modules.store.mapper.BizShopMapper;

/**
 * 店铺 Facade（供商户模块：列表与 shop_count）
 */
@Service
public class MerchantShopFacadeImpl implements IMerchantShopFacade
{
    @Autowired
    private BizShopMapper shopMapper;

    @Autowired
    private BizMerchantMapper merchantMapper;

    @Override
    public List<MerchantShopBriefVO> listShopsByMerchantId(Long merchantId)
    {
        return shopMapper.selectBriefByMerchantId(merchantId);
    }

    @Override
    public void incrementShopCount(Long merchantId)
    {
        if (merchantId != null)
        {
            merchantMapper.incrementShopCount(merchantId);
        }
    }

    @Override
    public void decrementShopCount(Long merchantId)
    {
        if (merchantId != null)
        {
            merchantMapper.decrementShopCount(merchantId);
        }
    }
}
