package com.emoon.openplatform.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.emoon.common.core.utils.StringUtils;
import com.emoon.openplatform.domain.SysProjectDo;
import com.emoon.openplatform.mapper.SysProjectMapper;
import com.emoon.openplatform.service.ISysProjectService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author destiny
 * @description:
 * @date 2025/9/29 10:45
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SysProjectServiceImpl implements ISysProjectService {

    private final SysProjectMapper sysProjectMapper;

    @Override
    public SysProjectDo queryByPublicKey(String publicKey) {
        if (StringUtils.isBlank(publicKey)) {
            return null;
        }
        QueryWrapper<SysProjectDo> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
            .eq(SysProjectDo::getPublicKey, publicKey);
        return sysProjectMapper.selectOne(queryWrapper);
    }
}
