feat(domain): enhance domain info lookup & handler refactoring
- 도메인 조회(info): 내 도메인 아니면 자동으로 WHOIS 조회 (naver.com 등 지원) - SMS 파싱: 정규식 실패 시 AI 폴백 로직 추가 - 리팩토링: UserService, ConversationService 분리 - 문서: README.md 및 CODE_REVIEW.md 업데이트
This commit is contained in:
@@ -101,7 +101,7 @@ export const manageDomainTool = {
|
||||
action: {
|
||||
type: 'string',
|
||||
enum: ['register', 'check', 'whois', 'list', 'info', 'get_ns', 'set_ns', 'price', 'cheapest'],
|
||||
description: 'price: TLD 가격 조회 (.com 가격, .io 가격), cheapest: 가장 저렴한 TLD 목록 조회, register: 도메인 등록, check: 가용성 확인, whois: WHOIS 조회, list: 내 도메인 목록, info: 도메인 상세정보, get_ns/set_ns: 네임서버 조회/변경',
|
||||
description: 'price: TLD 가격 조회 (.com 가격, .io 가격), cheapest: 가장 저렴한 TLD 목록 조회, register: 도메인 등록, check: 가용성 확인, whois: WHOIS 조회, list: 내 도메인 목록, info: 도메인 상세정보(내 도메인이 아니면 WHOIS 조회), get_ns/set_ns: 네임서버 조회/변경',
|
||||
},
|
||||
domain: {
|
||||
type: 'string',
|
||||
@@ -416,8 +416,21 @@ async function executeDomainAction(
|
||||
|
||||
case 'info': {
|
||||
if (!domain) return '🚫 도메인을 지정해주세요.';
|
||||
|
||||
// 내 도메인이 아니면 WHOIS 조회로 자동 전환
|
||||
const lowerDomain = domain.toLowerCase();
|
||||
const isMyDomain = allowedDomains.some(d => d.toLowerCase() === lowerDomain);
|
||||
|
||||
if (!isMyDomain) {
|
||||
return executeDomainAction('whois', args, allowedDomains, env, telegramUserId, db, userId);
|
||||
}
|
||||
|
||||
const result = await callNamecheapApi('get_domain_info', { domain }, allowedDomains, env, telegramUserId, db, userId);
|
||||
if (result.error) return `🚫 ${result.error}`;
|
||||
|
||||
if (result.error) {
|
||||
// 계정 내 도메인 정보 조회 실패 시 WHOIS로 폴백
|
||||
return executeDomainAction('whois', args, allowedDomains, env, telegramUserId, db, userId);
|
||||
}
|
||||
return `📋 ${domain} 정보\n\n• 생성일: ${result.created}\n• 만료일: ${result.expires}\n• 자동갱신: ${result.auto_renew ? '✅' : '❌'}\n• 잠금: ${result.is_locked ? '🔒' : '🔓'}\n• WHOIS Guard: ${result.whois_guard ? '✅' : '❌'}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user