diff options
| author | 2024-09-19 14:44:33 +0800 | |
|---|---|---|
| committer | 2024-09-19 14:44:33 +0800 | |
| commit | e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9 (patch) | |
| tree | a3e31e07fd001baa1cfce9ceebcdfed58b50bcda /hrc/dev | |
| parent | 9e18d7ebf7a17bb7d7d169da3a3cefde0956a9f9 (diff) | |
| download | HydroRollCore-e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9.tar.gz HydroRollCore-e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9.zip | |
feat(core): Implement Service class and related functionalities
Co-authored-by: yuzhe <YUZHEthefool@users.noreply.github.com>
Diffstat (limited to 'hrc/dev')
| -rw-r--r-- | hrc/dev/__init__.py | 2 | ||||
| -rw-r--r-- | hrc/dev/api/__init__.py | 0 | ||||
| -rw-r--r-- | hrc/dev/echo.py | 98 | ||||
| -rw-r--r-- | hrc/dev/grps/v1.py | 22 |
4 files changed, 116 insertions, 6 deletions
diff --git a/hrc/dev/__init__.py b/hrc/dev/__init__.py index cf99d7f..ea8f56b 100644 --- a/hrc/dev/__init__.py +++ b/hrc/dev/__init__.py @@ -1 +1 @@ -from .grps import v1
\ No newline at end of file +from hrc.dev.grps import v1
\ No newline at end of file diff --git a/hrc/dev/api/__init__.py b/hrc/dev/api/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/hrc/dev/api/__init__.py diff --git a/hrc/dev/echo.py b/hrc/dev/echo.py index 7107159..5bdeab7 100644 --- a/hrc/dev/echo.py +++ b/hrc/dev/echo.py @@ -4,12 +4,102 @@ :ref: https://echo.hydroroll.team """ -class WorkFlow(object): +class Event(object): + """事件基类 + :ref: https://echo.hydroroll.team/Event/#0_event + """ + def __init__(self, event_type, data, metadata): + self.event_type = event_type + self.data = data + self.metadata = metadata + +class WorkFlow(Event): """workflow :ref: https://echo.hydroroll.team/Event/#1_workflow """ - -class CallBack(object): + def __init__(self, data, metadata): + super().__init__('workflow', data, metadata) + +class CallBack(Event): """callback :ref: https://echo.hydroroll.team/Event/#4_callback - """
\ No newline at end of file + """ + def __init__(self, data, metadata): + super().__init__('callback', data, metadata) + +class Message(Event): + """message + :ref: https://echo.hydroroll.team/Event/#2_message + """ + def __init__(self, data, metadata): + super().__init__('message', data, metadata) + +class Reaction(Event): + """reaction + :ref: https://echo.hydroroll.team/Event/#3_reaction + """ + def __init__(self, data, metadata): + super().__init__('reaction', data, metadata) + +class Typing(Event): + """typing + :ref: https://echo.hydroroll.team/Event/#5_typing + """ + def __init__(self, data, metadata): + super().__init__('typing', data, metadata) + +class UserJoin(Event): + """user join + :ref: https://echo.hydroroll.team/Event/#6_user_join + """ + def __init__(self, data, metadata): + super().__init__('user_join', data, metadata) + +class UserLeave(Event): + """user leave + :ref: https://echo.hydroroll.team/Event/#7_user_leave + """ + def __init__(self, data, metadata): + super().__init__('user_leave', data, metadata) + +class FileShare(Event): + """file share + :ref: https://echo.hydroroll.team/Event/#8_file_share + """ + def __init__(self, data, metadata): + super().__init__('file_share', data, metadata) + +class Mention(Event): + """mention + :ref: https://echo.hydroroll.team/Event/#9_mention + """ + def __init__(self, data, metadata): + super().__init__('mention', data, metadata) + +class ChannelCreate(Event): + """channel create + :ref: https://echo.hydroroll.team/Event/#10_channel_create + """ + def __init__(self, data, metadata): + super().__init__('channel_create', data, metadata) + +class ChannelDelete(Event): + """channel delete + :ref: https://echo.hydroroll.team/Event/#11_channel_delete + """ + def __init__(self, data, metadata): + super().__init__('channel_delete', data, metadata) + +class ChannelUpdate(Event): + """channel update + :ref: https://echo.hydroroll.team/Event/#12_channel_update + """ + def __init__(self, data, metadata): + super().__init__('channel_update', data, metadata) + +class UserUpdate(Event): + """user update + :ref: https://echo.hydroroll.team/Event/#13_user_update + """ + def __init__(self, data, metadata): + super().__init__('user_update', data, metadata)
\ No newline at end of file diff --git a/hrc/dev/grps/v1.py b/hrc/dev/grps/v1.py index 5af118c..9402c4b 100644 --- a/hrc/dev/grps/v1.py +++ b/hrc/dev/grps/v1.py @@ -1 +1,21 @@ -__version__ = "1.0.0-alpha.1"
\ No newline at end of file +from pydantic import BaseModel + + +__version__ = "1.0.0-alpha.1" + +class GRPS(BaseModel): + def __init__(self, *args, **kwargs): + self.args = args + self.kwargs = kwargs + + def run(self): + pass + + def start(self): + pass + + def stop(self): + pass + + def restart(self): + pass |
