Skip to content

Commit 902f3e4

Browse files
committed
refractor: service 从 core 中剥离
1 parent 2ad262a commit 902f3e4

File tree

147 files changed

+438
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+438
-469
lines changed

ncatbot/core/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
提供 Bot 客户端、事件系统和 API 接口。
55
"""
66

7-
from enum import Enum
87
from .client import BotClient, EventBus, NcatBotEvent, EventType, NcatBotEventFactory
98
from .helper import ForwardConstructor # noqa: F401
109
from .api import BotAPI
@@ -36,10 +35,3 @@
3635
]
3736

3837
__all__.extend(getattr(event, "__all__", [])) # type: ignore
39-
40-
41-
class PermissionGroup(Enum):
42-
# 权限组常量
43-
ROOT = "root"
44-
ADMIN = "admin"
45-
USER = "user"

ncatbot/core/api/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .api_support import SupportAPI
1717

1818
if TYPE_CHECKING:
19-
from ncatbot.core.service import ServiceManager
19+
from ncatbot.service import ServiceManager
2020

2121

2222
class BotAPI(AccountAPI, GroupAPI, MessageAPI, PrivateAPI, SupportAPI):

ncatbot/core/api/api_account.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from typing import Any, Dict, List, Optional, Union, Literal
99
from ncatbot.core.api.client import IAPIClient
10-
from ncatbot.core.service import ServiceManager
10+
from ncatbot.service import ServiceManager
1111

1212
# 前向声明
1313
class CustomFaceList: ...

ncatbot/core/api/api_group/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from typing import List, Optional, Union, Literal
99
from ncatbot.core.api.client import IAPIClient
10-
from ncatbot.core.service import ServiceManager
10+
from ncatbot.service import ServiceManager
1111

1212
# 前向声明
1313
class EssenceMessage: ...

ncatbot/core/api/api_message/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from typing import List, Optional, Union, Literal
99
from ncatbot.core.api.client import IAPIClient
10-
from ncatbot.core.service import ServiceManager
10+
from ncatbot.service import ServiceManager
1111

1212
# 前向声明
1313
class Forward: ...

ncatbot/core/api/api_private.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from typing import Optional, Union
99
from ncatbot.core.api.client import IAPIClient
10-
from ncatbot.core.service import ServiceManager
10+
from ncatbot.service import ServiceManager
1111

1212
class PrivateAPI:
1313
"""

ncatbot/core/api/api_support.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from typing import List, Optional, Union, Literal
99
from ncatbot.core.api.client import IAPIClient
10-
from ncatbot.core.service import ServiceManager
10+
from ncatbot.service import ServiceManager
1111

1212
# 前向声明
1313
class AICharacterList: ...

ncatbot/core/api/utils/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
if TYPE_CHECKING:
1414
from ..client import IAPIClient, APIResponse
15-
from ncatbot.core.service import ServiceManager
15+
from ncatbot.service import ServiceManager
1616

1717
LOG = get_log("API")
1818

ncatbot/core/client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from ncatbot.utils import get_log
1010
from ncatbot.utils.error import NcatBotError
1111
from ncatbot.core.api import BotAPI
12-
from ncatbot.core.service import (
12+
from ncatbot.service import (
1313
ServiceManager,
1414
MessageRouter,
1515
PreUploadService,
1616
UnifiedRegistryService,
1717
)
18-
from ncatbot.core.service.builtin import (
18+
from ncatbot.service import (
1919
PluginConfigService,
2020
FileWatcherService,
2121
PluginDataService,

ncatbot/core/client/lifecycle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
if TYPE_CHECKING:
1919
from ncatbot.core.api import BotAPI
20-
from ncatbot.core.service import ServiceManager
20+
from ncatbot.service import ServiceManager
2121
from .event_bus import EventBus
2222
from .registry import EventRegistry
2323
from .dispatcher import EventDispatcher

0 commit comments

Comments
 (0)