package shop.alien.store.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import shop.alien.entity.store.TagStoreRelation;
import shop.alien.mapper.StoreTagDetailMapper;
import shop.alien.store.service.StoreTagDetailService;

/**
 * 店铺标签详情服务实现类
 *
 * @author system
 * @since 2025-01-01
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class StoreTagDetailServiceImpl implements StoreTagDetailService {
    
    private final StoreTagDetailMapper storeTagDetailMapper;
    
    @Override
    public TagStoreRelation getStoreTagDetailByStoreId(Integer storeId) {
        log.info("StoreTagDetailServiceImpl.getStoreTagDetailByStoreId?storeId={}", storeId);
        if (storeId == null) {
            log.warn("店铺ID为空");
            return null;
        }
        TagStoreRelation tagStoreRelation = storeTagDetailMapper.selectStoreTagDetailByStoreId(storeId);
        log.info("查询店铺标签详情结果: {}", tagStoreRelation != null ? "查询成功" : "未找到数据");
        return tagStoreRelation;
    }
}
