|  | @@ -0,0 +1,28 @@
 | 
	
		
			
				|  |  | +package com.tzld.longarticle.recommend.server.service.api.impl;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId;
 | 
	
		
			
				|  |  | +import com.tzld.longarticle.recommend.server.repository.longArticle.LongArticlesRootSourceIdRepository;
 | 
	
		
			
				|  |  | +import com.tzld.longarticle.recommend.server.service.api.ApiService;
 | 
	
		
			
				|  |  | +import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.Objects;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +@Service
 | 
	
		
			
				|  |  | +@Slf4j
 | 
	
		
			
				|  |  | +public class ApiServiceImpl implements ApiService {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    LongArticlesRootSourceIdRepository longArticlesRootSourceIdRepository;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public String getGhIdByRootSourceId(String rootSourceId) {
 | 
	
		
			
				|  |  | +        LongArticlesRootSourceId longArticlesRootSourceId = longArticlesRootSourceIdRepository.getByRootSourceId(rootSourceId);
 | 
	
		
			
				|  |  | +        if (Objects.isNull(longArticlesRootSourceId)) {
 | 
	
		
			
				|  |  | +            return null;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return longArticlesRootSourceId.getGhId();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 |