package com.czg.service.account.service.impl;

import com.czg.account.dto.ShopConfigDTO;
import com.czg.account.entity.ShopConfig;
import com.czg.account.service.ShopConfigService;
import com.czg.sa.StpKit;
import com.czg.service.account.mapper.ShopConfigMapper;
import com.czg.service.account.mapper.ShopInfoMapper;
import com.czg.utils.PageUtil;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * 店铺配置扩展
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-04-03
 */
@DubboService
public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopConfig> implements ShopConfigService {

    @Resource
    private ShopInfoMapper shopInfoMapper;

    private QueryWrapper buildQueryWrapper(ShopConfigDTO param) {
        QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
        /*if (StrUtil.isNotEmpty(param.getName())) {
            queryWrapper.like(ShopConfig::getName, param.getName());
        }*/
        Long shopId = StpKit.USER.getLoginIdAsLong();
        queryWrapper.eq(ShopConfig::getMainId, shopId);
        queryWrapper.orderBy(ShopConfig::getId, false);
        return queryWrapper;
    }


}